According to the org agenda docs, I should be able to set a custom local option for a given agenda command. In this case, I want to set a custom org-agenda-files
variable, which is an explicit example given by the docs:
(setq org-agenda-custom-commands
'(("c" "Desk Work" tags-todo "computer" ;; (1) (2) (3) (4)
((org-agenda-files '("~/org/widgets.org" "~/org/clients.org")) ;; (5)
(org-agenda-sorting-strategy '(priority-up effort-down))) ;; (5) cont.
("~/computer.html")) ;; (6)
;; ...other commands here
))
However, when I try this, it doesn't work. My main org-agenda-files
is a recursive directory with thousands of org files, and all are being presented in my org-agenda-custom-command
despite me trying to set the org-agenda-files
for the given command. I suspect the issue is some misunderstanding I have about lisp
syntax. I've tried the following:
At the top of my config is
(setq org-agenda-files
(directory-files-recursively "~/Dropbox/org" "\\.org$")
)
Which works properly. I've tried configuring:
(add-to-list 'org-agenda-custom-commands
`("dd" "Daily Agenda"
(
(org-agenda-files '(seq-filter (lambda(x) (not (string-match "/notes/"(file-name-directory x))))
(directory-files-recursively "~/Dropbox/org" "\\.org$")
))
(agenda ""
(
(org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-span 'day)
(org-deadline-warning-days 5)
(org-super-agenda-groups
'((:auto-category t :time-grid t))))))))
This custom command included the files in /notes/
.
(add-to-list 'org-agenda-custom-commands
`("dd" "Daily Agenda"
(
(agenda ""
(seq-filter (lambda(x) (not (string-match "/notes/"(file-name-directory x))))
(directory-files-recursively "~/Dropbox/org" "\\.org$")
))
(
(org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-span 'day)
(org-deadline-warning-days 5)
(org-super-agenda-groups
'((:auto-category t :time-grid t))))))))
This custom command included the files in /notes/
.
(add-to-list 'org-agenda-custom-commands
`("dd" "Daily Agenda"
(
(agenda ""
(
(org-agenda-files (seq-filter (lambda(x) (not (string-match "/notes/"(file-name-directory x))))
(directory-files-recursively "~/Dropbox/org" "\\.org$")
))
(org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-span 'day)
(org-deadline-warning-days 5)
(org-super-agenda-groups
'((:auto-category t :time-grid t))))))))
This custom command included the files in /notes/
, and is the one I think most matches the syntax given by the example.
I struggle with lisp syntax and putting things in the right spot, but I'm very confused why this isn't working.
What's the proper way to set a custom variable like org-agenda-files
for a org-agenda-custom-command
?