[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnus: how to improve searching for articles
From: |
Giorgos Keramidas |
Subject: |
Re: gnus: how to improve searching for articles |
Date: |
Sun, 28 Jun 2009 03:02:28 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) |
On Sat, 27 Jun 2009 16:03:22 +0200, Francis Moreau <francis.moro@gmail.com>
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