0

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

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

(org-agenda nil "d")
| improve this answer | |
  • Then why not close the question as a duplicate? – NickD Aug 8 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. – miguelmorin Aug 10 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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