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: Sat, 13 Jan 2024 20:16:31 +0000



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.

Prerequisites:
#+begin_src emacs-lisp :results silent
(setopt org-adapt-indentation t
        org-edit-src-content-indentation 2
        org-src-preserve-indentation nil)
#+end_src

When I mark really the line containing "mark this line as region"
C-u C-C C-v C-d works nicely (done in the sub-test).
********** 10 stars with region between two lines
           #+header: :var b="also seen"
           #+begin_src any-language -i -n :var a="seen"
             to upper block
             mark this line as region
             to lower block
           #+end_src

but C-u C-c C-v C-d after marking ' this line as ' produces this:
********** 10 stars with region between two lines
           #+header: :var b="also seen"
           #+begin_src any-language -i -n :var a="seen"
             to upper block
             mark
           #+end_src
**********
           #+header: :var b="also seen"
           #+begin_src any-language -i -n :var a="seen"
 this line as
           #+end_src
**********
           #+header: :var b="also seen"
           #+begin_src any-language -i -n :var a="seen"
region
             to lower block
           #+end_src

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.

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]