diff options
author | Bastien <bzg@gnu.org> | 2020-02-18 01:25:59 +0100 |
---|---|---|
committer | Bastien <bzg@gnu.org> | 2020-02-18 01:25:59 +0100 |
commit | cb2774d1a885a862d882a8b7557111e4181f5fc8 (patch) | |
tree | 3a05cb6f0dafe51d8637a22ad5b406f861c02356 | |
parent | fc3f1e6b28d91671eb6457cb14a51179136c24ce (diff) | |
download | org-mode-cb2774d1a885a862d882a8b7557111e4181f5fc8.tar.gz |
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.
-rw-r--r-- | lisp/org-capture.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el index e69cb76..1a8765f 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -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 |