From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Goldman Subject: Re: Emacs-orgmode Digest, Vol 37, Issue 121 Date: Sun, 29 Mar 2009 09:48:13 -0500 Message-ID: <49CF8A2D.3090502@sift.info> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LnwJN-0003O4-L4 for emacs-orgmode@gnu.org; Sun, 29 Mar 2009 10:48:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LnwJJ-0003Ly-9F for emacs-orgmode@gnu.org; Sun, 29 Mar 2009 10:48:33 -0400 Received: from [199.232.76.173] (port=42793 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LnwJJ-0003Lq-6U for emacs-orgmode@gnu.org; Sun, 29 Mar 2009 10:48:29 -0400 Received: from outbound-mail-35.bluehost.com ([69.89.18.155]:46847) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LnwJI-00079k-K3 for emacs-orgmode@gnu.org; Sun, 29 Mar 2009 10:48:28 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org From: Matthew Lundin Subject: Re: [Orgmode] Re: Handling org-file agenda dependenncies? To: Eraldo Helal Cc: emacs-orgmode@gnu.org Message-ID: Content-Type: text/plain; charset=us-ascii ML> Hi Eraldo, ML> Eraldo Helal writes: >> > Mike Newman newmanfamily.me.uk> writes: > >>> >> When you use the standard commands to add/removes files from the >> >>> agenda, it will write a definition for the variable org-agenda-files to >>> >> the custom section of your .emacs file. >> > > That would still mean removing every org-file in the tree manually > >> when wanting to make a project "inactive". > >>> >> If you want to deal with trees of files, you might be better off >> >>> removing the variable from the custom section, defining it >> yourself >>> and updating it manually. >> > > The questions here is... How could one define it? ML> I think you could set something like the following in your .emacs file: ML> --8<---------------cut here---------------start------------->8--- ML> (load-library "find-lisp") (setq org-agenda-files (append ML> (find-lisp-find-files "~/directory1" "\.org$") (find-lisp-find-files ML> "~/directory2" "\.org$") (find-lisp-find-files "~/directory3" ML> "\.org$"))) --8<---------------cut ML> here---------------end--------------->8--- ML> This will search the directories above recursively for org files. ML> Whenever you want to remove a project from your agenda, simply delete ML> the appropriate line and evaluate the expression. I'd imagine someone ML> else can think of a way to do this more economically, though. An interesting question would be how to generalize this to update remember templates accordingly. Possibly the best approach would be to have a defining form that would define a project in a single s-expression, adding both remember templates and agenda entries, and then that form could be removed all at once. Something like (org-add-project newproj "A sample new project to show the greatness of org-add-project." (agenda-files (find-lisp-find-files "~/newproj/" "\.org$")) (remember-templates ....)) [The above wouldn't work as written, since it's syntax is a mess of what would be handled by a macro --- the "named arguments" like agenda-files and remember-templates --- and what looks like a functional argument --- the find-lisp-files --- but something like it could be lashed together if anyone was interested.]