Browse Source

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>
Nicolas Goaziou 2 years ago
parent
commit
04403b446a
1 changed files with 2 additions and 3 deletions
  1. 2 3
      lisp/org-capture.el

+ 2 - 3
lisp/org-capture.el

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