From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: org-agenda-files for calfw Date: Thu, 27 Aug 2015 22:19:14 -0400 Message-ID: <87pp28w3x9.fsf@alphaville.usersys.redhat.com> References: <871tep7x63.fsf@free.fr> <87zj1clqrj.fsf@ucl.ac.uk> <874mjkpcmw.fsf@free.fr> 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]:57501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZV9GX-00084D-AY for emacs-orgmode@gnu.org; Thu, 27 Aug 2015 22:19:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZV9GU-0004tY-7N for emacs-orgmode@gnu.org; Thu, 27 Aug 2015 22:19:41 -0400 Received: from plane.gmane.org ([80.91.229.3]:51645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZV9GU-0004t9-0A for emacs-orgmode@gnu.org; Thu, 27 Aug 2015 22:19:38 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZV9GM-0005nD-5s for emacs-orgmode@gnu.org; Fri, 28 Aug 2015 04:19:30 +0200 Received: from pool-108-20-41-232.bstnma.fios.verizon.net ([108.20.41.232]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Aug 2015 04:19:30 +0200 Received: from ndokos by pool-108-20-41-232.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Aug 2015 04:19:30 +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 Julien Cubizolles writes: > 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. > > (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