summaryrefslogtreecommitdiffstats
path: root/.emacs.d/site-lisp
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-08-25 12:25:19 +0200
committerGravatar Tom Willemse2013-08-25 12:25:19 +0200
commit288d9782242713af0f492b1dedb8d0b45006d1b7 (patch)
treeb8201ea953ea1c2141637bfd19b24ee25df2b2c6 /.emacs.d/site-lisp
parent0f2f2448b36622e2b23adaf9383660c318abac09 (diff)
downloademacs-288d9782242713af0f492b1dedb8d0b45006d1b7.tar.gz
emacs-288d9782242713af0f492b1dedb8d0b45006d1b7.zip
Use new filtering option
Diffstat (limited to '.emacs.d/site-lisp')
-rw-r--r--.emacs.d/site-lisp/org-init.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/.emacs.d/site-lisp/org-init.el b/.emacs.d/site-lisp/org-init.el
index e3d0044..cbb9be0 100644
--- a/.emacs.d/site-lisp/org-init.el
+++ b/.emacs.d/site-lisp/org-init.el
@@ -70,9 +70,17 @@
(setq outline-path (concat "[ " outline-path " ] ")))
outline-path))
+(defun org-init-filter-by-desktop ()
+ "Filter agenda by current label."
+ (when desktop-dirname
+ (let ((label (tagify (file-name-base
+ (directory-file-name
+ (expand-file-name desktop-dirname))))))
+ (org-agenda-filter-apply (cons label nil) 'tag))))
+
(setq org-agenda-files '("~/documents/org/tasks"))
-(setq org-agenda-before-sorting-filter-function #'filter-by-agenda)
+;; (setq org-agenda-before-sorting-filter-function #'filter-by-agenda)
(setq org-agenda-cmp-user-defined (lambda (a b) 1))
(setq org-agenda-prefix-format
'((agenda . " %i %-12:c%?-12t% s")
@@ -139,6 +147,7 @@
(setq org-use-property-inheritance '("slug"))
(add-hook 'org-agenda-mode-hook 'org-agenda-to-appt)
+(add-hook 'org-agenda-finalize-hook 'org-init-filter-by-desktop)
(add-to-list 'org-modules 'habit)