From mboxrd@z Thu Jan 1 00:00:00 1970 From: david@adboyd.com (J. David Boyd) Subject: Re: How to let Org Agenda search all files in a directory *recursively* ? Date: Thu, 27 Jun 2013 13:53:48 -0400 Message-ID: References: <20130627075135.GA4761@stardiviner> <87li5vbp50.fsf@yahoo.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsGPR-0005Jd-QK for emacs-orgmode@gnu.org; Thu, 27 Jun 2013 13:55:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsGPQ-0005BN-Tp for emacs-orgmode@gnu.org; Thu, 27 Jun 2013 13:55:05 -0400 Received: from plane.gmane.org ([80.91.229.3]:41423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsGPQ-00059q-Mr for emacs-orgmode@gnu.org; Thu, 27 Jun 2013 13:55:04 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UsGPP-0007N2-DG for emacs-orgmode@gnu.org; Thu, 27 Jun 2013 19:55:03 +0200 Received: from 169.15.137.27 ([169.15.137.27]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Jun 2013 19:55:03 +0200 Received: from david by 169.15.137.27 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Jun 2013 19:55:03 +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 Nicolas Richard writes: > chris writes: > >> How to Let [C-c a] to search over all files in a directory *recursively* ? > > AFAIK, there's no built in way. > > Applying the following patch to the function org-agenda-files gets you > there, but it's not clean at all, and certainly very unefficient : > > Modified lisp/org.el > diff --git a/lisp/org.el b/lisp/org.el > index 7fd1576..0068c49 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -17797,8 +17797,7 @@ used by the agenda files. If ARCHIVE is `ifmode', do this only if > (setq files (apply 'append > (mapcar (lambda (f) > (if (file-directory-p f) > - (directory-files > - f t org-agenda-file-regexp) > + (find-lisp-find-files f org-agenda-file-regexp) > (list f))) > files))) > (when org-agenda-skip-unavailable-files > > Also it might be faster to rely on an external "find" tool but that requires > modifying the regexp (-regex applies to whole path). > > HTH, Huh, when I set my org-agenda-files to ~/org/, and have TODO files in ~/org/home and ~/org/work, and press C-c a a, it loads all the todo file, recursed down to all the subdirectories. However, and this is strange, after it loads them all up, it changes org-agenda-files to discrete filepaths, and not just the directory anymore. That seems like a bug to me.... Dave