Julien Cubizolles <j.cubizol...@free.fr> writes: > Eric S Fraga <e.fr...@ucl.ac.uk> writes: > >> On Thursday, 27 Aug 2015 at 14:06, Julien Cubizolles wrote: >>> I'd like to choose only a few of my org-agenda-files to be displayed by >>> cfw:open-org-calendar. I couldn't find a variable for that. Should I use >>> some temporary variable to store the content of the real >>> org-agenda-files while launching calfw or is there an easier way ? >> >> You could try advising the function maybe? >> >> https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html > > OK, here is my first unsuccessful attempt. I've never used advises > before so I'm not even sure it makes sense. > > (defun jc-change-agenda-files () > (make-local-variable 'org-agenda-files) > (setq org-agenda-files '('"~/org/orgfiles/planning.org"))) > > (advice-add 'cfw:open-org-calendar :before > 'jc-change-agenda-files) > > When I run cfw:open-org-calendar, I see entries from all my agenda > files. However, without the make-local-variable part, I only get the > entries from planning.org but that's not what I want since I don't want > to change org-agenda-files for the other agenda views. >
Bind org-agenda-files in a let before calling cfw:open-org-calendar: (let ((org-agenda-files '(...))) (cfw:open-org-calendar)) Nick