I use some custom agendas for work and some for personal stuff. At the moment I load a huge set of custom agendas in org-agenda-custom-commands containing all agendas for work and for personal stuff. This clutters up the dispatcher.

When I define two different sets of custom agendas, one for work and one for personal, I can only load and access agendas of one set. But with home office, sometimes I need "work agendas" on my personal computer.

How can I write the configuration, that I can "add" sets of agendas to org-agenda-custom-commands if necessary, without completely replacing it with one set or the other?

  • It's not clear to me what you are asking: it seems that you want a way to change org-agenda-custom-commands to sometimes be the home commands, sometimes be the office commands and sometimes be both and that you have a way to choose which one of the three possibilities will apply at any particular moment. Is that what you are asking?
    – NickD
    May 10, 2021 at 13:37
  • @NickD Yes exactly. May 10, 2021 at 14:36

1 Answer 1


Only way I can think of is to use a function which sets the variable and then calls the dispatcher. Something like:

(defun my/org-agenda-dispatcher-PERSONAL ()
  (setq org-agenda-custom-commands
        '(("1" "Week Agenda + All Tasks"
           ((agenda "w" ((org-agenda-span 'week)))
            (todo "TODO|LATER"
                  ((org-agenda-sorting-strategy '(todo-state-up))
                   (org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled)))

(defun my/org-agenda-dispatcher-WORK ()
  (setq org-agenda-custom-commands
        '(("1" "Today's Agenda + Priority Tasks"
           ((agenda "d" ((org-agenda-span 'day)))
            (todo "TODO"
                  ((org-agenda-sorting-strategy '(todo-state-up))
                   (org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled))))))))

Then you just call your custom functions rather than the generic org-agenda command.

But you'd have to watch out for other commands which might rely on the org-agenda-custom-commands variable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.