I guess this is a feature of deleting a region with the point in it. This
code, for example, does not preserve point.
#+BEGIN_SRC emacs-lisp
"<>"
(save-excursion
(let* ((p1 (point))
(p2 (re-search-backward (concat "<" ">")))
(content (buffer-substring-no-properties p1 p2)))
(delete-region p1
John Kitchin writes:
> Thanks for the examples.
>
> There is an interesting issue, the following does not save-excursion!
>
> (save-excursion
> (org-dp-rewire 'src-block t t ;cont ins
> t ;aff
> nil ;elem
> :parameters ":results output"))
>
> The point gets moved. Do you know why that happens?
H
Thanks for the examples.
There is an interesting issue, the following does not save-excursion!
(save-excursion
(org-dp-rewire 'src-block t t ;cont ins
t ;aff
nil ;elem
:parameters ":results output"))
The point gets moved. Do you know why that happens?
John
Thorsten Jolitz writes:
PS
One more to show that one can not only easily modify a certain
org element, but that its just as easy to convert it to another type of
org element.
Use this (call M-x tj/obch)
#+BEGIN_SRC emacs-lisp
(defun tj/obch ()
"docstring"
(interactive)
(org-dp-rewire '
John Kitchin writes:
Hallo,
> This is a neat idea.
This is quite a nice use/show case for org-dp too.
I did not really try to solve the users feature request, just wanted to
demonstrate how different a possible solution looks using declarative
programming, leaving all the low-level parsing an
Thank you, I'll make use of 's. Not well versed in Elisp
libraries. save-excursion is certainly an improvement, too.
signature.asc
Description: PGP signature
This is a neat idea. I sometimes want to switch to silent, or between value
and results. I don't know if you would consider the code below an
improvement, but it seems to do what you want, and is shorter. It has less
checking of things, and is more of a replace the header kind of approach.
Persona
When I have a chance, I enjoy the following development workflow: the
code is written in org files and is tangled into conventional source
code files more or less regularly.
I find that source blocks mostly fall into three categories, numbered
here for further reference:
- examples/test cases/desi