[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] org-agenda-files for calfw
From: |
Nick Dokos |
Subject: |
Re: [O] org-agenda-files for calfw |
Date: |
Thu, 27 Aug 2015 22:19:14 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Julien Cubizolles <address@hidden> writes:
> Eric S Fraga <address@hidden> 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