emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Tim O'Callaghan" <timo@dspsrv.com>
To: org-mode <emacs-orgmode@gnu.org>
Subject: Re: Re: Fast traversing directories
Date: Fri, 20 Nov 2009 21:43:52 +0100	[thread overview]
Message-ID: <3d6808890911201243ud397520w84ab0440b8cc61ce@mail.gmail.com> (raw)
In-Reply-To: <87k4ybqsqg.fsf@tux.homenetwork>

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.volpiatto@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.dokos@hp.com> writes:
>
>> andrea Crotti <andrea.crotti.0@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
>

      reply	other threads:[~2009-11-20 20:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-31 17:07 Fast traversing directories andrea Crotti
2009-10-31 17:15 ` Benjamin Andresen
2009-10-31 17:31   ` andrea Crotti
2009-10-31 18:09     ` PT
2009-10-31 18:28     ` Nick Dokos
2009-10-31 19:16       ` Thierry Volpiatto
2009-11-20 20:43         ` Tim O'Callaghan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d6808890911201243ud397520w84ab0440b8cc61ce@mail.gmail.com \
    --to=timo@dspsrv.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).