diff options
author | Achim Gratz <Stromeko@Stromeko.DE> | 2013-11-12 21:55:53 +0100 |
---|---|---|
committer | Achim Gratz <Stromeko@Stromeko.DE> | 2013-11-13 19:22:52 +0100 |
commit | b6448c4225bc83299da1bd08c2d2e8b77e0bcd13 (patch) | |
tree | 2d14cd74779870d65669cd1b2a7ee9c06e77d1bf | |
parent | 6a39355eeea427f4675d58d18f58321266328637 (diff) | |
download | org-mode-b6448c4225bc83299da1bd08c2d2e8b77e0bcd13.tar.gz |
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.
-rw-r--r-- | lisp/ob-ref.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/ob-ref.el b/lisp/ob-ref.el index 5a3c8ba..251fa55 100644 --- a/lisp/ob-ref.el +++ b/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) |