summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuchenxuan Tong <demon386@gmail.com>2013-01-22 13:14:08 (GMT)
committer Bastien Guerry <bzg@altern.org>2013-01-22 13:14:08 (GMT)
commit5b20c9a30e4714e72fe253914712001528f662b6 (patch)
tree96b53b4a8b973b7530ee5996c4bc191c5d1f033c
parent7006f36d3daca1fc8cc78986c93c327941537b74 (diff)
downloadorg-mode-5b20c9a30e4714e72fe253914712001528f662b6.zip
org-mode-5b20c9a30e4714e72fe253914712001528f662b6.tar.gz
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
-rw-r--r--lisp/org-agenda.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index cefdc0e..5e11358 100644
--- a/lisp/org-agenda.el
+++ b/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