summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2013-11-11 18:26:44 -0500
committerKyle Meyer <kyle@kyleam.com>2013-11-11 18:26:44 -0500
commita9c1bc549e998a33039e973fb45b212e689d421b (patch)
treea30016d0c7d84574d6220397108ab276d6aa7a92
parent3b2798354943446cc89ccfa1987a5c04b91ad75f (diff)
downloademacs.d-a9c1bc549e998a33039e973fb45b212e689d421b.tar.gz
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.
-rw-r--r--init/km-org.el14
1 files changed, 9 insertions, 5 deletions
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)