From mboxrd@z Thu Jan 1 00:00:00 1970 From: Darlan Cavalcante Moreira Subject: Re: Question about org-search-view and org-occur-in-agenda-files Date: Mon, 25 Jul 2011 15:29:54 -0300 Message-ID: <4e2db626.1451640a.13da.fffff268@mx.google.com> References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlPuj-0002Vz-KV for emacs-orgmode@gnu.org; Mon, 25 Jul 2011 14:30:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlPui-00071W-6e for emacs-orgmode@gnu.org; Mon, 25 Jul 2011 14:30:01 -0400 Received: from mail-yi0-f41.google.com ([209.85.218.41]:43127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlPui-00071Q-44 for emacs-orgmode@gnu.org; Mon, 25 Jul 2011 14:30:00 -0400 Received: by yia13 with SMTP id 13so2763942yia.0 for ; Mon, 25 Jul 2011 11:29:59 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: suvayu ali Cc: org-mode mailing list You can probably use custom agenda commands for this. See the documentation for the org-agenda-custom-commands and the corresponding section in the manual [1]. You can set the org-agenda-files and org-agenda-text-search-extra-files to point to the old project for some custom search. For instance, I use --8<---------------cut here---------------start------------->8--- #+begin_src emacs-lisp (setq org-agenda-custom-commands (quote ( ... Some custom commands ("N" . "Search in notes.org") ("Nw" search "" ((org-agenda-files '("~/org/notes.org")) (org-agenda-text-search-extra-files nil))) ("Nt" tags "" ((org-agenda-files '("~/org/notes.org")) (org-agenda-text-search-extra-files nil))) ... Some more custom commands ))) #+end_src --8<---------------cut here---------------end--------------->8--- This allows-me to perform a search only in my org/notes.org file without actually changing my org-agenda-files. -- Darlan [1] - http://orgmode.org/org.html#Custom-agenda-views At Sat, 23 Jul 2011 19:36:16 +0200, suvayu ali wrote: > > Hi Orgers, > > I know that I can use `org-search-view' or `org-occur-in-agenda-files' > from the agenda to search for some string on all my agenda files. And I > can customise `org-agenda-text-search-extra-files' to include extra text > files. > > These search functions are quite powerful in general, so I was wondering > if these functions can be used to do a search restricted to say a list > of files or to org files within a directory. If I could wrap these in my > own functions, even that would be amazingly helpful. > > To illustrate a use case, I recently switched research projects[1]. I > keep all my files related to the OLDPROJ under ~/org/OLDPROJ/ and all my > files related to the NEWPROJ under ~/org/NEWPROJ/[2]. Now when I perform > a text search I want to include only the NEWPROJ along with my agenda > files (located in ~/org/). Now I would like to have an interface (either > through the agenda menu or through some interactively called function) > to perform a search _only_ on the OLDPROJ files when necessary. Is that > possible? > > Any hints as to how I can achieve this would be amazingly helpful. > Thanks. :) > > > Footnotes: > > [1] I am using the word project rather loosely to describe a > super-project with several sub-projects which are rather significant > by themselves. > > [2] These project directories have their own structure based on > sub-projects and other needs. > > -- > Suvayu > > Open source is the future. It sets us free. >