emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: org-agenda-files for calfw
Date: Thu, 27 Aug 2015 22:19:14 -0400	[thread overview]
Message-ID: <87pp28w3x9.fsf@alphaville.usersys.redhat.com> (raw)
In-Reply-To: 874mjkpcmw.fsf@free.fr

Julien Cubizolles <j.cubizolles@free.fr> writes:

> Eric S Fraga <e.fraga@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

  reply	other threads:[~2015-08-28  2:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27 12:06 org-agenda-files for calfw Julien Cubizolles
2015-08-27 15:01 ` Eric S Fraga
2015-08-27 21:35   ` Julien Cubizolles
2015-08-27 22:52   ` Julien Cubizolles
2015-08-28  2:19     ` Nick Dokos [this message]
2015-08-28  9:31       ` Julien Cubizolles
2015-08-28  9:33         ` Julien Cubizolles
2015-08-28 13:25           ` Nick Dokos
2015-08-28 16:02             ` Julien Cubizolles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pp28w3x9.fsf@alphaville.usersys.redhat.com \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).