浏览代码

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 13 年之前
父节点
当前提交
5b20c9a30e
共有 1 个文件被更改,包括 4 次插入1 次删除
  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