If it is possible to set up what you want in an entry in org-agenda-custom-commands, then you can call it in a program like
#+BEGIN_SRC emacs-lisp (org-agenda nil "w" nil) #+END_SRC In that snippet, I have the key in an org-agenda-custom-commands set to "w". that generates an agenda buffer for me, which I assume you can then use the org-agenda-write command on. Alan Schmitt <alan.schm...@polytechnique.org> writes: > Hello, > > In my quest/endeavor/struggle to generate an org file for what I want to > do during the day, I’m trying to leverage the power of org-agenda (that > does a lot of what I want to do) to create an org file. I learned of > org-agenda-write, which I could use to write to file what I want then > include it in my org file, but for that I need to create the correct > org-agenda buffer. What is the elisp way of doing it? > > I tried using org-agenda-list, but it only seems to restore the current > agenda view. For instance, (org-agenda-list nil nil 1) generates an > agenda for the week (which is my default), even though I pass a SPAN > argument of 1. I also don’t know how to set the org-agenda-skip steps > before calling that function… > > Thanks a lot for any suggestion on how to do this. > > Best, > > Alan -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu