mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 22:07:49 +00:00
org-agenda: Don't kill or bury non-agenda buffer
* lisp/org-agenda.el (org-agenda--quit): Fix changes introduced by9b1c682
and8594aed
that incorrectly assume that the agenda buffer is always the current buffer at the time of killing or burying. Reported-by: David Mann <manndmd@gmail.com> <http://permalink.gmane.org/gmane.emacs.orgmode/103791>
This commit is contained in:
parent
713fe873b7
commit
6d0af59744
|
@ -7233,6 +7233,7 @@ agenda."
|
|||
(if org-agenda-columns-active
|
||||
(org-columns-quit)
|
||||
(let ((wconf org-agenda-pre-window-conf)
|
||||
(buf (current-buffer))
|
||||
(org-agenda-last-indirect-window
|
||||
(and (eq org-indirect-buffer-display 'other-window)
|
||||
org-agenda-last-indirect-buffer
|
||||
|
@ -7254,8 +7255,12 @@ agenda."
|
|||
(not (one-window-p))
|
||||
(delete-window))))
|
||||
(if bury
|
||||
(bury-buffer)
|
||||
(kill-buffer)
|
||||
;; Set the agenda buffer as the current buffer instead of
|
||||
;; passing it as an argument to `bury-buffer' so that
|
||||
;; `bury-buffer' removes it from the window.
|
||||
(with-current-buffer buf
|
||||
(bury-buffer))
|
||||
(kill-buffer buf)
|
||||
(setq org-agenda-archives-mode nil
|
||||
org-agenda-buffer nil)))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue