From a9c1bc549e998a33039e973fb45b212e689d421b Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Mon, 11 Nov 2013 18:26:44 -0500 Subject: Rework org agenda fullscreen advice With previous advice, window configuration would not be restored correctly if the agenda buffer was refreshed. This can be avoided if restoring the window configuration is left to org mode (with `org-agenda-restore-windows-after-quit'). There isn't a fullscreen option in `org-agenda-window-setup', so `org-agenda-list' still needs to be advised to delete the other windows. --- init/km-org.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'init') diff --git a/init/km-org.el b/init/km-org.el index 631f5d0..e860812 100644 --- a/init/km-org.el +++ b/init/km-org.el @@ -152,11 +152,15 @@ (add-to-list 'org-latex-packages-alist '("" "amsmath" t)) (defadvice org-agenda-list (around org-agenda-fullscreen activate) - (window-configuration-to-register :org-agenda-fullscreen) + "Start agenda in fullscreen. + +After agenda loads, delete other windows. +`org-agenda-restore-windows-after-quit' should non-nil to restore +the previous window configuration. If `org-agenda-sticky' is +non-nil, configurations with more than one window do not seem to +be restored properly." ad-do-it (delete-other-windows)) -(defadvice org-agenda-quit (around org-agenda-restore-screen activate) - ad-do-it - (jump-to-register :org-agenda-fullscreen)) -(setq org-agenda-sticky t) +(setq org-agenda-restore-windows-after-quit t) +(setq org-agenda-sticky nil) -- cgit v1.2.3