Hi Andrea, andrea crotti <andrea.crott...@gmail.com> writes:
> I never quite understood how to pass arguments to org-agenda without > using it interactively.. > I want a simple thing, a command that shows the agenda with the TODO > entries from a given file > > So supposing the buffer "projects.org" is open I tried this: > > (defun my-org-agenda () > (interactive) > (switch-to-buffer (get-buffer "projects.org")) > (org-agenda :arg 'agenda :restriction '<)) (The `org-agenda' arguments are not lispy keywords arguments, which are currently discouraged in Emacs Lisp.) > which complains for > Wrong number of arguments: (lambda (&optional arg keys restriction) > "Dispatch agenda commands to collect entries to the agenda buffer. > > Any suggestions? (defun my-org-agenda-command () (interactive) (org-agenda-set-restriction-lock 'file) (org-agenda nil "%")) Note that you need to be in your .org file for this to work, so this isn't really suited for a global keybinding, only for org-mode-map. HTH, -- Bastien