Browse Source

ob-ref: Fix "Marker points into wrong buffer" error

* lisp/ob-ref.el (org-babel-ref-parse): If
  `org-babel-current-src-block-location' is a marker, it can be from
  another buffer, use marker-position instead in this case.

Introduced with r114064 on Emacs trunk.  Not sure if this is a bug in
Org or Emacs, but the patch restores the previous behaviour.
Achim Gratz 11 years ago
parent
commit
b6448c4225
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lisp/ob-ref.el

+ 3 - 1
lisp/ob-ref.el

@@ -85,7 +85,9 @@ the variable."
       (cons (intern var)
 	    (let ((out (save-excursion
 			 (when org-babel-current-src-block-location
-			   (goto-char org-babel-current-src-block-location))
+			   (goto-char (if (markerp 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)
 		  (if (string-match "^\".*\"$" ref)