1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-25 07:27:57 +00:00

org-capture.el: Fix possibly missing final newline

* lisp/org-capture.el (org-capture-finalize): When capturing
an entry, fix missing final newline when the user has deleted
it.

This continues the fix done in d8c51531c.
This commit is contained in:
Bastien 2020-02-18 01:25:59 +01:00
parent fc3f1e6b28
commit cb2774d1a8

View File

@ -728,6 +728,16 @@ captured item after finalizing."
(run-hooks 'org-capture-prepare-finalize-hook)
;; Fix missing final newline, as it may have been deleted by accident
(when (eq (org-capture-get :type 'local) 'entry)
(save-excursion
(goto-char (point-max))
(and (not (looking-at-p "^"))
(org-with-wide-buffer
(and (not (looking-at-p org-heading-regexp))
(not (eobp))))
(insert "\n"))))
;; Did we start the clock in this capture buffer?
(when (and org-capture-clock-was-started
org-clock-marker