[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: Search all `org-agenda-files'
From: |
Mario Peter |
Subject: |
[Orgmode] Re: Search all `org-agenda-files' |
Date: |
Sat, 19 Apr 2008 12:47:13 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Bernt Hansen <bernt <at> norang.ca> writes:
[...]
> It seems to me that grep works just fine for this application. I put
> all my org files under a single directory so that a single recursive
> grep for a regexp over *.org and *.org_archive gets me the information I
> want. Then I use org to edit/read the files at the specific line
> matches.
>
> If you do this in org-mode do you only search files in org-agenda-files
> (and maybe their archives?). If you scatter files around a lot how do
> you locate them all for the search?
>
> $ find $HOME -name '*.org' -o -name '*.org_archive' | xargs grep -n -e $REGEXP
for me coming from planner and muse it is useful to search in my old
repositories too. Assuming everything is under ~/org I can easygoing search:
(defun mpe-org-grep (string)
"Grep wrapper for searches in org hierarchy"
(interactive "sOrg Search (regexp): ")
(let ((grep-find-command "find ~/org/ -type f -print0 | xargs -0 -e grep -nHi
-e "))
(grep (concat grep-find-command string))))
regards, Mario