emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] org-babel-demarcate-block: split using element API


From: gerard . vermeulen
Subject: Re: [PATCH] org-babel-demarcate-block: split using element API
Date: Sun, 14 Jan 2024 10:53:48 +0000



On 13.01.2024 21:16, gerard.vermeulen@posteo.net wrote:
On 13.01.2024 16:17, Ihor Radchenko wrote:
gerard.vermeulen@posteo.net writes:

Attached you'll find a new patch addressing all you issues.

Thanks!
I tried to run make test, and I am getting
   FAILED  test-ob/demarcate-block  ((should (string= region-text
(org-trim (nth 1 info)))) :form (string= "mark this line as region"
"") :value nil :explanation (arrays-of-different-length 24 0 "mark
this line as region" "" first-mismatch-at 0))

I have improved a regexp used to mark a region in this sub-test
improving the robustness of the code.
Furthermore, I have replaced all occurrences of (set-mark (point))
with (set-mark-command nil), but I doubt that this is the reason.

Nevertheless, I feel I need to point out the limitation of this particular
test case.

[...]
The text after (mark) and (point) is misaligned.
I tend to mark regions in a way that is compatible with the patch,
but some users won't (maybe they are willing to adapt).

Patch attached.

I found a way to preserve the (current-column) of text after point and
mark in the element API code so that point or region splitting behaves
like main where the (current-column)'s remain preserved naturally.

I think this is preferable with respect to the previous patch (at least
it does not break the expectations of current users).

It allowed a minor simplification of the sub-test that failed in your case.

New patch attached.

Regards -- Gerard

Attachment: 0001-org-babel-demarcate-block-split-using-element-API.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]