From 2f4c85e6b4bc7ae9e7f0f2481ef3f31758f260ee Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 24 Nov 2012 22:13:55 +0100 Subject: [PATCH] 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. --- lisp/ob-exp.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index 0a02ea193..461421ecc 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))