Re: Searching in the index is not documented
Guten Tag, Michael!
On Thu, Aug 17, 2006 at 12:28:38PM +0200, Michael Tatge wrote:
> * On Thu, Aug 17, 2006 Alan Mackenzie (acm@xxxxxx) muttered:
> > This manual, fine though it otherwise be, does not describe how to do
> > searching within the message index.
> It does you just have to know where to look :)
This is precisely my point. I started using mutt at the end of May 2006.
As a beginner, I didn't know where to look. Despite searching long and
hard in the manual for the answers to these questions, I didn't find
them. (Just as a matter of interest, I'm an Emacs hacker, and have a
great deal of experience in revising one of the Emacs manuals.)
Hence, I'm suggesting to the Mutt team, in a respectful fashion, that it
could be helpful to enhance the manual.
> > If I type "/foo":
> simple_search
> Type: string
> Default: "~f %s | ~s %s"
> Specifies how Mutt should expand a simple search into a real search
> pattern. A simple search is one that does not contain any of the ~
> operators. See ``[1182]patterns'' for more information on search
> patterns.
> For example, if you simply type joe at a search or limit prompt, Mutt
> will automatically expand it to the value specified by this variable.
> For the default value it would be:
> ~f joe | ~s joe
OK. This answers my point (i), I think: Namely, when I enter "/foo" in
the index display, mutt searches for the string in the From: and Subject:
headers. Thanks! I would have found it useful to have read this
explicitly in the manual 2 months ago.
Incidentally, what is the significance of the spaces in "~f joe | ~s
joe"? Does "~fjoe" mean the same as "~f joe"? What about "~f joe"?
The manual seems to indicate a single space is needed, but is
frustratingly vague about it.
Incidentally(2), can I search for a literal "~f" in the Subject: header
by a typing something like: "/\~f"?
> > (ii) Is "foo" interpreted literally as text or as a regular expression?
> Let's check the "Patterns" section:
> ~f EXPR - messages originating from EXPR
> ~s EXPR - messages having EXPR in the ``Subject'' field.
> "Where EXPR is a regular expression."
Yes, I've got that now. But I had to discover it by experiment back in
May, since at the time I didn't have enough background knowledge of mutt
to know that the word "Patterns" was pertinent to searching.
> > (iii) If there are several instances of "foo", in what order does mutt
> > find them? I would guess that it would use the order the mails are
> > currently sorted in.
> correct.
Why do I have to guess?
> > (iv) Can I somehow search my mailbox for a pattern? (e.g. "~fAlan")?
> Of course. What good are patterns when you cannot use them to search?
They're good for tagging (with `T'), or for restricting the messages
displayed (with `l'). I didn't learn that they could be also used for
searching (with `/' and `M-/' (excuse the Emacs notation ;-)) until
Tuesday of this week, when I tried it out. I would have learnt this much
earlier if the manual had been more explicit.
> HTH,
Yes, it's helped a lot. Thanks!
> Michael
--
Alan Mackenzie (Munich, Germany).