Nicolas Goaziou <m...@nicolasgoaziou.fr> 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).

>From fdc1409602b48ba5f4cd1b5be6264d8311b8b11c Mon Sep 17 00:00:00 2001
From: wvxvw <olegsivo...@gmail.com>
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

Best,

Oleg

Reply via email to