Mutt: redraw now also updates index_format.

master
Pierre Neidhardt 2013-11-25 19:47:10 +01:00
parent f1745c0a20
commit 7187f0362a
1 changed files with 8 additions and 0 deletions

View File

@ -181,11 +181,19 @@ set user_agent = yes
## See 'man 3 strftime' and 'man 3 printf'.
# set index_format="%?M?_%M_ ?%Z %2C %.13d (%-68.68F) %-68.68s %?M?_%M_&(%c/%l?"
set date_format="%y-%m-%d %T"
folder-hook .*[sS]ent.* 'set my_col_from = `echo $((30 * ($(tput cols)-35-24) / 100))`; set my_col_subject = `echo $((70 * ($(tput cols)-35-24) / 100))`; set index_format="%2C | %Z [%d] %-$my_col_from.${my_col_from}t (%-4.4c) %-$my_col_subject.${my_col_subject}s"'
folder-hook ! .*[sS]ent.* 'set my_col_from = `echo $((30 * ($(tput cols)-35-24) / 100))`; set my_col_subject = `echo $((70 * ($(tput cols)-35-24) / 100))`; set index_format="%2C | %Z [%d] %-$my_col_from.${my_col_from}F (%-4.4c) %-$my_col_subject.${my_col_subject}s"'
## Original status_format, with dash line removed.
set status_format="-%r-Mutt: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?] (%s/%S) %> (%P) "
## This will redraw screen while refreshing the new cols value. Since there
## seems to be no way to check what folder is the current, this will not behave
## like the above hooks and will set the index_format correctly for non Sent
## folders only.
macro pager \CL '<enter-command>set my_col_from = `echo $((30 * ($(tput cols)-35-24) / 100))`; set my_col_subject = `echo $((70 * ($(tput cols)-35-24) / 100))`; set index_format="%2C | %Z [%d] %-$my_col_from.${my_col_from}F (%-4.4c) %-$my_col_subject.${my_col_subject}s"<enter><redraw-screen>'
## Colors
# source "/usr/share/doc/mutt/samples/colors.default"
# source "/usr/share/doc/mutt/samples/colors.linux"