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 00:22:06 +0300 Message-ID: <87zj5g2idd.fsf@gmail.com> References: <8761873tx7.fsf@gmail.com> <87a8xgi27p.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqTGg-0001PH-TZ for emacs-orgmode@gnu.org; Thu, 07 May 2015 17:23:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqTGb-0003Ib-K0 for emacs-orgmode@gnu.org; Thu, 07 May 2015 17:23:42 -0400 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:37738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqTGb-0003IF-DG for emacs-orgmode@gnu.org; Thu, 07 May 2015 17:23:37 -0400 Received: by widdi4 with SMTP id di4so6475118wid.0 for ; Thu, 07 May 2015 14:23:36 -0700 (PDT) In-Reply-To: <87a8xgi27p.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Thu, 07 May 2015 22:04:26 +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 , emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Nicolas Goaziou writes: > Using `with-current-buffer' is more appropriate since the change is > temporary. > > > Could you provide a patch using git format-patch, with a proper commit > message? Hello Nicolas, Please let me know if I didn't export the patch properly (patch attached). --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Making-sure-the-buffer-pointed-by-org-babel-current-.patch Content-Description: marker in wrong buffer patch >From fdc1409602b48ba5f4cd1b5be6264d8311b8b11c Mon Sep 17 00:00:00 2001 From: wvxvw Date: Fri, 8 May 2015 00:14:11 +0300 Subject: [PATCH] Making sure the buffer pointed by org-babel-current-src-block-location is active when moving to the source block. --- lisp/ob-ref.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ob-ref.el b/lisp/ob-ref.el index b8a921e..81d4471 100644 --- a/lisp/ob-ref.el +++ b/lisp/ob-ref.el @@ -90,7 +90,9 @@ the variable." (let ((out (save-excursion (when org-babel-current-src-block-location (goto-char (if (markerp org-babel-current-src-block-location) - (marker-position org-babel-current-src-block-location) + (with-current-buffer + (marker-buffer org-babel-current-src-block-location) + (marker-position org-babel-current-src-block-location)) org-babel-current-src-block-location))) (org-babel-read ref)))) (if (equal out ref) -- 2.1.0 --=-=-= Content-Type: text/plain Best, Oleg --=-=-=--