From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Sivokon 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 Message-ID: <87pp6b2on1.fsf@gmail.com> References: <8761873tx7.fsf@gmail.com> <87a8xgi27p.fsf@nicolasgoaziou.fr> <87zj5g2idd.fsf@gmail.com> <87oalvh3y4.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqiCd-0007uG-CF for emacs-orgmode@gnu.org; Fri, 08 May 2015 09:20:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqiCa-00054H-5O for emacs-orgmode@gnu.org; Fri, 08 May 2015 09:20:31 -0400 Received: from mail-wg0-x230.google.com ([2a00:1450:400c:c00::230]:36106) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqiCZ-00054A-VH for emacs-orgmode@gnu.org; Fri, 08 May 2015 09:20:28 -0400 Received: by wgiu9 with SMTP id u9so72354069wgi.3 for ; Fri, 08 May 2015 06:20:27 -0700 (PDT) In-Reply-To: <87oalvh3y4.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Fri, 08 May 2015 10:24:35 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Nicolas Goaziou 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