This version will accept wildcards and recurse one directory level level down

----
(setq org-agenda-directories '("~/org" "~/1_PROJECT/*"))
(setq org-agenda-files '())
(dolist (d1 org-agenda-directories)
  (dolist (d2 (file-expand-wildcards (expand-file-name d1)))
    (if (file-directory-p d2)
        (dolist (f (directory-files d2 t ".org$" t))
          (push f org-agenda-files)))))
----

Hope it helps.

Tim.

2009/10/31 Thierry Volpiatto <thierry.volpia...@gmail.com>:
> Hi,
> if you have traverselisp.el, you can use:
>
> ,----
> | (dolist (d org-directories)
> |   (traverse-walk-directory d :file-fn #'(lambda (x)
> |                                           (when (string= 
> (file-name-extension x) "org")
> |                                             (push x org-agenda-files)))))
> `----
>
> you can get traverselisp.el here:
> http://www.emacswiki.org/cgi-bin/emacs/traverselisp.el
>
> or here: (hg clone)
> http://mercurial.intuxication.org/hg/traverselisp
>
> Nick Dokos <nicholas.do...@hp.com> writes:
>
>> andrea Crotti <andrea.crott...@gmail.com> wrote:
>>
>>>
>>> I tried this because I have more base directories.
>>> (setq org-directories '("~/org" "~/uni"))
>>> (setq org-agenda-files ())
>>> (dolist ((d org-directories))
>>>   (setq org-agenda-files
>>>      (append org-agenda-files (find-lisp-find-files d "\.org$"))))
>>>
>>>
>>> But it sets org-agenda-files to nil...
>>
>> Too many parens: try
>>
>> (dolist (d org-directories)
>>    (setq org-agenda-files
>>       (append org-agenda-files (find-lisp-find-files d "\.org$"))))
>>
>> Nick
>>
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Remember: use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>
> --
> A + Thierry Volpiatto
> Location: Saint-Cyr-Sur-Mer - France
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to