Merge branch 'master' of code.orgmode.org:bzg/org-mode

This commit is contained in:
Nicolas Goaziou 2019-03-21 21:46:44 +01:00
commit 3e6153e48f
1 changed files with 15 additions and 9 deletions

View File

@ -8484,7 +8484,7 @@ Point is in the buffer where the item originated.")
(buffer (marker-buffer marker)) (buffer (marker-buffer marker))
(pos (marker-position marker)) (pos (marker-position marker))
(type (org-get-at-bol 'type)) (type (org-get-at-bol 'type))
dbeg dend (n 0) conf) dbeg dend (n 0))
(org-with-remote-undo buffer (org-with-remote-undo buffer
(with-current-buffer buffer (with-current-buffer buffer
(save-excursion (save-excursion
@ -8496,14 +8496,20 @@ Point is in the buffer where the item originated.")
dend (min (point-max) (1+ (point-at-eol))))) dend (min (point-max) (1+ (point-at-eol)))))
(goto-char dbeg) (goto-char dbeg)
(while (re-search-forward "^[ \t]*\\S-" dend t) (setq n (1+ n))))) (while (re-search-forward "^[ \t]*\\S-" dend t) (setq n (1+ n)))))
(setq conf (or (eq t org-agenda-confirm-kill) (when (or (eq t org-agenda-confirm-kill)
(and (numberp org-agenda-confirm-kill) (and (numberp org-agenda-confirm-kill)
(> n org-agenda-confirm-kill)))) (> n org-agenda-confirm-kill)))
(and conf (let ((win-conf (current-window-configuration)))
(unwind-protect
(and
(prog2
(org-agenda-tree-to-indirect-buffer nil)
(not (y-or-n-p (not (y-or-n-p
(format "Delete entry with %d lines in buffer \"%s\"? " (format "Delete entry with %d lines in buffer \"%s\"? "
n (buffer-name buffer)))) n (buffer-name buffer))))
(kill-buffer org-last-indirect-buffer))
(error "Abort")) (error "Abort"))
(set-window-configuration win-conf))))
(let ((org-agenda-buffer-name bufname-orig)) (let ((org-agenda-buffer-name bufname-orig))
(org-remove-subtree-entries-from-agenda buffer dbeg dend)) (org-remove-subtree-entries-from-agenda buffer dbeg dend))
(with-current-buffer buffer (delete-region dbeg dend)) (with-current-buffer buffer (delete-region dbeg dend))