Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> This won't work as `org-babel-read' is not called within the scope of
> `with-current-buffer'.
>
> I think it should be something like this:
>
>   (with-current-buffer
>       (if (markerp org-babel-current-src-block-location)
>           (marker-buffer org-babel-current-src-block-location)
>         (current-buffer))
>     (save-excursion
>       (goto-char org-babel-current-src-block-location)
>       (org-babel-read ref)))
>
> Bonus points if you can write a test about it in "test-ob.el".

Hi Nicolas,

I've started working on the test as I realized that the behavior no
longer reproduces (since I've filed the bug, I've rebuilt my
Emacs...).  Now even if the marker is initially in the wrong buffer, if
you call `marker-position', it still succeeds.  I checked the history of
`marker-position' source and `CHECK_MARKER' source, but there was no
change there recent enough to suspect them to be the reason of the
behavior I've seen.  I've tried going back to Emacs 24.5 (the one
installed from distribution package manager), but it's not compatible
with the Org version that I've build from the master yesterday.  If this
is important, it is incompatible in that ox-latex expects there to be a
`cl-struct-define' macro, but it probably didn't exist yet in the 24.5
times.

So, I'm not sure, is this still relevant?

Best,

Oleg

Reply via email to