emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to let Org Agenda search all files in a directory *recursive


From: J. David Boyd
Subject: Re: [O] How to let Org Agenda search all files in a directory *recursively* ?
Date: Thu, 27 Jun 2013 13:53:48 -0400
User-agent: Gnus/5.1299999999999999 (Gnus v5.13) Emacs/24.3 (cygwin)

Nicolas Richard <address@hidden> writes:

> chris <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]