emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mario Peter <mario_peter@web.de>
To: emacs-orgmode@gnu.org
Subject: Re: Search all `org-agenda-files'
Date: Sat, 19 Apr 2008 12:47:13 +0000 (UTC)	[thread overview]
Message-ID: <loom.20080419T123741-141@post.gmane.org> (raw)
In-Reply-To: 87fxtkbrzi.fsf@gollum.intra.norang.ca

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

  parent reply	other threads:[~2008-04-19 12:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-17  9:57 Search all `org-agenda-files' Leo
2008-04-17 12:12 ` Bernt Hansen
2008-04-17 14:34   ` Eddward DeVilla
2008-04-19 12:47   ` Mario Peter [this message]
2008-04-17 18:23 ` Jost Burkardt
2008-04-18  3:44 ` Carsten Dominik
2008-04-18  3:58   ` Carsten Dominik
2008-04-18  7:06   ` Leo
2008-04-18 12:45   ` Bernt Hansen
2008-04-18 13:31 ` Joel J. Adamson

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=loom.20080419T123741-141@post.gmane.org \
    --to=mario_peter@web.de \
    --cc=emacs-orgmode@gnu.org \
    /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).