From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Cubizolles Subject: Re: org-agenda-files for calfw Date: Fri, 28 Aug 2015 00:52:55 +0200 Message-ID: <874mjkpcmw.fsf@free.fr> References: <871tep7x63.fsf@free.fr> <87zj1clqrj.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZV62j-0001f7-L5 for emacs-orgmode@gnu.org; Thu, 27 Aug 2015 18:53:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZV62g-0005P1-Dr for emacs-orgmode@gnu.org; Thu, 27 Aug 2015 18:53:13 -0400 Received: from plane.gmane.org ([80.91.229.3]:43197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZV62g-0005NY-7X for emacs-orgmode@gnu.org; Thu, 27 Aug 2015 18:53:10 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZV62c-0003wN-Kz for emacs-orgmode@gnu.org; Fri, 28 Aug 2015 00:53:06 +0200 Received: from gas45-3-82-244-252-119.fbx.proxad.net ([82.244.252.119]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Aug 2015 00:53:06 +0200 Received: from j.cubizolles by gas45-3-82-244-252-119.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Aug 2015 00:53:06 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Eric S Fraga 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. --8<---------------cut here---------------start------------->8--- (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) --8<---------------cut here---------------end--------------->8--- 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. Julien.