X-Git-Url: https://git.llucax.com/software/mutt-debian.git/blobdiff_plain/647ac5444d022537a1f0854dd309494c511dfe07..90ca98902668310adea2bd544a61a3d6c9c12f1c:/doc/advancedusage.html?ds=inline diff --git a/doc/advancedusage.html b/doc/advancedusage.html index 336aa19..071df4c 100644 --- a/doc/advancedusage.html +++ b/doc/advancedusage.html @@ -1,6 +1,6 @@ -
Table of Contents
-All string patterns in Mutt including those in more complex -patterns must be specified -using regular expressions (regexp) in the âPOSIX extendedâ syntax (which +
Table of Contents
+A âcharacter setâ is basically a mapping between bytes and +glyphs and implies a certain character encoding scheme. For example, for +the ISO 8859 family of character sets, an encoding of 8bit per character +is used. For the Unicode character set, different character encodings +may be used, UTF-8 being the most popular. In UTF-8, a character is +represented using a variable number of bytes ranging from 1 to 4. +
+Since Mutt is a command-line tool run from a shell, and delegates
+certain tasks to external tools (such as an editor for composing/editing
+messages), all of these tools need to agree on a character set and
+encoding. There exists no way to reliably deduce the character set a
+plain text file has. Interoperability is gained by the use of
+well-defined environment variables. The full set can be printed by
+issuing locale
on the command line.
+
+Upon startup, Mutt determines the character set on its own using
+routines that inspect locale-specific environment variables. Therefore,
+it is generally not necessary to set the $charset
+variable in Mutt. It may even be counter-productive as Mutt uses system
+and library functions that derive the character set themselves and on
+which Mutt has no influence. It's safest to let Mutt work out the locale
+setup itself.
+
+If you happen to work with several character sets on a regular basis, +it's highly advisable to use Unicode and an UTF-8 locale. Unicode can +represent nearly all characters in a message at the same time. When not +using a Unicode locale, it may happen that you receive messages with +characters not representable in your locale. When displaying such a +message, or replying to or forwarding it, information may get lost +possibly rendering the message unusable (not only for you but also for +the recipient, this breakage is not reversible as lost information +cannot be guessed). +
+A Unicode locale makes all conversions superfluous which eliminates the +risk of conversion errors. It also eliminates potentially wrong +expectations about the character set between Mutt and external programs. +
+The terminal emulator used also must be properly configured for the +current locale. Terminal emulators usually do not +derive the locale from environment variables, they need to be configured +separately. If the terminal is incorrectly configured, Mutt may display +random and unexpected characters (question marks, octal codes, or just +random glyphs), format strings may not work as expected, you may not be +abled to enter non-ascii characters, and possible more. Data is always +represented using bytes and so a correct setup is very important as to +the machine, all character sets âlookâ the same. +
+Warning: A mismatch between what system and library functions think the
+locale is and what Mutt was told what the locale is may make it behave
+badly with non-ascii input: it will fail at seemingly random places.
+This warning is to be taken seriously since not only local mail handling
+may suffer: sent messages may carry wrong character set information the
+receiver has too deal with. The need to set
+$charset
directly in most cases points at terminal
+and environment variable setup problems, not Mutt problems.
+
+A list of officially assigned and known character sets can be found at
+IANA,
+a list of locally supported locales can be obtained by running
+locale -a
.
+
+All string patterns in Mutt including those in more complex patterns must be specified using regular +expressions (regexp) in the âPOSIX extendedâ syntax (which is more or less the syntax used by egrep and GNU awk). For your convenience, we have included below a brief description of this syntax.
The search is case sensitive if the pattern contains at least one upper case letter, and case insensitive otherwise. -
-â\â -must be quoted if used for a regular expression in an initialization -command: â\\â. +
+â\â must be quoted if used for a regular expression in an +initialization command: â\\â.
A regular expression is a pattern that describes a set of strings. Regular expressions are constructed analogously to arithmetic expressions, by using various operators to combine smaller expressions. -
-The regular expression can be enclosed/delimited by either " -or ' which is useful if the regular expression includes a white-space -character. See Syntax of Initialization Files -for more information on " and ' delimiter processing. To match a -literal " or ' you must preface it with \ (backslash). +
+The regular expression can be enclosed/delimited by either " or ' which +is useful if the regular expression includes a white-space character. +See Syntax of Initialization Files for more information on " and ' +delimiter processing. To match a literal " or ' you must preface it +with \ (backslash).
-The fundamental building blocks are the regular expressions that match -a single character. Most characters, including all letters and digits, +The fundamental building blocks are the regular expressions that match a +single character. Most characters, including all letters and digits, are regular expressions that match themselves. Any metacharacter with special meaning may be quoted by preceding it with a backslash.
-The period â.â matches any single character. The caret â^â and -the dollar sign â$â are metacharacters that respectively match -the empty string at the beginning and end of a line. -
-A list of characters enclosed by â[â and â]â matches any -single character in that list; if the first character of the list -is a caret â^â then it matches any character not in the -list. For example, the regular expression [0123456789] -matches any single digit. A range of ASCII characters may be specified -by giving the first and last characters, separated by a hyphen -â-â. Most metacharacters lose their special meaning inside -lists. To include a literal â]â place it first in the list. -Similarly, to include a literal â^â place it anywhere but first. -Finally, to include a literal hyphen â-â place it last. +The period â.â matches any single character. The caret +â^â and the dollar sign â$â are metacharacters +that respectively match the empty string at the beginning and end of a +line. +
+A list of characters enclosed by â[â and â]â +matches any single character in that list; if the first character of the +list is a caret â^â then it matches any character +not in the list. For example, the regular +expression [0123456789] matches any single digit. +A range of ASCII characters may be specified by giving the first and +last characters, separated by a hyphen â-â. Most +metacharacters lose their special meaning inside lists. To include a +literal â]â place it first in the list. Similarly, to +include a literal â^â place it anywhere but first. +Finally, to include a literal hyphen â-â place it last.
Certain named classes of characters are predefined. Character classes -consist of â[:â, a keyword denoting the class, and â:]â. -The following classes are defined by the POSIX standard in +consist of â[:â, a keyword denoting the class, and +â:]â. The following classes are defined by the POSIX +standard in Table 4.1, âPOSIX regular expression character classesâ -
Table 4.1. POSIX regular expression character classes
Character class | Description |
---|---|
[:alnum:] | Alphanumeric characters |
[:alpha:] | Alphabetic characters |
[:blank:] | Space or tab characters |
[:cntrl:] | Control characters |
[:digit:] | Numeric characters |
[:graph:] | Characters that are both printable and visible. (A space is printable, but not visible, while an âaâ is both) |
[:lower:] | Lower-case alphabetic characters |
[:print:] | Printable characters (characters that are not control characters) |
[:punct:] | Punctuation characters (characters that are not letter, digits, control characters, or space characters) |
[:space:] | Space characters (such as space, tab and formfeed, to name a few) |
[:upper:] | Upper-case alphabetic characters |
[:xdigit:] | Characters that are hexadecimal digits |
+
Table 4.1. POSIX regular expression character classes
Character class | Description |
---|---|
[:alnum:] | Alphanumeric characters |
[:alpha:] | Alphabetic characters |
[:blank:] | Space or tab characters |
[:cntrl:] | Control characters |
[:digit:] | Numeric characters |
[:graph:] | Characters that are both printable and visible. (A space is printable, but not visible, while an âaâ is both) |
[:lower:] | Lower-case alphabetic characters |
[:print:] | Printable characters (characters that are not control characters) |
[:punct:] | Punctuation characters (characters that are not letter, digits, control characters, or space characters) |
[:space:] | Space characters (such as space, tab and formfeed, to name a few) |
[:upper:] | Upper-case alphabetic characters |
[:xdigit:] | Characters that are hexadecimal digits |
A character class is only valid in a regular expression inside the brackets of a character list. -
-Note that the brackets in these -class names are part of the symbolic names, and must be included -in addition to the brackets delimiting the bracket list. For -example, [[:digit:]] is equivalent to -[0-9]. +
+Note that the brackets in these class names are part of the symbolic +names, and must be included in addition to the brackets delimiting the +bracket list. For example, [[:digit:]] is +equivalent to [0-9].
Two additional special sequences can appear in character lists. These apply to non-ASCII character sets, which can have single symbols (called @@ -90,17 +153,21 @@ as well as several characters that are equivalent for collating or sorting purposes:
A collating symbol is a multi-character collating element enclosed in -â[.â and â.]â. For example, if âchâ is a collating -element, then [[.ch.]] is a regexp that matches -this collating element, while [ch] is a regexp that -matches either âcâ or âhâ. +â[.â and â.]â. For example, if +âchâ is a collating element, then +[[.ch.]] is a regexp that matches this collating +element, while [ch] is a regexp that matches either +âcâ or âhâ.
-An equivalence class is a locale-specific name for a list of -characters that are equivalent. The name is enclosed in â[=â -and â=]â. For example, the name âeâ might be used to -represent all of âèâ âéâ and âeâ. In this case, -[[=e=]] is a regexp that matches any of -âèâ, âéâ and âeâ. +An equivalence class is a locale-specific name for a list of characters +that are equivalent. The name is enclosed in â[=â and +â=]â. For example, the name âeâ might be used +to represent all of âeâ with grave +(âèâ), âeâ with acute +(âéâ) and âeâ. In this case, +[[=e=]] is a regexp that matches any of: +âeâ with grave (âèâ), âeâ +with acute (âéâ) and âeâ.
A regular expression matching a single character may be followed by one of several repetition operators described in Table 4.2, âRegular expression repetition operatorsâ. @@ -109,258 +176,272 @@ Two regular expressions may be concatenated; the resulting regular expression matches any string formed by concatenating two substrings that respectively match the concatenated subexpressions.
-Two regular expressions may be joined by the infix operator â|â; -the resulting regular expression matches any string matching either -subexpression. +Two regular expressions may be joined by the infix operator +â|â; the resulting regular expression matches any string +matching either subexpression.
Repetition takes precedence over concatenation, which in turn takes precedence over alternation. A whole subexpression may be enclosed in parentheses to override these precedence rules. -
+
If you compile Mutt with the included regular expression engine, the -following operators may also be used in regular expressions as described in Table 4.3, âGNU regular expression extensionsâ. +following operators may also be used in regular expressions as described +in Table 4.3, âGNU regular expression extensionsâ.
Table 4.3. GNU regular expression extensions
Expression | Description |
---|---|
\\y | Matches the empty string at either the beginning or the end of a word |
\\B | Matches the empty string within a word |
\\< | Matches the empty string at the beginning of a word |
\\> | Matches the empty string at the end of a word |
\\w | Matches any word-constituent character (letter, digit, or underscore) |
\\W | Matches any character that is not word-constituent |
\\` | Matches the empty string at the beginning of a buffer (string) |
\\' | Matches the empty string at the end of a buffer |
Please note however that these operators are not defined by POSIX, so they may or may not be available in stock libraries on various systems. -
Many of Mutt's commands allow you to specify a pattern to match
(limit
, tag-pattern
,
delete-pattern
, etc.). Table 4.4, âPattern modifiersâ
shows several ways to select messages.
-
Table 4.4. Pattern modifiers
Pattern modifier | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
~A | all messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~b EXPR | messages which contain EXPR in the message body | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
=b STRING | messages which contain STRING in the message body. If IMAP is enabled, searches for STRING on the server, rather than downloading each message and searching it locally. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~B EXPR | messages which contain EXPR in the whole message | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~c EXPR | messages carbon-copied to EXPR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%c GROUP | messages carbon-copied to any member of GROUP | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~C EXPR | messages either to: or cc: EXPR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%C GROUP | messages either to: or cc: to any member of GROUP | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~d [MIN]-[MAX] | messages with âdate-sentâ in a Date range | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~D | deleted messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~e EXPR | messages which contains EXPR in the âSenderâ field | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%e GROUP | messages which contain a member of GROUP in the âSenderâ field | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~E | expired messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~F | flagged messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~f EXPR | messages originating from EXPR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%f GROUP | messages originating from any member of GROUP | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~g | cryptographically signed messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~G | cryptographically encrypted messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~h EXPR | messages which contain EXPR in the message header | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~H EXPR | messages with a spam attribute matching EXPR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~i EXPR | messages which match EXPR in the âMessage-IDâ field | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~k | messages which contain PGP key material | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~L EXPR | messages either originated or received by EXPR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%L GROUP | message either originated or received by any member of GROUP | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~l | messages addressed to a known mailing list | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~m [MIN]-[MAX] | messages in the range MIN to MAX *) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~n [MIN]-[MAX] | messages with a score in the range MIN to MAX *) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~N | new messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~O | old messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~p | messages addressed to you (consults alternates) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~P | messages from you (consults alternates) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~Q | messages which have been replied to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~r [MIN]-[MAX] | messages with âdate-receivedâ in a Date range | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~R | read messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~s EXPR | messages having EXPR in the âSubjectâ field. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~S | superseded messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~t EXPR | messages addressed to EXPR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~T | tagged messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~u | messages addressed to a subscribed mailing list | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~U | unread messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~v | messages part of a collapsed thread. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~V | cryptographically verified messages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~x EXPR | messages which contain EXPR in the âReferencesâ or âIn-Reply-Toâ field | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~X [MIN]-[MAX] | messages with MIN to MAX attachments *) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~y EXPR | messages which contain EXPR in the âX-Labelâ field | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~z [MIN]-[MAX] | messages with a size in the range MIN to MAX *) **) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~= | duplicated messages (see $duplicate_threads) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~$ | unreferenced messages (requires threaded view) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~(PATTERN) | messages in threads
+ Table 4.4. Pattern modifiers
-Where EXPR is a -regular expression. - -*) The forms â<[MAX]â, â>[MIN]â, -â[MIN]-â and â-[MAX]â -are allowed, too. - -**) The suffixes âKâ and âMâ are allowed to specify kilobyte and megabyte respectively. -
-Special attention has to be
-payed when using regular expressions inside of patterns. Specifically,
-Mutt's parser for these patterns will strip one level of backslash (â\â),
-which is normally used for quoting. If it is your intention to use a
-backslash in the regular expression, you will need to use two backslashes
-instead (â\\â). You can force Mutt to treat EXPR as a simple string
-instead of a regular expression by using = instead of Ë in the
-pattern name. For example, -Patterns matching lists of addresses (notably c, C, p, P and t) -match if there is at least one match in the whole list. If you want to -make sure that all elements of that list match, you need to prefix your -pattern with â^â. -This example matches all mails which only has recipients from Germany. +Where EXPR is a regular expression, and GROUP is an +address group. + +*) The forms â<[MAX]â, +â>[MIN]â, +â[MIN]-â and +â-[MAX]â are allowed, too. + +**) The suffixes âKâ and âMâ are allowed to +specify kilobyte and megabyte respectively. +
+Special attention has to be payed when using regular expressions inside
+of patterns. Specifically, Mutt's parser for these patterns will strip
+one level of backslash (â\â), which is normally used for
+quoting. If it is your intention to use a backslash in the regular
+expression, you will need to use two backslashes instead
+(â\\â). You can force Mutt to treat
+EXPR as a simple string instead of a regular
+expression by using = instead of ~ in the pattern name. For example,
+ +Patterns matching lists of addresses (notably c, C, p, P and t) match if +there is at least one match in the whole list. If you want to make sure +that all elements of that list match, you need to prefix your pattern +with â^â. This example matches all mails which only has +recipients from Germany. -Mutt supports two versions of so called âsimple searchesâ. These are -issued if the query entered for searching, limiting and similar -operations does not seem to contain a valid pattern modifier (i.e. it does not contain -one of these characters: âËâ, â=â or â%â). If the query is -supposed to contain one of these special characters, they must be escaped -by prepending a backslash (â\â). + +Mutt supports two versions of so called âsimple +searchesâ. These are issued if the query entered for searching, +limiting and similar operations does not seem to contain a valid pattern +modifier (i.e. it does not contain one of these characters: +â~â, â=â or â%â). If the query is +supposed to contain one of these special characters, they must be +escaped by prepending a backslash (â\â).
The first type is by checking whether the query string equals
a keyword case-insensitively from Table 4.5, âSimple search keywordsâ:
If that is the case, Mutt will use the shown pattern modifier instead.
If a keyword would conflict with your search keyword, you need to turn
it into a regular expression to avoid matching the keyword table. For
-example, if you want to find all messages matching âflagâ
-(using $simple_search)
+example, if you want to find all messages matching âflagâ
+(using $simple_search)
but don't want to match flagged messages, simply search for
-â Table 4.5. Simple search keywords
-The second type of simple search is to build a complex search -pattern using $simple_search -as a template. Mutt will insert your query properly quoted and search -for the composed complex query. - +The second type of simple search is to build a complex search pattern +using $simple_search as a +template. Mutt will insert your query properly quoted and search for the +composed complex query. + Logical AND is performed by specifying more than one criterion. For example: ~t mutt ~f elkins -would select messages which contain the word âmuttâ in the list of -recipients and that have the word âelkinsâ in the âFromâ header -field. +would select messages which contain the word âmuttâ in the +list of recipients and that have the word +âelkinsâ in the âFromâ header field. -Mutt also recognizes the following operators to create more complex search -patterns: -
-Mutt supports two types of dates, absolute and relative. - -Dates must be in DD/MM/YY format (month and year are -optional, defaulting to the current month and year). An example of a valid -range of dates is: +'~s "^Junk +From +Me$" ~f ("Jim +Somebody"|"Ed +SomeoneElse")' + Note
+If a regular expression contains parenthesis, or a vertical bar ("|"),
+you must enclose the expression in double or single
+quotes since those characters are also used to separate different parts
+of Mutt's pattern language. For example: +Mutt supports two types of dates, absolute and +relative. + +Dates must be in DD/MM/YY format (month and year +are optional, defaulting to the current month and year). An example of +a valid range of dates is: Limit to messages matching: ~d 20/1/95-31/10 -If you omit the minimum (first) date, and just specify â-DD/MM/YYâ, all -messages before the given date will be selected. If you omit the maximum -(second) date, and specify âDD/MM/YY-â, all messages after the given -date will be selected. If you specify a single date with no dash (â-â), -only messages sent on the given date will be selected. - -You can add error margins to absolute dates. -An error margin is a sign (+ or -), followed by a digit, followed by -one of the units in Table 4.6, âDate unitsâ. As a special case, you can replace the -sign by a â*â character, which is equivalent to giving identical plus and minus error margins. +If you omit the minimum (first) date, and just specify +â-DD/MM/YYâ, all messages before the +given date will be selected. If you omit the maximum (second) date, and +specify âDD/MM/YY-â, all messages +after the given date will be selected. If you +specify a single date with no dash (â-â), only messages +sent on the given date will be selected. + +You can add error margins to absolute dates. An error margin is a sign +(+ or -), followed by a digit, followed by one of the units in Table 4.6, âDate unitsâ. As a special case, you can replace the sign +by a â*â character, which is equivalent to giving identical +plus and minus error margins. -Example: To select any messages two weeks around January 15, 2001, -you'd use the following pattern: +Example: To select any messages two weeks around January 15, 2001, you'd +use the following pattern: Limit to messages matching: ~d 15/1/2001*2w - -This type of date is relative to the current date, and may -be specified as: -
+This type of date is relative to the current date, and may be specified +as: +
-offset is specified as a positive number with one of the units from Table 4.6, âDate unitsâ. +offset is specified as a positive number with one +of the units from Table 4.6, âDate unitsâ. Example: to select messages less than 1 month old, you would use Limit to messages matching: ~d <1m - Note+ Note
All dates used when searching are relative to the
-local time zone, so unless you change the setting of your $index_format to include a
-
-Sometimes it is desirable to perform an operation on a group of
-messages all at once rather than one at a time. An example might be
-to save messages to a mailing list to a separate folder, or to
-delete all messages with a given subject. To tag all messages
-matching a pattern, use the
+Sometimes it is desirable to perform an operation on a group of messages
+all at once rather than one at a time. An example might be to save
+messages to a mailing list to a separate folder, or to delete all
+messages with a given subject. To tag all messages matching a pattern,
+use the Once you have tagged the desired messages, you can use the -âtag-prefixâ operator, which is the â;â (semicolon) key by default. -When the âtag-prefixâ operator is used, the next operation will -be applied to all tagged messages if that operation can be used in that -manner. If the $auto_tag -variable is set, the next operation applies to the tagged messages -automatically, without requiring the âtag-prefixâ. -
-In macros or push commands,
-you can use the -A hook is a concept found in many other programs which allows you to -execute arbitrary commands before performing some operation. For example, -you may wish to tailor your configuration based upon which mailbox you are -reading, or to whom you are sending mail. In the Mutt world, a hook -consists of a regular expression or -pattern along with a -configuration option/command. See: +âtag-prefixâ operator, which is the â;â +(semicolon) key by default. When the âtag-prefixâ operator +is used, the next operation will be applied to all +tagged messages if that operation can be used in that manner. If the +$auto_tag variable is set, the next +operation applies to the tagged messages automatically, without +requiring the âtag-prefixâ. +
+In macros or push commands, you can use the
+ +A hook is a concept found in many other programs +which allows you to execute arbitrary commands before performing some +operation. For example, you may wish to tailor your configuration based +upon which mailbox you are reading, or to whom you are sending mail. In +the Mutt world, a hook consists of a regular expression or pattern along with a configuration +option/command. See: -
|