summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2019-03-21 21:46:44 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-03-21 21:46:44 +0100
commit3e6153e48fccc8dcf94bd8010785ddcfbbfcefc6 (patch)
tree0c5ae5d7472525b529e84520bb67d99ee8de386e
parent967f6c0dd0da371a71dd22ab9a4a0649332fd2be (diff)
parent77d7fe8e2661e6da3e565812c61b5c4fa0f3c5d8 (diff)
downloadorg-mode-3e6153e48fccc8dcf94bd8010785ddcfbbfcefc6.tar.gz
Merge branch 'master' of code.orgmode.org:bzg/org-mode
-rw-r--r--lisp/org-agenda.el24
1 files changed, 15 insertions, 9 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 2616947..95bdb07 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -8484,7 +8484,7 @@ Point is in the buffer where the item originated.")
(buffer (marker-buffer marker))
(pos (marker-position marker))
(type (org-get-at-bol 'type))
- dbeg dend (n 0) conf)
+ dbeg dend (n 0))
(org-with-remote-undo buffer
(with-current-buffer buffer
(save-excursion
@@ -8496,14 +8496,20 @@ Point is in the buffer where the item originated.")
dend (min (point-max) (1+ (point-at-eol)))))
(goto-char dbeg)
(while (re-search-forward "^[ \t]*\\S-" dend t) (setq n (1+ n)))))
- (setq conf (or (eq t org-agenda-confirm-kill)
- (and (numberp org-agenda-confirm-kill)
- (> n org-agenda-confirm-kill))))
- (and conf
- (not (y-or-n-p
- (format "Delete entry with %d lines in buffer \"%s\"? "
- n (buffer-name buffer))))
- (error "Abort"))
+ (when (or (eq t org-agenda-confirm-kill)
+ (and (numberp org-agenda-confirm-kill)
+ (> n org-agenda-confirm-kill)))
+ (let ((win-conf (current-window-configuration)))
+ (unwind-protect
+ (and
+ (prog2
+ (org-agenda-tree-to-indirect-buffer nil)
+ (not (y-or-n-p
+ (format "Delete entry with %d lines in buffer \"%s\"? "
+ n (buffer-name buffer))))
+ (kill-buffer org-last-indirect-buffer))
+ (error "Abort"))
+ (set-window-configuration win-conf))))
(let ((org-agenda-buffer-name bufname-orig))
(org-remove-subtree-entries-from-agenda buffer dbeg dend))
(with-current-buffer buffer (delete-region dbeg dend))