emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Oleg Sivokon <olegsivokon@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: org-babel-ref-parse needs to set current buffer to the buffer of the marker [8.2.2 (release_8.2.2-188-gc57372 @ /home/wvxvw/Projects/org-mode/lisp/)]
Date: Fri, 08 May 2015 16:18:58 +0300	[thread overview]
Message-ID: <87pp6b2on1.fsf@gmail.com> (raw)
In-Reply-To: <87oalvh3y4.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Fri, 08 May 2015 10:24:35 +0200")

Nicolas Goaziou <mail@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	other threads:[~2015-05-08 13:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05 15:50 Bug: org-babel-ref-parse needs to set current buffer to the buffer of the marker [8.2.2 (release_8.2.2-188-gc57372 @ /home/wvxvw/Projects/org-mode/lisp/)] Oleg Sivokon
2015-05-07 20:04 ` Nicolas Goaziou
2015-05-07 21:22   ` Oleg Sivokon
2015-05-08  8:24     ` Nicolas Goaziou
2015-05-08 13:18       ` Oleg Sivokon [this message]
2015-05-08 22:08         ` Nicolas Goaziou
2015-05-08 23:01           ` Oleg Sivokon
2015-05-09  9:04             ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pp6b2on1.fsf@gmail.com \
    --to=olegsivokon@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).