From 10888cbd40e3f546b9e577ff59bfa152679f9628 Mon Sep 17 00:00:00 2001 From: Michael Brand Date: Sat, 11 Aug 2012 20:08:35 +0200 Subject: [PATCH] Improve parsing of org-capture-inside-embedded-elisp-p * org-capture.el (org-capture-inside-embedded-elisp-p): Improve parsing. --- lisp/org-capture.el | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 6882613..4d6e91d 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1539,9 +1539,12 @@ The template may still contain \"%?\" for cursor positioning." (let (beg end) (with-syntax-table emacs-lisp-mode-syntax-table (save-excursion + ;; `looking-at' and `search-backward' below do not match the "%(" if + ;; point is in its middle + (when (equal (char-before) ?%) + (backward-char)) (save-match-data - (when (or (looking-at "%(") - (and (search-backward "%" nil t) (looking-at "%("))) + (when (or (looking-at "%(") (search-backward "%(" nil t)) (setq beg (point)) (setq end (progn (forward-char) (forward-sexp) (1- (point))))))) (when (and beg end) -- 1.7.4.2