diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-04-21 15:22:53 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-04-21 15:22:53 +0200 |
commit | 02e290d1d497abf56427c9d7e92d639fa11e223a (patch) | |
tree | f6e3284cb0381c9092db907cd2722a0bac294ff0 | |
parent | 8b121d3aa2a9f3250975d65839361c6404fcad28 (diff) | |
parent | cb63ccb78e43428503a1e6c4c877c4771b0cb527 (diff) | |
download | org-mode-02e290d1d497abf56427c9d7e92d639fa11e223a.tar.gz |
Merge branch 'maint'
-rw-r--r-- | lisp/org-capture.el | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 740ed38..ceef34a 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -743,9 +743,7 @@ captured item after finalizing." (org-with-point-at clock-in-task (org-clock-in))) (message "Interrupted clock has been resumed")))) - (let ((beg (point-min)) - (end (point-max)) - (abort-note nil)) + (let ((abort-note nil)) ;; Store the size of the capture buffer (org-capture-put :captured-entry-size (- (point-max) (point-min))) (widen) @@ -753,16 +751,11 @@ captured item after finalizing." (org-capture-put :insertion-point (point)) (if org-note-abort - (let ((m1 (org-capture-get :begin-marker 'local)) - (m2 (org-capture-get :end-marker 'local))) - (if (and m1 m2 (= m1 beg) (= m2 end)) - (progn - (setq m2 (if (cdr (assq 'heading org-blank-before-new-entry)) - m2 (1+ m2)) - m2 (if (< (point-max) m2) (point-max) m2)) - (setq abort-note 'clean) - (kill-region m1 m2)) - (setq abort-note 'dirty))) + (let ((beg (org-capture-get :begin-marker 'local)) + (end (org-capture-get :end-marker 'local))) + (if (not (and beg end)) (setq abort-note 'dirty) + (setq abort-note t) + (org-with-wide-buffer (kill-region beg end)))) ;; Postprocessing: Update Statistics cookies, do the sorting (when (derived-mode-p 'org-mode) |