Changeset 5234:c15eeb44f139
- Timestamp:
- 2007-10-11 03:10:49 (15 months ago)
- Author:
- Rocco Rutte <pdmef@…>
- Branch:
- HEAD
- Message:
-
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).
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r5232
|
r5234
|
|
| | 1 | 2007-10-11 11:18 +0200 Rocco Rutte <pdmef@gmx.net> (efcd349fc9e0) |
| | 2 | |
| | 3 | * init.h: Document that $indent_string actually is a format string. |
| | 4 | |
| | 5 | 2007-10-11 11:03 +0200 Rocco Rutte <pdmef@gmx.net> (40f2c0f4c597) |
| | 6 | |
| | 7 | * ChangeLog, muttlib.c: Do not consider empty pipes for filtering in |
| | 8 | format strings. This fixes a crash with $indent_string="|" and |
| | 9 | $text_flowed unset. |
| | 10 | |
| 1 | 11 | 2007-09-28 11:06 +0200 Rocco Rutte <pdmef@gmx.net> (709db707bcdf) |
| 2 | 12 | |
-
|
r5149
|
r5234
|
|
| 18 | 18 | + $smtp_url (ESMTP relay support) |
| 19 | 19 | + $crypt_use_pka (use GPGME PKA signature verification) |
| | 20 | ! format pipe support: format strings ending in | are filtered |
| 20 | 21 | |
| 21 | 22 | 1.5.13 (2006-08-14): |
-
|
r5207
|
r5234
|
|
| 3278 | 3278 | <title>Format Strings</title> |
| 3279 | 3279 | |
| | 3280 | <sect2> |
| | 3281 | <title>Basic usage</title> |
| | 3282 | |
| 3280 | 3283 | <para> |
| 3281 | 3284 | Format strings are a general concept you'll find in several locations |
| … |
… |
|
| 3338 | 3341 | replace all decimal points with underlines. |
| 3339 | 3342 | </para> |
| | 3343 | |
| | 3344 | </sect2> |
| | 3345 | |
| | 3346 | <sect2> |
| | 3347 | <title>Filters</title> |
| | 3348 | |
| | 3349 | <para> |
| | 3350 | Any format string ending in a vertical bar (``|'') will be |
| | 3351 | expanded and piped through the first word in the string, using spaces |
| | 3352 | as separator. The string returned will be used for display. |
| | 3353 | If the returned string ends in %, it will be passed through |
| | 3354 | the formatter a second time. This allows the filter to generate a |
| | 3355 | replacement format string including % expandos. |
| | 3356 | </para> |
| | 3357 | |
| | 3358 | <para> |
| | 3359 | All % expandos in a format string are expanded before the script |
| | 3360 | is called so that: |
| | 3361 | </para> |
| | 3362 | |
| | 3363 | <screen> |
| | 3364 | set status_format="script.sh '%r %f (%L)'|" |
| | 3365 | </screen> |
| | 3366 | |
| | 3367 | <para> |
| | 3368 | will make mutt expand <literal>%r</literal>, |
| | 3369 | <literal>%f</literal> and <literal>%L</literal> |
| | 3370 | before calling the script. The example also shows that arguments can be |
| | 3371 | quoted: the script will receive the expanded string between the single quotes |
| | 3372 | as the only argument. |
| | 3373 | </para> |
| | 3374 | |
| | 3375 | <para> |
| | 3376 | A practical example is the <literal>mutt_xtitle</literal> |
| | 3377 | script installed in the <literal>samples</literal> |
| | 3378 | subdirectory of the mutt documentation: it can be used as filter for |
| | 3379 | <literal>$status_format</literal> to set the current |
| | 3380 | terminal's title, if supported. |
| | 3381 | </para> |
| | 3382 | |
| | 3383 | </sect2> |
| 3340 | 3384 | |
| 3341 | 3385 | </sect1> |