+ sets the _\b$_\br_\be_\bc_\bo_\br_\bd (section 7.4.246 , page 148) variable to the string _\b+_\bs_\be_\bn_\bt_\b__\bo_\bn_\b_
+ and appends the value of the evironment variable $HOSTNAME.
+
+ N\bNo\bot\bte\be:\b: There will be no warning if an environment variable is not defined. The
+ result will of the expansion will then be empty.
+
+ _\b3_\b._\b3_\b._\b3 _\bC_\bo_\bn_\bf_\bi_\bg_\bu_\br_\ba_\bt_\bi_\bo_\bn _\bV_\ba_\br_\bi_\ba_\bb_\bl_\be_\bs
+
+ As for environment variables, the values of all configuration variables as
+ string can be used in the same way, too. For example,
+
+ set imap_home_namespace = $folder
+
+ would set the value of _\b$_\bi_\bm_\ba_\bp_\b__\bh_\bo_\bm_\be_\b__\bn_\ba_\bm_\be_\bs_\bp_\ba_\bc_\be (section 7.4.101 , page 113) to
+ the value to which _\b$_\bf_\bo_\bl_\bd_\be_\br (section 7.4.70 , page 105) is _\bc_\bu_\br_\br_\be_\bn_\bt_\bl_\by set to.
+
+ N\bNo\bot\bte\be:\b: There're no logical links established in such cases so that the the value
+ for _\b$_\bi_\bm_\ba_\bp_\b__\bh_\bo_\bm_\be_\b__\bn_\ba_\bm_\be_\bs_\bp_\ba_\bc_\be (section 7.4.101 , page 113) won't change even if
+ _\b$_\bf_\bo_\bl_\bd_\be_\br (section 7.4.70 , page 105) gets changed.
+
+ N\bNo\bot\bte\be:\b: There will be no warning if a configuration variable is not defined or is
+ empty. The result will of the expansion will then be empty.
+
+ The Mutt Next Generation E-Mail Client 24
+
+ _\b3_\b._\b3_\b._\b4 _\bS_\be_\bl_\bf_\b-_\bD_\be_\bf_\bi_\bn_\be_\bd _\bV_\ba_\br_\bi_\ba_\bb_\bl_\be_\bs
+
+ Mutt-ng flexibly allows users to define their own variables. To avoid conflicts
+ with the standard set and to prevent misleading error messages, there's a
+ reserved namespace for them: all user-defined variables must be prefixed with
+ user_ and can be used just like any ordinary configuration or environment vari-
+ able.
+
+ 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"
+
+ for generic, pager and index. The alternative is to define a custom variable
+ like so:
+
+ 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 recalled and
+ reused where necessary. More advanced scenarios could include to save a vari-
+ able's value at the beginning of macro sequence and restore it at end.
+
+ When the variable is first defined, the first value it gets assigned is also
+ the initial value to which it can be reset using the reset command.
+
+ The complete removal is done via the unset keyword.
+
+ After the following sequence:
+
+ set user_foo = 42
+ set user_foo = 666
+
+ the variable $user_foo has a current value of 666 and an initial of 42. The
+ query
+
+ set ?user_foo
+
+ The Mutt Next Generation E-Mail Client 25
+
+ will show 666. After doing the reset via
+
+ reset user_foo
+
+ a following query will give 42 as the result. After unsetting it via
+
+ unset user_foo
+
+ any query or operation (except the noted expansion within other statements)
+ will lead to an error message.
+
+ _\b3_\b._\b3_\b._\b5 _\bP_\br_\be_\b-_\bD_\be_\bf_\bi_\bn_\be_\bd _\bV_\ba_\br_\bi_\ba_\bb_\bl_\be_\bs
+
+ 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 vari-
+ ables. These are prefixed with muttng_ and are read-only, i.e. they cannot be
+ set, unset or reset. The reference chapter lists all available variables.
+
+ _\bP_\bl_\be_\ba_\bs_\be _\bc_\bo_\bn_\bs_\bu_\bl_\bt _\bt_\bh_\be _\bl_\bo_\bc_\ba_\bl _\bc_\bo_\bp_\by _\bo_\bf _\by_\bo_\bu_\br _\bm_\ba_\bn_\bu_\ba_\bl _\bf_\bo_\br _\bt_\bh_\be_\bi_\br _\bv_\ba_\bl_\bu_\be_\bs _\ba_\bs _\bt_\bh_\be_\by _\bm_\ba_\by _\bd_\bi_\bf_\b-
+ _\bf_\be_\br _\bf_\br_\bo_\bm _\bd_\bi_\bf_\bf_\be_\br_\be_\bn_\bt _\bm_\ba_\bn_\bu_\ba_\bl _\bs_\bo_\bu_\br_\bc_\be_\bs_\b. 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"
+
+ The Mutt Next Generation E-Mail Client 26
+
+ will be already be translated to the following when reading the startup files:
+
+ folder-hook . "set user_current_folder = some_folder"
+
+ with some_folder being the name of the first folder muttng opens. On the con-
+ trary,
+
+ folder-hook . 'set user_current_folder = $muttng_folder_name'
+
+ will be executed at runtime because of the single quotes so that user_cur-
+ rent_folder will always have the value of the currently opened folder.
+
+ 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.
+
+ _\b3_\b._\b3_\b._\b6 _\bT_\by_\bp_\be _\bC_\bo_\bn_\bv_\be_\br_\bs_\bi_\bo_\bn_\bs
+
+ A note about variable's types during conversion: internally values are stored
+ in internal types but for any dump/query or set operation they're converted to
+ and from string. That means that there's no need to worry about types when ref-
+ erencing any variable. As an example, the following can be used without harm
+ (besides makeing muttng very likely behave strange):
+
+ set read_inc = 100
+ set folder = $read_inc
+ set read_inc = $folder
+ set user_magic_number = 42
+ set folder = $user_magic_number