org-capture: Fix regression in item templates

* lisp/org-capture.el (org-capture-place-item):

Fix regression introduced in d6f096546.

Reported-by: Alan Schmitt <alan.schmitt@polytechnique.org>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00591.html>

Reported-by: Florian Lindner <mailinglists@xgm.de>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00606.html>
This commit is contained in:
Nicolas Goaziou 2017-06-30 13:27:38 +02:00
parent f409c13be1
commit 04403b446a
1 changed files with 2 additions and 3 deletions

View File

@ -1143,10 +1143,9 @@ may have been stored before."
(insert txt)
(org-capture-empty-lines-after)
(org-capture-position-for-last-stored beg)
(forward-char 1)
(setq end (point))
(org-capture-mark-kill-region beg (1- end))
(org-capture-narrow beg (1- end))
(org-capture-mark-kill-region beg end)
(org-capture-narrow beg end)
(if (or (re-search-backward "%\\?" beg t)
(re-search-forward "%\\?" end t))
(replace-match ""))))