diff options
author | Kevin Liu <kevin@nivekuil.com> | 2020-05-29 17:26:39 -0700 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2020-06-13 10:47:21 +0200 |
commit | 6882478cac36dd71bbb605fb62b9f043ab6bd6f1 (patch) | |
tree | bcda12df3d2b39bf3632830f5fb8925626332263 | |
parent | 688284043c0feeed5177dd9ae15f273a172b755c (diff) | |
download | org-mode-6882478cac36dd71bbb605fb62b9f043ab6bd6f1.tar.gz |
capture: Fix org-capture-place-entry narrow bounds
* lisp/org-capture.el (org-capture-place-entry): Prevent breaking the
following headline inside the capture buffer. This should match the
behavior from 9.3.
(org-capture-finalize): Reverts cb2774d1a, which solves a similar
problem but only in the finalize stage, so the subtree structure would
still be broken in the middle of editing the capture.
-rw-r--r-- | lisp/org-capture.el | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 7dde7e1..cc91251 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -728,16 +728,6 @@ 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 @@ -1166,7 +1156,7 @@ may have been stored before." (org-capture-empty-lines-after) (unless (org-at-heading-p) (outline-next-heading)) (org-capture-mark-kill-region origin (point)) - (org-capture-narrow beg (point)) + (org-capture-narrow beg (if (eobp) (point) (1- (point)))) (org-capture--position-cursor beg (point)))))) (defun org-capture-place-item () |