summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-01-17 22:15:23 -0500
committerKyle Meyer <kyle@kyleam.com>2015-01-17 22:15:23 -0500
commitc520a582a68d0ab6d7fd02225378c5c90deaf137 (patch)
tree841cacfe01b5df38aa328b4186899bfbad1230e0
parent67fecc8215df51288025029ed057df78a6f4ea79 (diff)
downloademacs.d-c520a582a68d0ab6d7fd02225378c5c90deaf137.tar.gz
Store current span across Org agenda calls
-rw-r--r--lisp/init-org.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/init-org.el b/lisp/init-org.el
index 96cae0c..516f219 100644
--- a/lisp/init-org.el
+++ b/lisp/init-org.el
@@ -342,6 +342,15 @@ be restored properly."
org-agenda-use-time-grid nil
org-agenda-start-on-weekday nil)
+(defun km/org-agenda-store-current-span ()
+ "Store the current span value in `org-agenda-span'.
+This allows the view to persist when the agenda buffer is
+killed."
+ (when org-agenda-current-span
+ (setq org-agenda-span org-agenda-current-span)))
+
+(add-hook 'org-agenda-finalize-hook 'km/org-agenda-store-current-span)
+
(setq org-agenda-sorting-strategy
'((agenda time-up deadline-up scheduled-up priority-down category-keep)
(todo priority-down category-keep)