From: Rocco Rutte Date: Thu, 11 Oct 2007 10:10:49 +0000 (+0200) Subject: Document format string pipes. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=805a8831a7aa8e7ac69fbb12145ba3c31bfb0d0e;p=neomutt Document format string pipes. This is roughly the commit message only. Add a line to UPDATING (mark it as a change rather than a new feature as it may break setups). --- diff --git a/ChangeLog b/ChangeLog index 32b70c6ba..b562657fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-10-11 11:18 +0200 Rocco Rutte (efcd349fc9e0) + + * init.h: Document that $indent_string actually is a format string. + +2007-10-11 11:03 +0200 Rocco Rutte (40f2c0f4c597) + + * ChangeLog, muttlib.c: Do not consider empty pipes for filtering in + format strings. This fixes a crash with $indent_string="|" and + $text_flowed unset. + 2007-09-28 11:06 +0200 Rocco Rutte (709db707bcdf) * curs_lib.c, muttlib.c, protos.h: Make mutt_FormatString()'s string diff --git a/UPDATING b/UPDATING index c8f94fc21..21176c830 100644 --- a/UPDATING +++ b/UPDATING @@ -17,6 +17,7 @@ The keys used are: + $save_history, $history_file (save history across sessions) + $smtp_url (ESMTP relay support) + $crypt_use_pka (use GPGME PKA signature verification) + ! format pipe support: format strings ending in | are filtered 1.5.13 (2006-08-14): diff --git a/doc/manual.xml.head b/doc/manual.xml.head index 60f1827de..103f5aba9 100644 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@ -3277,6 +3277,9 @@ something like unhook send-hook. Format Strings + +Basic usage + Format strings are a general concept you'll find in several locations through the mutt configuration, especially in the @@ -3338,6 +3341,47 @@ expands in all lower case. And if you use a colon (``:''), it will replace all decimal points with underlines. + + + +Filters + + +Any format string ending in a vertical bar (``|'') will be +expanded and piped through the first word in the string, using spaces +as separator. The string returned will be used for display. +If the returned string ends in %, it will be passed through +the formatter a second time. This allows the filter to generate a +replacement format string including % expandos. + + + +All % expandos in a format string are expanded before the script +is called so that: + + + +set status_format="script.sh '%r %f (%L)'|" + + + +will make mutt expand %r, +%f and %L +before calling the script. The example also shows that arguments can be +quoted: the script will receive the expanded string between the single quotes +as the only argument. + + + +A practical example is the mutt_xtitle +script installed in the samples +subdirectory of the mutt documentation: it can be used as filter for +$status_format to set the current +terminal's title, if supported. + + + +