The function find-lisp-find-files seems to work. To see it, do M-x find-function find-lisp-find-files To use it, you'll probably have to do (load-library "find-lisp") (find-lisp-find-files "~/org" "\.org") HTH. --Greg -- Gregory T. Sullivan, Ph.D. BAE Systems Advanced Information Technologies 6 New England Executive Park, Burlington, MA 01803 781-262-4553 (office), 978-430-3461 (cell) gregory.sullivan@baesystems.com -----Original Message----- From: emacs-orgmode-bounces+gregory.sullivan=baesystems.com@gnu.org [mailto:emacs-orgmode-bounces+gregory.sullivan=baesystems.com@gnu.org] On Behalf Of Matthew Lundin Sent: Wednesday, October 29, 2008 11:40 PM To: emacs-orgmode@gnu.org Subject: [Orgmode] Recursive org-agenda-files Is it possible to set the org-agenda-files variable to include all org files within a directory recursively? I currently use: (set org-agenda files (file-expand-wildcards "~/org/*.org")) This, of course, includes all org files in ~/org. But how would I include all org files in both ~/org and its subdirectories without having to enter them all by hand? E.g., org/ (.org files here) professional/ (.org files here) research/ (.org files here) teaching/ (.org files here) personal/ (.org files here) computer/ (.org files here) Thanks! Matt Lundin _______________________________________________ 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
"Sullivan, Gregory (US SSA)" <gregory.sullivan@baesystems.com> writes:
> The function find-lisp-find-files seems to work.
> To see it, do
> M-x find-function
> find-lisp-find-files
>
> To use it, you'll probably have to do
>
> (load-library "find-lisp")
> (find-lisp-find-files "~/org" "\.org")
Works perfectly. Thanks!
Matt
Hi, I like to have a directory per project, with an .org file in each directory. Is there a way to set org-agenda-files such that it can recursively scan my whole projects dir for all org files? Thanks Neilen
Hi Neilen, I think you want these in your .emacs (from http://orgmode.org/worg/org-faq.html, "Can I add files recursively to my list of agenda files?"): (load-library "find-lisp") (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$")) Or you can add each project directory to org-agenda-files yourself, however, this is not recursive, it only adds .org files under the project directories, not their sub-directories (see docstring of org-agenda-files: C-h v org-agenda-files): (setq org-agenda-files '("~/org/projA" "~/org/projB" "~/org/projC")) In my setup, I also use the following to exclude directory "exc" from the list: (eval-when-compile (require 'cl)) (setq org-agenda-files (remove-if '(lambda (x) (string-match (concat "^" (regexp-quote (expand-file-name "~/org/exc/"))) x)) org-agenda-files)) Net On Mon, Oct 3, 2011 at 8:48 AM, Neilen Marais <nmarais@gmail.com> wrote: > Hi, > > I like to have a directory per project, with an .org file in each > directory. Is there a way to set org-agenda-files such that it can > recursively scan my whole projects dir for all org files? > > Thanks > Neilen > >
Hi,
netty hacky <netty.hacky <at> gmail.com> writes:
>
> Hi Neilen,
>
> I think you want these in your .emacs (from
> http://orgmode.org/worg/org-faq.html, "Can I add files recursively to
> my list of agenda files?"):
> (load-library "find-lisp")
> (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
Thanks. I tried this, but as far as I can tell it won't automatically see new
files or directories as they are added, so I have to re-evaluate te setq every
time I add new projects or files. Or am I wrong?
Thanks
Neilen
Neilen Marais <nmarais@gmail.com> writes: > Hi, > > netty hacky <netty.hacky <at> gmail.com> writes: > >> >> Hi Neilen, >> >> I think you want these in your .emacs (from >> http://orgmode.org/worg/org-faq.html, "Can I add files recursively to >> my list of agenda files?"): >> (load-library "find-lisp") >> (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$")) > > Thanks. I tried this, but as far as I can tell it won't automatically see new > files or directories as they are added, so I have to re-evaluate te setq every > time I add new projects or files. Or am I wrong? Have you considered adding it to say org-mode-hook? > Thanks > Neilen > > > > > --
Jambunathan K <kjambunathan@gmail.com> writes: > Neilen Marais <nmarais@gmail.com> writes: > >> Hi, >> >> netty hacky <netty.hacky <at> gmail.com> writes: >> >>> >>> Hi Neilen, >>> >>> I think you want these in your .emacs (from >>> http://orgmode.org/worg/org-faq.html, "Can I add files recursively to >>> my list of agenda files?"): >>> (load-library "find-lisp") >>> (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$")) >> >> Thanks. I tried this, but as far as I can tell it won't automatically see new >> files or directories as they are added, so I have to re-evaluate te setq every >> time I add new projects or files. Or am I wrong? > Have you considered adding it to say org-mode-hook? Seems like a Wrong suggestion to me. Try using `C-c [' to add the current org file. I am assuming that org files are created by hand and not by some daemon that spits out agenda files when you are away from emacs. >> Thanks >> Neilen >> >> >> >> >> --
Jambunatha,
> > Have you considered adding it to say org-mode-hook?
>
> Seems like a Wrong suggestion to me.
>
> Try using `C-c [' to add the current org file. I am assuming that org
> files are created by hand and not by some daemon that spits out agenda
> files when you are away from emacs.
Not a daemon, no, but I do tend to move files around. I.e. I'll move a project
file/dir from my "someday" folder to my "active" folder. I would like to avoid
any further manual steps to get it integrated in my agenda.
Is there a hook function that gets called every time an agenda view is opened or
refreshed? I could probably use that to update the agenda list.
Thanks
Neilen
Neilen Marais <nmarais@gmail.com> wrote:
> Jambunatha,
>
>
> > > Have you considered adding it to say org-mode-hook?
> >
> > Seems like a Wrong suggestion to me.
> >
> > Try using `C-c [' to add the current org file. I am assuming that org
> > files are created by hand and not by some daemon that spits out agenda
> > files when you are away from emacs.
>
> Not a daemon, no, but I do tend to move files around. I.e. I'll move a project
> file/dir from my "someday" folder to my "active" folder. I would like to avoid
> any further manual steps to get it integrated in my agenda.
>
> Is there a hook function that gets called every time an agenda view is opened or
> refreshed? I could probably use that to update the agenda list.
>
Seek and ye shall find:
C-h v org-agenda--hook RET
will list all the matching hooks. Which one to choose? I'll leave that up
to the interested reader :-) Or try
C-h v org--hook RET
to get a list of *all* the org hooks.
Nick
My understanding is that you want a file that gets moved into the
active directory to be automatically included in the agenda?
From worg:
You can simply include the directory (as one of the items) in the
value of the variable org-agenda-files:
(setq org-agenda-files '("/my/special/path/org/active/"))
There is another way of accomplishing the same end:
(setq org-agenda-files (file-expand-wildcards
"/my/special/path/org/active/*.org"))
The other files/directories could be in the extended text search if
needed but not part of the automatic agenda. Just my two cents. Not
that playing with agenda hooks might have some advantages.
Matt Sauer
On Tue, Oct 4, 2011 at 9:12 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> Neilen Marais <nmarais@gmail.com> wrote:
>
>> Jambunatha,
>>
>>
>> > > Have you considered adding it to say org-mode-hook?
>> >
>> > Seems like a Wrong suggestion to me.
>> >
>> > Try using `C-c [' to add the current org file. I am assuming that org
>> > files are created by hand and not by some daemon that spits out agenda
>> > files when you are away from emacs.
>>
>> Not a daemon, no, but I do tend to move files around. I.e. I'll move a project
>> file/dir from my "someday" folder to my "active" folder. I would like to avoid
>> any further manual steps to get it integrated in my agenda.
>>
>> Is there a hook function that gets called every time an agenda view is opened or
>> refreshed? I could probably use that to update the agenda list.
>>
>
> Seek and ye shall find:
>
> C-h v org-agenda--hook RET
>
> will list all the matching hooks. Which one to choose? I'll leave that up
> to the interested reader :-) Or try
>
> C-h v org--hook RET
>
> to get a list of *all* the org hooks.
>
> Nick
>
>
>
>
>
Hi Nick,
Nick Dokos <nicholas.dokos <at> hp.com> writes:
> Seek and ye shall find:
>
> C-h v org-agenda--hook RET
>
> will list all the matching hooks. Which one to choose? I'll leave that up
> to the interested reader
Indeed, doing
(load-library "find-lisp")
(add-hook 'org-agenda-mode-hook (lambda ()
(setq org-agenda-files
(find-lisp-find-files "~/Dropbox/GTD/ActiveProjects" "\.org$"))
))
fixes it good. Fantastic, thanks!
Cheers
Neilen
Matthew, Matthew Sauer <improv.philosophy <at> gmail.com> writes: > > My understanding is that you want a file that gets moved into the > active directory to be automatically included in the agenda? > From worg: > You can simply include the directory (as one of the items) in the > value of the variable org-agenda-files: > > (setq org-agenda-files '("/my/special/path/org/active/")) Thanks for the suggestion. Tried it already and found that it is unfortunately not recursive. I tend to make directories with projects under the active directory, then put the org file and supporting files in the directory. E.g. active/proj1/proj1.org active/prof1/info.pdf etc What's nice about this is that my project notes, todos and support files are close to each other. Also, I can simply use the dired listing of the active dir as my "active projects list" in GTD parlance :) > Not that playing with agenda hooks might have some advantages. I have indeed cooked up a hooky solution that should have hit the list by the time you read this :) Cheers Neilen