X-Git-Url: http://git.madism.org/?a=blobdiff_plain;ds=sidebyside;f=doc%2Fmanual.sgml.head;h=179aa7dfb05d00259ba8a4f1bbf0464e9bff49a4;hb=7132fe3b1612c153f3638d1f9664ba9eab9063d6;hp=b673677330cc0218aad9ad50a2e18e3efd0ef195;hpb=3ca6b4f1661fc400d74534c0a969ed9375db46d6;p=apps%2Fmadmutt.git diff --git a/doc/manual.sgml.head b/doc/manual.sgml.head index b673677..179aa7d 100644 --- a/doc/manual.sgml.head +++ b/doc/manual.sgml.head @@ -1240,7 +1240,10 @@ For a complete list, see the . -Variable Expansion +Expansion within variables + +

Besides just assign static content to variables, there's plenty of + ways of adding external and more or less dynamic content. Commands' Output @@ -1306,23 +1309,28 @@ set imap_home_namespace = $folder used just like any ordinary configuration or environment variable. -

For example, to view the manual, users can either define three +

For example, to view the manual, users can either define two macros like the following macro generic <F1> "!less -r /path/to/manual" "Show manual" macro pager <F1> "!less -r /path/to/manual" "Show manual" -macro index <F1> "!less -r /path/to/manual" "Show manual"

for -set user_manualcmd = '!less -r /path/to_manual" +set user_manualcmd = "!less -r /path/to_manual" macro generic <F1> "$user_manualcmd<enter>" "Show manual" macro pager <F1> "$user_manualcmd<enter>" "Show manual" macro index <F1> "$user_manualcmd<enter>" "Show manual" + + +

to re-use the command sequence as in: + + +macro index <F2> "$user_manualcmd | grep '\^[ ]\\+~. '" "Show Patterns"

Using this feature, arbitrary sequences can be defined once and @@ -1366,6 +1374,77 @@ unset user_foo

any query or operation (except the noted expansion within other statements) will lead to an error message. + Pre-Defined Variables + +

In order to allow users to share one setup over a number of + different machines without having to change its contents, there's a + number of pre-defined variables. These are prefixed with + Please consult the local copy of your manual for their + values as they may differ from different manual sources. Where + the manual is installed in can be queried (already using such a + variable) by running: + + +muttng -Q muttng_docdir + + +

To extend the example for viewing the manual via self-defined + variables, it can be made more readable and more portable by + changing the real path in: + + +set user_manualcmd = '!less -r /path/to_manual' + + +

to: + + +set user_manualcmd = "!less -r $muttng_docdir/manual.txt" + + +

which works everywhere if a manual is installed. + +

Please note that by the type of quoting, muttng determines when + to expand these values: when it finds double quotes, the value will + be expanded during reading the setup files but when it finds single + quotes, it'll expand it at runtime as needed. + +

For example, the statement + + +folder-hook . "set user_current_folder = $muttng_folder_name" + + +

will be already be translated to the following when reading the + startup files: + + +folder-hook . "set user_current_folder = some_folder" + + +

with +folder-hook . 'set user_current_folder = $muttng_folder_name' + + +

will be executed at runtime because of the single quotes so that + A more practical example is: + + +folder-hook . 'source ~/.mutt/score-$muttng_folder_name' + + +

which can be used to source files containing score commands + depending on the folder the user enters. + Type Conversions

A note about variable's types during conversion: internally @@ -2309,8 +2388,8 @@ message will ever get marked as read or deleted. and the ˜n pattern: -color black yellow "~n 10-" -color red yellow "~n 100-" +color index black yellow "~n 10-" +color index red yellow "~n 100-"

The rules above mark all messages with a score between 10 and 99 with black and yellow, and messages with a score greater or equal @@ -4712,6 +4791,7 @@ of the file ``˜/run2.dat''. ~L EXPR message is either originated or received by EXPR ~l message is addressed to a known mailing list ~m [MIN]-[MAX] message in the range MIN to MAX *) +~M multipart messages ~n [MIN]-[MAX] messages with a score in the range MIN to MAX *) ~N new messages ~O old messages