emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: Michael McAndrew <michaelmcandrew@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: regex to find *.org in subdirectories for agenda
Date: Wed, 20 May 2009 20:40:37 -0400	[thread overview]
Message-ID: <87k54bp9tm.fsf@gollum.intra.norang.ca> (raw)
In-Reply-To: <4b58d51b0905201657k5bd1916cpbed12feccb4ee459@mail.gmail.com> (Michael McAndrew's message of "Thu\, 21 May 2009 00\:57\:13 +0100")

Michael McAndrew <michaelmcandrew@gmail.com> writes:

> Hi there,
>

Hi Michael!

> I'm just getting started with org mode after having watched the google
> tech talk.  from my experiences so far, i think it is the tool i have
> been waiting for a long time!
>
> i've have transferred by entire huge nested todo list (which i was
> previously managing in a local mediawiki) and that has been great. 
> but am now excited about being able to split up and recompile all my
> todos automatically - so i can keep everything contextually organised.
>
> I have my projects organised in directories and sub directories under
> two projects directories, "~/work" and "~/home".  i want to keep *.org
> lists in each of these directories and have them automatically picked
> up by orgmode when i hit C-ca.  so i might have  ~/work/bbc/todo.org
> and ~/home/garden/todo.org

I don't use org-mode like this myself but just did a quick minimal emacs
test and it seems to work fine.   You can set org-agenda-files to the
directories you want to include in the agenda and all files matching the
org-agenda-file-regexp will be included in the agenda.

>
> I found this post
> http://www.mail-archive.com/emacs-orgmode@gnu.org/msg08945.html
>
> so i presume that i need to use a regular expression in
> find-lisp-find-files to create this list of files to feed to some
> variable like org-agenda-files...
>
> and have tried a million regex inspired expressions in my emacs config
> like:
>
> (load-library "find-lisp")
> (set org-agenda files (find-lisp-find-files "~" (rx seq(string-start (or "work" "home") ".org" string-end))))
                 ^
                 |
               no space here.  It should be org-agenda-files

>
> but it isn't working.
>
> i'm kind of out of my depth with emacs (aquamacs actually - only have
> a few days experience) and have never got to grips with regex! but
> also loving it and would be grateful if someone could pull me out of
> this hole :)

Here's my test setup -- I just added the directories to org-agenda-files:

I just created files in /tmp/play/ /tmp/work/ and /tmp/foo and added
some tasks to some of these just to see if they show up in the agenda
(and they did).

,----[ My test directory layout ]
| bernt@gollum:~/git/org-mode$ tree /tmp/play /tmp/work /tmp/foo
| /tmp/play
| |-- a.org
| |-- b.org
| |-- c.org
| |-- d.org
| `-- e.org
| /tmp/work
| |-- w-g.org
| |-- w-h.org
| |-- w-i.org
| |-- w-j.org
| `-- w-l.org
| /tmp/foo
| |-- foo-r.org
| |-- foo-s.org
| `-- foo-t.org
| 
| 0 directories, 13 files
`----

,----[ /tmp/minimal.emacs ]
| (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
| (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
| (require 'org-install)
| 
| (global-font-lock-mode t)
| (global-set-key "\C-cl" 'org-store-link)
| (global-set-key "\C-ca" 'org-agenda)
| (global-set-key "\C-cb" 'org-iswitchb)
| 
| (setq org-agenda-files (list "/tmp/work" "/tmp/play" "/tmp/foo"))
`----

,----[ /tmp/work/w-l.org ]
| #+STARTUP:
| * TODO Something for work
|   SCHEDULED: <2009-05-19 Tue>
`----

,----[ /tmp/foo/foo-s.org ]
| * Meeting
|   DEADLINE: <2009-05-22 Fri 12:00>
`----

,----[ /tmp/play/c.org ]
| #+STARTUP:
| * TODO Play with this
|   SCHEDULED: <2009-05-21 Thu 15:00>
`----

Starting emacs with:

emacs -q -l /tmp/minimal.emacs

and hitting C-c a a shows the following agenda

,----[ /tmp/agenda.txt ]
| Week-agenda (W21):
| Monday     18 May 2009 W21
| Tuesday    19 May 2009
|   w-l:        Scheduled:  TODO Something for work
| Wednesday  20 May 2009
|   w-l:        Sched. 2x:  TODO Something for work
|   foo-s:      In   2 d.:  Meeting
| Thursday   21 May 2009
|   c:          15:00...... Scheduled:  TODO Play with this
| Friday     22 May 2009
|   foo-s:      12:00...... Deadline:   Meeting
| Saturday   23 May 2009
| Sunday     24 May 2009
`----

HTH,
Bernt

  reply	other threads:[~2009-05-21  0:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20 23:57 regex to find *.org in subdirectories for agenda Michael McAndrew
2009-05-21  0:40 ` Bernt Hansen [this message]
2009-05-21  1:38   ` Michael McAndrew

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=87k54bp9tm.fsf@gollum.intra.norang.ca \
    --to=bernt@norang.ca \
    --cc=emacs-orgmode@gnu.org \
    --cc=michaelmcandrew@gmail.com \
    /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).