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