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:
parent
601e783405
commit
e1d5a31786
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue