From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mario Peter Subject: Re: Search all `org-agenda-files' Date: Sat, 19 Apr 2008 12:47:13 +0000 (UTC) Message-ID: References: <87fxtkbrzi.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JnCWB-0003Xu-2y for emacs-orgmode@gnu.org; Sat, 19 Apr 2008 08:50:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JnCW9-0003XZ-7m for emacs-orgmode@gnu.org; Sat, 19 Apr 2008 08:50:10 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JnCW9-0003XT-1h for emacs-orgmode@gnu.org; Sat, 19 Apr 2008 08:50:09 -0400 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JnCW9-0002Hx-1l for emacs-orgmode@gnu.org; Sat, 19 Apr 2008 08:50:09 -0400 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1JnCW2-0003wY-MH for emacs-orgmode@gnu.org; Sat, 19 Apr 2008 12:50:02 +0000 Received: from p4FD5EB29.dip.t-dialin.net ([79.213.235.41]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Apr 2008 12:50:02 +0000 Received: from mario_peter by p4FD5EB29.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Apr 2008 12:50:02 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Bernt Hansen 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