Improve parsing of org-capture-inside-embedded-elisp-p

* org-capture.el (org-capture-inside-embedded-elisp-p): Improve parsing.
This commit is contained in:
Michael Brand 2012-08-11 20:08:35 +02:00 committed by Bastien Guerry
parent 601e783405
commit e1d5a31786
1 changed files with 5 additions and 2 deletions

View File

@ -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)