summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-02-06 23:48:25 -0500
committerKyle Meyer <kyle@kyleam.com>2016-02-06 23:48:25 -0500
commit96c09fe281b9307430d7353a24ff00fe06f838f9 (patch)
treefe13c694f1016b972026f462afc4724ed5429337
parent8d309bb504a07dd37f41e590b4ed95488bf3f2e8 (diff)
downloademacs.d-96c09fe281b9307430d7353a24ff00fe06f838f9.tar.gz
org-agenda: Keep default-directory with restriction
-rw-r--r--init.el2
-rw-r--r--lisp/km-org.el5
2 files changed, 4 insertions, 3 deletions
diff --git a/init.el b/init.el
index 0303079..f144f85 100644
--- a/init.el
+++ b/init.el
@@ -312,7 +312,7 @@
(after 'org-agenda
(setq km/org-agenda-file-directory "~/notes/agenda/"
org-agenda-files (list km/org-agenda-file-directory))
- (add-hook 'org-agenda-mode-hook #'km/org-agenda-cd-and-read-dir-locals)
+ (add-hook 'org-agenda-finalize-hook #'km/org-agenda-cd-and-read-dir-locals)
(add-hook 'org-agenda-finalize-hook #'km/org-agenda-store-current-span))
(after 'ox-md
(advice-add 'org-md-paragraph :filter-return #'km/org-md-fill-string))
diff --git a/lisp/km-org.el b/lisp/km-org.el
index fcf82ed..5098748 100644
--- a/lisp/km-org.el
+++ b/lisp/km-org.el
@@ -308,8 +308,9 @@ called through the speed command interface."
;;;###autoload
(defun km/org-agenda-cd-and-read-dir-locals ()
- (setq default-directory "~/notes/")
- (hack-local-variables))
+ (unless (get 'org-agenda-files 'org-restrict)
+ (setq default-directory "~/notes/")
+ (hack-local-variables)))
;;;###autoload
(defun km/org-agenda-store-current-span ()