In org-mode, I have a custom agenda set with:

(setq org-agenda-custom-commands
      '(("d" "todo"
               agenda ""
               ((org-agenda-span 1)
        (org-agenda-start-day "-0d")
                (org-agenda-start-with-log-mode '(closed))

I can call it with C-c a d.

I want to call it programmatically. The documentation offers passing an argument:

(org-agenda &optional ARG ORG-KEYS RESTRICTION)

Dispatch agenda commands to collect entries to the agenda buffer. Prompts for a command to execute. Any prefix arg will be passed on to the selected command. The default selections are:

a Call ‘org-agenda-list’ to display the agenda for current day or week.

I tried:

(org-agenda "a")

and get the same prompt as if I had run (org-agenda). So I don't know how to proceed to the next step of selecting the custom agenda (the "d" after the "a").

How can I call this custom agenda programmatically?


1 Answer 1


I found the answer in Is there a way to start org-mode agenda with a custom search? :

(org-agenda nil "d")
  • Then why not close the question as a duplicate?
    – NickD
    Aug 8, 2020 at 15:12
  • @NickD I don't have enough reputation to close it and voted to do so. I couldn't find that thread initially with an online search, only after writing the question, therefore I decided to publish this thread.
    – emonigma
    Aug 10, 2020 at 9:36

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.