summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2012-11-24 22:13:55 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2012-11-24 22:30:06 +0100
commit2f4c85e6b4bc7ae9e7f0f2481ef3f31758f260ee (patch)
treea925ef722deb9b999c19e52061678ed2e52a1a36
parentce8819f18d9d2be000fb70fc4d74b5d96fe07a83 (diff)
downloadorg-mode-2f4c85e6b4bc7ae9e7f0f2481ef3f31758f260ee.tar.gz
ob-exp: Repair inline code evaluation after last commit.
* lisp/ob-exp.el (org-babel-exp-non-block-elements): Make sure to parse inline babel call or inline src block instead of the following object.
-rw-r--r--lisp/ob-exp.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
index 0a02ea1..461421e 100644
--- a/lisp/ob-exp.el
+++ b/lisp/ob-exp.el
@@ -159,7 +159,13 @@ this template."
"\\|" org-babel-lob-one-liner-regexp "\\)")))
(while (re-search-forward rx end t)
(save-excursion
- (let* ((element (save-match-data (org-element-context)))
+ (let* ((element (save-excursion
+ ;; If match is inline, point is at its
+ ;; end. Move backward so
+ ;; `org-element-context' can get the
+ ;; object, not the following one.
+ (backward-char)
+ (save-match-data (org-element-context))))
(type (org-element-type element)))
(when (memq type '(babel-call inline-babel-call inline-src-block))
(let ((beg-el (org-element-property :begin element))