Next: , Previous: , Up: The Mail Interface   [Contents][Index]


10.7 Scanning and Picking Messages

As pointed out in the introduction of this chapter, users typically generate headers or scan listings of messages with Message Headers, using commands that operate on the messages represented by the headers. Pick Headers (bound to h in Headers mode) can be used to narrow down (or further select over) the headers in the buffer.

A pick expression may be entered using either a Lisp syntax or a Unix shell-like/switch notation as described in the MH documentation. The Lisp syntax is as follows:

   <exp>       ::=  {(not <exp>) | (and <exp>*) | (or <exp>*)
		    | (cc <pattern>) | (date <pattern>)
		    | (from <pattern>) | (search <pattern>)
		    | (subject <pattern>) | (to <pattern>)
		    | (-- <component> <pattern>)
		    | (before <date>) | (after <date>)
		    | (datefield <field>)}

   <pattern>   ::=  {<string> | <symbol>}

   <component> ::=  {<string> | <symbol>}

   <date>      ::=  {<string> | <symbol> | <number>}

   <field>     ::=  <string>

Anywhere the user enters a <symbol>, its symbol name is used as a string. Since Hemlock reads the expression without evaluating it, single quotes ("") are unnecessary. From the MH documentation,

Since a <pattern> may be a symbol or string, it should be noted that the symbol name is probably all uppercase characters, and MH will match these only against upper case. MH will match lowercase characters against lower and upper case. Some examples are:

   ;;; All messages to Gripe.
   (to "gripe")

   ;;; All messages to Gripe or about Hemlock.
   (or (to "gripe") (subject "hemlock"))

   ;;; All messages to Gripe with "Hemlock" in the body.
   (and (to "gripe") (search "hemlock"))

Matching of <component> fields is case sensitive, so this example will pick over all messages that have been replied to.

(or (-- "replied" "") (-- "Replied" ""))
Hemlock Variable: MH Scan Line Form (initial value "library:mh-scan")

This is a pathname of a file containing an MH format expression used for header lines.

The header line format must display the message ID as the first non-whitespace item. If the user uses the virtual message deletion feature which is on by default, there must be a space three characters to the right of the message ID. This location is used on header lines to note that a message is flagged for deletion. The second space after the message ID is used for notating answered or replied-to messages.

Command: Message Headers (bound to C-x r)

This command prompts for a folder, message (defaulting to "all"), and an optional pick expression. Typically this will simply be used to generate headers for an entire folder or sequence, and the pick expression will not be used. A new Headers buffer is made, and the output of scan on the messages indicated is inserted into the buffer. The current window is used, the buffer’s point is moved to the first header, and the Headers buffer becomes current. The current value of the Hemlock Fill Column variable is supplied to scan as the -width switch. The buffer name is set to a string of the form "Headers <folder> <msgs> <pick expression>", so the modeline will show what is in the buffer. If no pick expression was supplied, none will be shown in the buffer’s name. As described in the introduction to this section, the expression may be entered using either a Lisp syntax or a Unix shell-like/switch notation.

Hemlock Variable: MH Lisp Expression (initial value t)

When this is set, MH expression prompts are read in a Lisp syntax. Otherwise, the input is of the form of a Unix shell-like/switch notation as described in the MH documentation.

Command: Pick Headers stuff (bound to h in Headers mode)

This command is only valid in a Headers buffer. It prompts for a pick expression, and the messages shown in the buffer are supplied to pick with the expression. The resulting messages are scan’ed, deleting the previous contents of the buffer. The current value of Fill Column is used for the scan’ing. The buffer’s point is moved to the first header. The buffer’s name is set to a string of the form "Headers <folder> <msgs picked over> <pick expression>", so the modeline will show what is in the buffer. As described in the introduction to this section, the expression may be entered using either a Lisp syntax or a Unix shell-like/switch notation.

Command: Headers Help (bound to Headers: ?)

This command displays documentation on Headers mode.


Next: Reading New Mail, Previous: Introduction to Commands and Variables, Up: The Mail Interface   [Contents][Index]