emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Multiple Recursive Directories with org-agenda-files
@ 2014-04-14 23:00 Esben Stien
  2014-04-15  8:43 ` Julian M. Burgos
  0 siblings, 1 reply; 4+ messages in thread
From: Esben Stien @ 2014-04-14 23:00 UTC (permalink / raw)
  To: emacs-orgmode

I'm trying to add a few recursive directories to org-agenda-files, but
can't really find any examples doing this 

I got like 250 org files spread over a few directories.

I want to add:

~/foo/bar/
~/baz/quux/
~/hukarz/grault/

..which again includes multiple directories with .org files and a few
other files which I don't want included.

Anyone who does this?

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Multiple Recursive Directories with org-agenda-files
  2014-04-14 23:00 Multiple Recursive Directories with org-agenda-files Esben Stien
@ 2014-04-15  8:43 ` Julian M. Burgos
  2014-04-15 18:54   ` Esben Stien
  0 siblings, 1 reply; 4+ messages in thread
From: Julian M. Burgos @ 2014-04-15  8:43 UTC (permalink / raw)
  To: Esben Stien; +Cc: emacs-orgmode

Hi Esben,

I use find-lisp-find-files.  I have the following in my .emacs file: 

;;------------------------------------------------------------------------------
;; Load org agenda files
;;------------------------------------------------------------------------------
(load-library "find-lisp")

(add-hook 'org-agenda-mode-hook (lambda () 
(setq org-agenda-files 
      (find-lisp-find-files "/home/julian/Documents" "\.org$"))
))

With this when I do C-c a, all the *.org files in my Documents directory
get added into the agenda.

According to this
http://archive.today/7McXW#selection-9101.0-9101.4

If you are on a Linux machine you can use the find utility, which can be
faster that the lisp library:

(setq org-agenda-files
      (mapcar 'abbreviate-file-name
              (split-string
               (shell-command-to-string "find ~/org -name \"*.org\"")
      "\n")))

I have not tried it though... but I may do it now.

I hope this helps.

Julian



Esben Stien writes:

> I'm trying to add a few recursive directories to org-agenda-files, but
> can't really find any examples doing this 
>
> I got like 250 org files spread over a few directories.
>
> I want to add:
>
> ~/foo/bar/
> ~/baz/quux/
> ~/hukarz/grault/
>
> ..which again includes multiple directories with .org files and a few
> other files which I don't want included.
>
> Anyone who does this?


-- 
Julian Mariano Burgos, PhD
Hafrannsóknastofnun/Marine Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: julian@hafro.is

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Multiple Recursive Directories with org-agenda-files
  2014-04-15  8:43 ` Julian M. Burgos
@ 2014-04-15 18:54   ` Esben Stien
  2014-04-15 20:01     ` Nick Dokos
  0 siblings, 1 reply; 4+ messages in thread
From: Esben Stien @ 2014-04-15 18:54 UTC (permalink / raw)
  To: emacs-orgmode

"Julian M. Burgos" <julian@hafro.is> writes:

> (load-library "find-lisp")
> (add-hook 'org-agenda-mode-hook (lambda () 
> (setq org-agenda-files 
>       (find-lisp-find-files "/home/julian/Documents" "\.org$"))
> ))

This is not a multiple directories examples, so I tried: 

(add-hook 'org-agenda-mode-hook (lambda () 
				  (setq org-agenda-files 
					(find-lisp-find-files "~/foo/bar" "\.org$")
					(find-lisp-find-files "~/hukarz/quux" "\.org$"))
				  ))

, but that just threw a lisp error.

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Multiple Recursive Directories with org-agenda-files
  2014-04-15 18:54   ` Esben Stien
@ 2014-04-15 20:01     ` Nick Dokos
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2014-04-15 20:01 UTC (permalink / raw)
  To: emacs-orgmode

Esben Stien <b0ef@esben-stien.name> writes:

> "Julian M. Burgos" <julian@hafro.is> writes:
>
>> (load-library "find-lisp")
>> (add-hook 'org-agenda-mode-hook (lambda () 
>> (setq org-agenda-files 
>>       (find-lisp-find-files "/home/julian/Documents" "\.org$"))
>> ))
>
> This is not a multiple directories examples, so I tried: 
>
> (add-hook 'org-agenda-mode-hook (lambda () 
> 				  (setq org-agenda-files
                                    (append
> 					(find-lisp-find-files "~/foo/bar" "\.org$")
> 					(find-lisp-find-files "~/hukarz/quux" "\.org$")))))
>
> , but that just threw a lisp error.

You need to append all the subsequent lists onto the first list,
creating a big list which can be setq'ed to org-agenda-files.

What you tried to do is the equivalent of

(setq foo '(1 2 3) '(4 5 6))

which is not legal lisp - do C-h f setq RET to find out why.

Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-15 20:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-14 23:00 Multiple Recursive Directories with org-agenda-files Esben Stien
2014-04-15  8:43 ` Julian M. Burgos
2014-04-15 18:54   ` Esben Stien
2014-04-15 20:01     ` Nick Dokos

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).