From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tim O'Callaghan" Subject: Re: Re: Fast traversing directories Date: Fri, 20 Nov 2009 21:43:52 +0100 Message-ID: <3d6808890911201243ud397520w84ab0440b8cc61ce@mail.gmail.com> References: <87skczlc2v.fsf@in-ulm.de> <11278.1257013690@gamaville.dokosmarshall.org> <87k4ybqsqg.fsf@tux.homenetwork> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBaL6-0000bD-CQ for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 15:44:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBaL1-0000Yo-Qp for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 15:44:20 -0500 Received: from [199.232.76.173] (port=34340 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBaL1-0000Yg-NT for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 15:44:15 -0500 Received: from mail-fx0-f225.google.com ([209.85.220.225]:58103) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBaL0-0004gD-Tx for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 15:44:15 -0500 Received: by fxm25 with SMTP id 25so4328556fxm.26 for ; Fri, 20 Nov 2009 12:44:13 -0800 (PST) In-Reply-To: <87k4ybqsqg.fsf@tux.homenetwork> 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: org-mode This version will accept wildcards and recurse one directory level level do= wn ---- (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 : > Hi, > if you have traverselisp.el, you can use: > > ,---- > | (dolist (d org-directories) > | =A0 (traverse-walk-directory d :file-fn #'(lambda (x) > | =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 (when (string=3D (file-name-extension x) "org") > | =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 (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 writes: > >> andrea Crotti wrote: >> >>> >>> I tried this because I have more base directories. >>> (setq org-directories '("~/org" "~/uni")) >>> (setq org-agenda-files ()) >>> (dolist ((d org-directories)) >>> =A0 (setq org-agenda-files >>> =A0 =A0 =A0(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) >> =A0 =A0(setq org-agenda-files >> =A0 =A0 =A0 (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 >