Browse Source

org-agenda.el (org-agenda-quit): Delete indirect buffer's window only when it exists

* org-agenda.el (org-agenda-quit): Delete indirect buffer's window
only when it exists.

When indirect buffer's window doesn't exist, the original logic will
delete the current window.

TINYCHANGE
Muchenxuan Tong 5 years ago
parent
commit
5b20c9a30e
1 changed files with 4 additions and 1 deletions
  1. 4 1
      lisp/org-agenda.el

+ 4 - 1
lisp/org-agenda.el

@@ -6893,7 +6893,10 @@ Allowed types are 'agenda 'timeline 'todo 'tags 'search."
   (interactive)
   (if (and (eq org-indirect-buffer-display 'other-window)
 	   org-last-indirect-buffer)
-      (delete-window (get-buffer-window org-last-indirect-buffer)))
+      (let ((org-last-indirect-window
+	     (get-buffer-window org-last-indirect-buffer)))
+	(if org-last-indirect-window
+	    (delete-window org-last-indirect-window))))
   (if org-agenda-columns-active
       (org-columns-quit)
     (if org-agenda-sticky