diff options
author | Bastien Guerry <bzg@altern.org> | 2012-09-29 11:10:03 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-09-29 11:10:03 +0200 |
commit | 33213dc99a7ff72936023d1d3369b94b3eaeadee (patch) | |
tree | c738a186a74a381f43cae79332dead375de82448 | |
parent | 2a04d90d204f5aacfc10410b3546078b6cdd9c2b (diff) | |
download | org-mode-33213dc99a7ff72936023d1d3369b94b3eaeadee.tar.gz |
org-agenda.el: Fix some bugs about (indirect) windows handling
* org-agenda.el (org-agenda-quit): Delete last indirect buffer.
(org-agenda-pre-follow-window-conf): New variable.
(org-agenda-tree-to-indirect-buffer): Fix bug: don't split
agenda window when there an indirect buffer is already
displayed.
-rwxr-xr-x | lisp/org-agenda.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 6f97bbd..4720a72 100755 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -6547,6 +6547,9 @@ If ERROR is non-nil, throw an error, otherwise just return nil." "Exit agenda by killing agenda buffer or burying it when `org-agenda-sticky' is non-NIL" (interactive) + (if (and (eq org-indirect-buffer-display 'other-window) + org-last-indirect-buffer) + (delete-window (get-buffer-window org-last-indirect-buffer))) (if org-agenda-columns-active (org-columns-quit) (if org-agenda-sticky @@ -7267,10 +7270,16 @@ so that the date SD will be in that range." (remove-hook 'pre-command-hook 'org-unhighlight-once) (org-unhighlight)) +(defvar org-agenda-pre-follow-window-conf nil) (defun org-agenda-follow-mode () "Toggle follow mode in an agenda buffer." (interactive) + (unless org-agenda-follow-mode + (setq org-agenda-pre-follow-window-conf + (current-window-configuration))) (setq org-agenda-follow-mode (not org-agenda-follow-mode)) + (unless org-agenda-follow-mode + (set-window-configuration org-agenda-pre-follow-window-conf)) (org-agenda-set-mode-name) (org-agenda-do-context-action) (message "Follow mode is %s" @@ -7879,8 +7888,7 @@ use the dedicated frame)." (unless (or (eq org-indirect-buffer-display 'new-frame) (eq org-indirect-buffer-display 'dedicated-frame)) (unwind-protect - (progn - (unless (and indirect-window (window-live-p indirect-window))) + (unless (and indirect-window (window-live-p indirect-window)) (setq indirect-window (split-window agenda-window))) (and indirect-window (select-window indirect-window)) (switch-to-buffer org-last-indirect-buffer :norecord) |