Merge branch 'maint'

This commit is contained in:
Nicolas Goaziou 2017-06-30 14:36:30 +02:00
commit 602a1a21fc
1 changed files with 3 additions and 3 deletions

View File

@ -1156,6 +1156,7 @@ may have been stored before."
(mapconcat 'identity (split-string txt "\n")
"\n "))))
;; Prepare surrounding empty lines.
(unless (bolp) (insert "\n"))
(org-capture-empty-lines-before)
(setq beg (point))
(unless (eolp) (save-excursion (insert "\n")))
@ -1173,10 +1174,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 ""))))