summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Maus <dmaus@ictsoc.de>2012-02-25 11:11:48 +0100
committerDavid Maus <dmaus@ictsoc.de>2012-02-25 11:13:33 +0100
commit89949e69a3860fcb687c0f4ca0ccfd29283a5b74 (patch)
treeb2bd33ae30f34f4dff5cfe090733e2c987cac54f
parentf7ea4bef4339116caa15fc67fdf4718ffbab3cd5 (diff)
downloadorg-mode-89949e69a3860fcb687c0f4ca0ccfd29283a5b74.tar.gz
org-agenda: Fix handling of indirect buffer and window
* org-agenda.el (org-agenda-tree-to-indirect-buffer): Fix handling of indirect buffer and window. Check if the window of last indirect buffer is still live and properly handle the case of `org-last-indirect-buffer' being nil. Changes suggested by Dave Abrahams in <m2boow1q9e.fsf@boostpro.com>.
-rw-r--r--lisp/org-agenda.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 8179b93..d46f2ef 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7280,11 +7280,11 @@ use the dedicated frame)."
(if (and current-prefix-arg (listp current-prefix-arg))
(org-agenda-do-tree-to-indirect-buffer)
(let ((agenda-window (selected-window))
- (indirect-window (get-buffer-window org-last-indirect-buffer)))
+ (indirect-window (and org-last-indirect-buffer (get-buffer-window org-last-indirect-buffer))))
(save-window-excursion (org-agenda-do-tree-to-indirect-buffer))
(unwind-protect
(progn
- (unless indirect-window
+ (unless (and indirect-window (window-live-p indirect-window))
(setq indirect-window (split-window agenda-window)))
(select-window indirect-window)
(switch-to-buffer org-last-indirect-buffer :norecord)