Changes between Version 1 and Version 2 of MuttGuide/Syntax


Ignore:
Timestamp:
Dec 16, 2012 3:31:11 PM (5 years ago)
Author:
erAck
Comment:

use trac wiki markup to make any sense of this page

Legend:

Unmodified
Added
Removed
Modified
  • MuttGuide/Syntax

    v1 v2  
    11== run-time configuration file ==
    22
    3 Mutt reads its configuration by default 1st from a system-wide config-file ("/etc/<nowiki>Muttrc</nowiki>"),
     3Mutt reads its configuration by default 1st from a system-wide config-file ("/etc/Muttrc"),
    44which normally controls system settings and provides viable default personal settings for all users,
    55then it reads the personal config file ("~/.muttrc" or "~/.mutt/muttrc").
     
    1818Note: the cmds given here are just for configuration. The interactive actions (commands) which you can perform on eMails are [run-time] ''function''s.
    1919
     20
    2021'''General, internal:'''
    21 ;<tt>set var=value</tt>: this sets mutt-variables, of which there are a lot. See the manual.txt for complete reference (or ManualVarNames/List).\
    22     As you proceed throughout the MuttGuide & MuttWiki you'll encounter many of them already.\
    23     There is also "toggle var" for yes/no values, and you can specify "ask-yes" or "ask-no" to be prompted each time with a given default answer.\
    24     You can also use "unset" or "set var" or "set ''no''var" without a value of "yes/no" for boolean/ binary vars as a shortcut.\
    25     However, those makes no sense for int or string vars: mutt just echos the current value.\
    26 <br>Note: the configuration variables for a given functionality are only available when you have it enabled in your binary.\
    27     Otherwise you'll get "''unknown variable''". Rebuild your binary and enable what you need per /Setup.
    2822
    29 ;<tt>source filename</tt>: when you accumulate a big personal config-file (or maintain the system-wide one),\
    30     it's recommended to split the different configs up into separate files, which then can be loaded from the main config-file with this cmd.\
    31     <br>\
    32     In an active mutt you can (re-)execute mutt-config cmds via ":", so this way you can reload the whole config when you specify the main rc-file.\
    33     <br>\
    34     If the filename argument ends with "|", then the content is not evaluated literally, but executed as system SHELL-cmd,\
    35     and the output is then taken as muttrc cmds, so you can dynamically change config at run-time on complex/ external conditions.
     23{{{set var=value}}}
     24  This sets mutt-variables, of which there are a lot. See the manual.txt for complete reference (or ManualVarNames/List).
     25  As you proceed throughout the MuttGuide & MuttWiki you'll encounter many of them already.
     26  There is also "toggle var" for yes/no values, and you can specify "ask-yes" or "ask-no" to be prompted each time with a given default answer.
     27  You can also use "unset" or "set var" or "set ''no''var" without a value of "yes/no" for boolean/ binary vars as a shortcut.
     28  However, those makes no sense for int or string vars: mutt just echos the current value.
     29  [[BR]]Note: the configuration variables for a given functionality are only available when you have it enabled in your binary.
     30  Otherwise you'll get "''unknown variable''". Rebuild your binary and enable what you need per /Setup.
    3631
    37 ;<tt>mailboxes folder ...</tt>: define what mutt should treat as "incoming mailboxes" to check for new mail.
    38 ;<tt>my_hdr string</tt>: define standard or user-defined headers to be overwritten/ added to outgoing eMails.
     32{{{source filename}}}
     33  When you accumulate a big personal config-file (or maintain the system-wide one),
     34  it's recommended to split the different configs up into separate files, which then can be loaded from the main config-file with this cmd.
     35  [[BR]]
     36  In an active mutt you can (re-)execute mutt-config cmds via ":", so this way you can reload the whole config when you specify the main rc-file.
     37  [[BR]]
     38  If the filename argument ends with "|", then the content is not evaluated literally, but executed as system SHELL-cmd,
     39  and the output is then taken as muttrc cmds, so you can dynamically change config at run-time on complex/ external conditions.
     40
     41{{{mailboxes folder ...}}}
     42  Define what mutt should treat as "incoming mailboxes" to check for new mail.
     43{{{my_hdr string}}}
     44  Define standard or user-defined headers to be overwritten/ added to outgoing eMails.
     45
    3946
    4047'''Identities:'''
    41 ;<tt>alias short eMail-adr , ...</tt>: define a shortcut for a long eMail-adr, comma separated.
    42 ;<tt>alternates regexp ...</tt>: specify addresses by which you shall be known to mutt when checking headers for managing different addresses on same host.
    43 ;<tt>list regexp ...</tt>,<br><tt>subscribe regexp ...</tt>: specify addresses to be recognized as mailing-lists, where your personal addr doesn't appear as recipient.
     48
     49{{{alias short eMail-adr , ...}}}
     50  Define a shortcut for a long eMail-adr, comma separated.
     51{{{alternates regexp ...}}}
     52  Specify addresses by which you shall be known to mutt when checking headers for managing different addresses on same host.
     53{{{list regexp ...}}}[[BR]]
     54{{{subscribe regexp ...}}}
     55  Specify addresses to be recognized as mailing-lists, where your personal addr doesn't appear as recipient.
     56
     57
    4458'''Appearance:'''
    45 ;<tt>color object foreground background [pattern]</tt>: colorize elements for highlighting items.
    46 ;<tt>[un]ignore regexp ...</tt>: trim display of headers when "weeding" them, i.e. show only desired headers.
    47 ;<tt>hdr_order regexp ...</tt>: show headers in the specified space-separated list order.
     59
     60{{{color object foreground background [pattern]}}}
     61  Colorize elements for highlighting items.
     62{{{[un]ignore regexp ...}}}
     63  Trim display of headers when "weeding" them, i.e. show only desired headers.
     64{{{hdr_order regexp ...}}}
     65  Show headers in the specified space-separated list order.
     66
     67
    4868'''Interaction:'''
    49 ;<tt>bind mode key function</tt>: change key-bindings to invoke a single function later on demand.
    50 ;<tt>macro mode key sequence [description]</tt>: bind a series of key-strikes or functions to a single key to be invoked later on demand.
     69
     70{{{bind mode key function}}}
     71  Change key-bindings to invoke a single function later on demand.
     72{{{macro mode key sequence [description]}}}:
     73  Bind a series of key-strikes or functions to a single key to be invoked later on demand.
     74
     75
    5176'''Automation:'''
    52 ;<tt>exec function function...</tt>: execute (series of) function(s) right now(!), but no input data for dialogs allowed.
    53 ;<tt>push sequence</tt>: execute sequence of keystrikes right now(!), including input to dialogs and functions.
     77
     78{{{exec function function...}}}
     79  Execute (series of) function(s) right now(!), but no input data for dialogs allowed.
     80{{{push sequence}}}
     81  Execute sequence of keystrikes right now(!), including input to dialogs and functions.
    5482
    5583'''Note''': you must put literal "<>" around function names to discern them from a series of keys,
    56 both for "macro" & "push" (like "<tt>push <function1><function2>...</tt>").
    57 Use "<tt>\<</tt>" to pass a literal "<tt><></tt>" char.
    58 <br>
     84both for "macro" & "push" (like "{{{push <function1><function2>...}}}").
     85Use "{{{\<}}}" to pass a literal "{{{<}}}" char.
     86[[BR]]
    5987"exec" & "bind" go without those literal "<>".
    6088
     
    6391=== Arguments: regex vs. strings ===
    6492Some config cmds as well as user interface (UI) functions take either "[mutt-]pattern" or "regexp" as argument.
    65 * <tt>regexp</tt> are extended regular expressions like used with "sed, grep, awk" and the like\
    66     ("bla.*fasel" or "^bla$": string matches ''anywhere'' [wildcards surrounding assumed], begin/ end must be specified with "^$").\
    67     See "man -s 5 regex" for details and the manuals section on "Regular Expressions".
    68 * <tt>mutt-pattern</tt> are regexp with mutt-specific modifiers preceeding them, like "~f eMail.*@.*adr$".
     93
     94{{{regexp}}} are extended regular expressions like used with "sed, grep, awk" and the like.
     95  {{{"bla.*fasel"}}} or {{{"^bla$"}}}: string matches ''anywhere'' [wildcards surrounding assumed], begin/ end must be specified with {{{"^$"}}}.
     96  See "man -s 5 regex" for details and the manuals section on "Regular Expressions".
     97{{{mutt-pattern}}} are regexp with mutt-specific modifiers preceeding them, like {{{"~f eMail.*@.*adr$"}}}.
    6998
    7099=== Quoting levels ===
     
    77106If a char quoted on a lower level is also special on a higher level,
    78107then the quoted char '''plus''' the quoting \ must be quoted (i.e. \ is '''mega-special'''):
    79  | -> \| -> \\\|
    80  ch   reg   pat
     108 {{{| -> \| -> \\\|}}}
    81109
    82110As you can see in the lists, not all chars are special on ''every'' level,
     
    84112
    85113Characters to quote:
    86 * regexp (see "man -a regex" for their meaning):
    87  (|).*+?[]{}\^$
    88 * mutt-pattern (see "manual.txt" for "~" patterns and meaning of special chars:
    89  (|)!~\"' and WSPC
    90 * mutt-cmd (muttrc string, see manual.txt and below):
    91  ;#`\'"$ and WSPC
    92114
    93 * conflicts between lvls requiring at least double-quote (list includes WSPC char == space + tab!):
    94  (|)\$"' and WSPC
     115regexp (see "man -a regex" for their meaning):
     116 {{{(|).*+?[]{}\^$}}}
     117mutt-pattern (see "manual.txt" for "~" patterns and meaning of special chars:
     118 {{{(|)!~\"' and WSPC}}}
     119mutt-cmd (muttrc string, see manual.txt and below):
     120 {{{;#`\'"$ and WSPC}}}
     121
     122conflicts between lvls requiring at least double-quote (list includes WSPC char == space + tab!):
     123 {{{(|)\$"' and WSPC}}}
    95124
    96125It seems only \ would need "native" triple-quoting, but in combination with complex nesting of mutt-cmds (macros, push, hooks),
     
    98127
    99128mutt-cmd meaning:
    100 ;''';''': cmd separator to put multiple cmds on a single line, normally each cmd ends with newline.
    101 ;<tt># comment</tt>: anything between "#" and an '''unquoted''' newline is ignored.
    102 ;<tt>$</tt>: the following legal shell-variable name is substituted (e.g. "$EDITOR").
    103 ;WSPC: (WhiteSpace is "blank" or TAB character) WSPC characters separate arguments from cmds or patterns from each other, too!
    104 ;<tt>` `</tt>: shell-cmd output substitution: anything between `` is executed in a subshell, the 1st output-line is taken as value to be used. The string is also ''quoted''.
     129
     130{{{;}}}
     131  cmd separator to put multiple cmds on a single line, normally each cmd ends with newline.
     132{{{# comment}}}
     133  anything between "#" and an '''unquoted''' newline is ignored.
     134{{{$}}}
     135  the following legal shell-variable name is substituted (e.g. "$EDITOR").
     136{{{WSPC}}}
     137  (!WhiteSpace is "blank" or TAB character) WSPC characters separate arguments from cmds or patterns from each other, too!
     138{{{` `}}}
     139  shell-cmd output substitution: anything between `` is executed in a subshell, the 1st output-line is taken as value to be used. The string is also ''quoted''.
    105140
    106141'''Quoting''' plain strings on mutt-cmd level and mutt-pattern:
    107 ;<tt>\c</tt>: quotes the following char "c". In the special case "\" is the '''last char (no trailing white space)''' on a line,\
    108       it quotes the newline, which means the line continues on the next line.
    109 ;<tt>' '</tt>: every char between the ' ' is quoted except "\", which quotes itself.
    110 ;<tt>" "</tt>: every char except "\", "``" & "$" is quoted, this means shell-var & -cmd substitution still works unless '\'-quoted.
     142
     143{{{\c}}}
     144  quotes the following char "c". In the special case "\" is the '''last char (no trailing white space)''' on a line,
     145  it quotes the newline, which means the line continues on the next line.
     146{{{' '}}}
     147  every char between the ' ' is quoted except "\", which quotes itself.
     148{{{" "}}}
     149  every char except "\", "``" & "$" is quoted, this means shell-var & -cmd substitution still works unless '\'-quoted.
    111150Note: newline continuation works even for comments "#",
    112151contrary to the usual behaviour in other scripting languages when you combine both.