From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giorgos Keramidas Newsgroups: gmane.emacs.help Subject: Re: gnus: how to improve searching for articles Date: Sun, 28 Jun 2009 03:02:28 +0300 Organization: SunSITE.dk - Supporting Open source Message-ID: <874ou15ip7.fsf@kobe.laptop> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1246211194 19241 80.91.229.12 (28 Jun 2009 17:46:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Jun 2009 17:46:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 28 19:46:27 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MKySO-0002jO-O5 for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Jun 2009 19:46:25 +0200 Original-Received: from localhost ([127.0.0.1]:48743 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MKySO-0003mj-3B for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Jun 2009 13:46:24 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!news.banetele.no!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) Cancel-Lock: sha1:fD+SItr/qfUYDeYpmCS1HhNlSQw= Original-Lines: 94 Original-NNTP-Posting-Host: 77.49.224.76 Original-X-Trace: news.sunsite.dk DXC=`[>TW`FU\le`; IS0i7S8TaYSB=nbEKnkk2J[8Ab?iJOmL^MjgbH?lJH1TkjlPmi5gl1; nJhe8P3K2mN3?a Original-X-Complaints-To: staff@sunsite.dk Original-Xref: news.stanford.edu gnu.emacs.help:170390 X-Mailman-Approved-At: Sun, 28 Jun 2009 13:41:28 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:65608 Archived-At: On Sat, 27 Jun 2009 16:03:22 +0200, Francis Moreau wrote: > Hello, > > I sometimes need to search for a word in all articles from one group. For > that I use: > > `M-s' > Search through all subsequent (raw) articles for a regexp > (`gnus-summary-search-article-forward'). > > This would be wonderfull if the match in the article could be > highlighted (a la 'grep --color' for example) because it's pretty hard > to know where the match has been found in the article at first glance. > > The previous command actually does an incremental search. However > sometimes it may be more convenient to do a global a search and get the > list of all articles that containing a match in an other window. It's > actually a 'M-x grep' command but which works on group's articles. Does > this command exist ? > > Also I'm wondering how to search a pattern in the body of an article > only. Hi Francis, One way is to use '& RET regexp RET #' in the summary buffer. If you don't type a header in the prompt of '&' it searches the entire article, including both headers and body. The '#' command marks the matching articles with the '#' mark, and then you can: 1) Limit the summary buffer to the matching articles by typing `/ n', or 2) Run a command that understand `process-mark', i.e. commands to copy the articles to other groups, mass-followup commands, and so on. In Emacs 23.X there is also a plugin for searching local group folders with mairix(1). This requires an external utility and I have only tested it with nnml folders, but when its external search database has been synchronized with all the `nnml:*' folders it is blazingly fast and it supports its own mini-language for searches, i.e.: - Search for posts by an author whose name includes `francis' and one of the recipients (in `To:' or `Cc:' matches `emacs'): f:francis tc:emacs - Search for posts whose body matches `emacs' and their subject includes the word `debian': b:emacs s:debian When you have installed mairix and have configured it to generate a search database for nnml folders, have a look at the Info node `Top > Group Buffer > Searching > nnmairix'. This part of the manual describes how you can integrate mairix into Gnus. If it helps at all, here is my `~/.mairixrc' file for nnml folders stored at nnml folders in `~/Mail/mail/*' and their sub-folders: # This file is a Configuration file for indexing email messages with # the `mairix' indexing utility. # # The particular setup defined by this file has been customized to # match my personal setup of Gnus, so some of the non-standard # options only make sense on my own user account. # # The format of this configuration file is quite easy to parse # though, and all the options used here are well documented in the # mairixrc(5) manpage. Please check that manpage if you find it # difficult to read some parts of this file. # The base directory of my Gnus mail folders. base=/home/keramida/Mail # Index all subfolders by default, but omit `mail.junk' where all # the messages tagged as spam end up, and `mail.mairix' where mairix # will store search results. mh=posted:mail... omit=mail/junk:mail/mairix # When mailrix performs a search, this is the folder where search # results will be saved, and the format of the result folder. mfolder=mail/mairix mformat=mh # The path to the indexing database of mairix. Currently mairix # will only place a single file at the location specified here. # A future version of mairix may convert this to a directory with # multiple files stored in the directory. database=~/Mail/mairix-db HTH, Giorgos