From: Richard Russon Date: Mon, 4 Apr 2016 15:24:59 +0000 (+0100) Subject: merge: sidebar - overview of mailboxes X-Git-Tag: neomutt-20160404~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=341e6cae6e53e9c6f43098ea87f7ecd65eec4967;p=neomutt merge: sidebar - overview of mailboxes * sidebar 1.5.24-20151111 * bugfix: missing includes * bugfix: compose mode * bugfix: delim null wide * bugfix: fixed header wrapping * feature: new only * feature: prev/next wraparound * feature: whitelist * feature: working utf8 * feature: dotpathsep * feature: refresh * indent: our functions * indent: sync to surroundings * fix: drop unused * fix: drop DrawFullLine * tidy: sidebar * tidy: our functions * tidy: other code * sort: sidebar functions * tidy: rename functions * tidy: add comments * build: conditional compilation * fix brain-damaged function: mh_buffy_update * fix refresh -- time overflowed short * feature: add function sidebar-toggle-visible * drop old sort * rename: msgcount to msg_count to match other sidebar variables * rename: vars * add: BUFFY sorting * add: colours for divider and highlights * refactor: split out initialise * add: BUFFY notifications * refactor: visibility check * distinguish between what's highlighted and what's actually open * revamp sorting * split up sb_draw * expandos for deleted, limited, tagged * feature: separate sidebar indicator colour * feature: separate colour for spoolfile * rename: lots of config for consistency with mutt * handle unmailboxes * safely * split out sidebar wipe * refresh sidebar after timeout * add docs * add ident to PATCHES --- 341e6cae6e53e9c6f43098ea87f7ecd65eec4967 diff --cc PATCHES index 69b775b5c,37a410326..0beb40ec5 --- a/PATCHES +++ b/PATCHES @@@ -1,7 -1,1 +1,8 @@@ +patch-quasi-delete-neo-UNKNOWN +patch-progress-neo-UNKNOWN +patch-status-color-neo-UNKNOWN +patch-index-color-neo-UNKNOWN +patch-nested-if-neo-UNKNOWN +patch-cond-date-neo-UNKNOWN +patch-tls-sni-neo-UNKNOWN + patch-sidebar-neo-UNKNOWN diff --cc color.c index 9759288f1,b542ffdd2..1893b4997 --- a/color.c +++ b/color.c @@@ -97,16 -93,15 +97,24 @@@ static const struct mapping_t Fields[] { "bold", MT_COLOR_BOLD }, { "underline", MT_COLOR_UNDERLINE }, { "index", MT_COLOR_INDEX }, + { "progress", MT_COLOR_PROGRESS }, + { "index_author", MT_COLOR_INDEX_AUTHOR }, + { "index_collapsed", MT_COLOR_INDEX_COLLAPSED }, + { "index_date", MT_COLOR_INDEX_DATE }, + { "index_flags", MT_COLOR_INDEX_FLAGS }, + { "index_label", MT_COLOR_INDEX_LABEL }, + { "index_number", MT_COLOR_INDEX_NUMBER }, + { "index_size", MT_COLOR_INDEX_SIZE }, + { "index_subject", MT_COLOR_INDEX_SUBJECT }, { "prompt", MT_COLOR_PROMPT }, + #ifdef USE_SIDEBAR + { "sidebar_divider", MT_COLOR_DIVIDER }, + { "sidebar_flagged", MT_COLOR_FLAGGED }, + { "sidebar_highlight",MT_COLOR_HIGHLIGHT }, + { "sidebar_indicator",MT_COLOR_SB_INDICATOR }, + { "sidebar_new", MT_COLOR_NEW }, + { "sidebar_spoolfile",MT_COLOR_SB_SPOOLFILE }, + #endif { NULL, 0 } }; diff --cc curs_main.c index a815b9c72,04fcffa16..efbac728a --- a/curs_main.c +++ b/curs_main.c @@@ -738,10 -653,21 +761,21 @@@ int mutt_index_menu (void if (menu->redraw & REDRAW_STATUS) { + #ifdef USE_SIDEBAR + /* Temporarily lie about the sidebar width */ + short sw = SidebarWidth; + SidebarWidth = 0; + #endif menu_status_line (buf, sizeof (buf), menu, NONULL (Status)); + #ifdef USE_SIDEBAR + SidebarWidth = sw; /* Restore the sidebar width */ + #endif move (option (OPTSTATUSONTOP) ? 0 : LINES-2, 0); SETCOLOR (MT_COLOR_STATUS); + #ifdef USE_SIDEBAR + sb_set_buffystats (Context); + #endif - mutt_paddstr (COLS, buf); + mutt_draw_statusline (COLS, buf); NORMAL_COLOR; menu->redraw &= ~REDRAW_STATUS; if (option(OPTTSENABLED) && TSSupported) @@@ -1258,20 -1187,9 +1295,23 @@@ menu->redraw = REDRAW_FULL; break; + case OP_MAIN_QUASI_DELETE: + if (tag) { + for (j = 0; j < Context->vcount; j++) { + if (Context->hdrs[Context->v2r[j]]->tagged) { + Context->hdrs[Context->v2r[j]]->quasi_deleted = TRUE; + Context->changed = TRUE; + } + } + } else { + CURHDR->quasi_deleted = TRUE; + Context->changed = 1; + } + break; + + #ifdef USE_SIDEBAR + case OP_SIDEBAR_OPEN: + #endif case OP_MAIN_CHANGE_FOLDER: case OP_MAIN_NEXT_UNREAD_MAILBOX: diff --cc doc/manual.xml.head index c76096dc5,15bcdece7..6f9c4304a --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@@ -8141,1404 -8698,469 +8758,1867 @@@ please have a look at the mixmaster doc + + Quasi-Delete Patch + Mark emails that should be hidden, but not deleted + + + Patch + + + To check if Mutt supports Quasi-Delete, look for + patch-quasi-delete in the mutt version. + See: . + + + + Dependencies: + mutt-1.5.24 + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The quasi-delete function marks an email that should be + hidden from the index, but NOT deleted. + + + + On its own, this patch isn't very useful. It forms a useful part of + the notmuch plugin. + + + + + + + Functions + + Quasi-Delete Functions + + + + Menus + Default Key + Function + Description + + + + + index,pager + (none) + <quasi-delete> + delete from mutt, don't touch on disk + + + +
+
+ + + + + Muttrc + +# Example Mutt config file for the 'quasi-delete' feature. + +# The 'quasi-delete' function marks an email that should be hidden +# from the index, but NOT deleted. +bind index,pager Q quasi-delete + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + notmuch patch + + + + + Known Bugs + None + + + + Credits + + Karel Zak kzak@redhat.com + Richard Russon rich@flatcap.org + + +
+ + + Progress Bar Patch + Show a visual progress bar on slow operations + + + Patch + + + To check if Mutt supports Progress Bar, look for + patch-progress in the mutt version. + See: . + + + + Dependencies: + mutt-1.5.24 + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The progress patch shows a visual progress bar on slow + tasks, such as indexing a large folder over the net. + + + + + + + Colors + + Progress Colors + + + + Name + Default Color + Description + + + + + progress + default + Visual progress bar + + + +
+
+ + + + + Muttrc + +# Example Mutt config file for the 'progress' patch. + +# The 'progress' patch provides clear visual feedback for +# slow tasks, such as indexing a large folder over the net. + +# Set the color of the progress bar +# White text on a red background +color progress white red + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + Color command + + + + + Known Bugs + None + + + + Credits + + Rocco Rutte pdmef@gmx.net + Vincent Lefevre vincent@vinc17.org + Stefan Kuhn wuodan@hispeed.ch + Karel Zak kzak@redhat.com + Richard Russon rich@flatcap.org + + +
+ + + Status Color Patch + Custom rules for theming the status bar + + + Patch + + + To check if Mutt supports Status Color, look for + patch-status-color in the mutt version. + See: . + + + + Dependencies: + mutt-1.5.24 + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The status-color patch allows you to theme different + parts of the status bar (also when it's used by the index). + + + + Unlike normal color commands, color status can now + take up to 2 extra parameters (regex, num). + + + + + + + Commands + + color + + + + + foreground + + + background + + + + regex + + + + num + + + + + + + With zero parameters, Mutt will set the default color for the entire + status bar. + + + + With one parameter, Mutt will only color the parts matching the + regex. + + + + With two parameters, Mutt will only color the num'th sub-match of + the regex. + + + + + Colors + + + Status Colors + + + + Name + Default Color + Description + + + + + status + reverse + Status bar + + + +
+
+ + + + + Muttrc + +# Example Mutt config file for the 'status-color' patch. + +# The 'status-color' patch allows you to theme different parts of +# the status bar (also when it's used by the index). + +# For the examples below, set some defaults +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)---' +set index_format='%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s' +set sort=threads +set sort_aux=last-date-received + +# 'status color' can take up to 2 extra parameters + +# color status foreground background [ regex [ num ]] + +# 0 extra parameters +# Set the default color for the entire status line +color status blue white + +# 1 extra parameter +# Set the color for a matching pattern +# color status foreground background regexp + +# Highlight New, Deleted, or Flagged emails +color status brightred white '(New|Del|Flag):[0-9]+' + +# Highlight mailbox ordering if it's different from the default +# First, highlight anything (*/*) +color status brightred default '\([^)]+/[^)]+\)' + +# Then override the color for one specfic case +color status default default '\(threads/last-date-received\)' + +# 2 extra parameters +# Set the color for the nth submatch of a pattern +# color status foreground background regexp num + +# Highlight the contents of the []s but not the [] themselves +color status red default '\[([^]]+)\]' 1 + +# The '1' refers to the first regex submatch, which is the inner +# part in ()s + +# Highlight the mailbox +color status brightwhite default 'Mutt: ([^ ]+)' 1 + +# Search for 'Mutt: ' but only highlight what comes after it + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + Compile-Time Features + Regular Expressions + Patterns + index-color patch + Color command + + + + + Known Bugs + None + + + + Credits + + David Sterba dsterba@suse.cz + Thomas Glanzmann thomas@glanzmann.de + Kirill A. Shutemov kirill@shutemov.name + Richard Russon rich@flatcap.org + + +
+ + + Index Color Patch + Custom rules for theming the email index + + + Patch + + + To check if Mutt supports Index Color, look for + patch-index-color in the mutt version. + See: . + + + + Dependencies: + mutt-1.5.24 + status-color patch + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The index-color patch allows you to specify colors for + individual parts of the email index. e.g. Subject, Author, Flags. + + + + First choose which part of the index you'd like to color. + Then, if needed, pick a pattern to match. + + + + Note: The pattern does not have to refer to the object you wish to + color. e.g. + + + +color index_author red default "~smutt" + + + + The author appears red when the subject (~s) contains mutt. + + + + + + + Colors + + + All the colors default to default, i.e. unset. + + + + The index objects can be themed using the color command. + Some objects require a pattern. + + + +color index-object foreground background +color index-object foreground background pattern + + + + Index Colors + + + + Object + Pattern + Highlights + + + + + index + yes + Entire index line + + + index_author + yes + Author name, %A %a %F %L %n + + + index_collapsed + no + Number of messages in a collapsed thread, %M + + + index_date + no + Date field + + + index_flags + yes + Message flags, %S %Z + + + index_label + no + Message label, %y %Y + + + index_number + no + Message number, %C + + + index_size + no + Message size, %c %l + + + index_subject + yes + Subject, %s + + + +
+
+ + + + + Muttrc + +# Example Mutt config file for the 'index-color' feature. + +# Entire index line +color index white black '.*' + +# Author name, %A %a %F %L %n + +# Give the author column a dark grey background +color index_author default color234 '.*' + +# Highlight a particular from (~f) +color index_author brightyellow color234 '~fRay Charles' + +# Message flags, %S %Z +# Highlight the flags for flagged (~F) emails +color index_flags default red '~F' + +# Subject, %s +# Look for a particular subject (~s) +color index_subject brightcyan default '~s\(closes #[0-9]+\)' + +# Number of messages in a collapsed thread, %M +color index_collapsed default brightblue + +# Date field +color index_date green default + +# Message label, %y %Y +color index_label default brightgreen + +# Message number, %C +color index_number red default + +# Message size, %c %l +color index_size cyan default + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + Regular Expressions + Patterns + $index_format + Color command + Status-Color patch + Keywords patch + + + + + Known Bugs + None + + + + Credits + + Christian Aichinger Greek0@gmx.net + Christoph Myon Berg myon@debian.org + Elimar Riesebieter riesebie@lxtec.de + Eric Davis edavis@insanum.com + Vladimir Marek Vladimir.Marek@oracle.com + Richard Russon rich@flatcap.org + + +
+ + + Nested If Patch + Allow complex nested conditions in format strings + + + Patch + + + To check if Mutt supports Nested If, look for + patch-nested-if in the mutt version. + See: . + + + + Dependencies: + mutt-1.5.24 + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + Mutt's format strings can contain embedded if-then-else conditions. + They are of the form: + + + +%?VAR?TRUE&FALSE? + + + + If the variable VAR has a value greater than zero, + print the TRUE string, otherwise print the + FALSE string. + + + + e.g. %?S?Size: %S&Empty? + + + Which can be read as: + + + if (%S > 0) { + print "Size: %S" + } else { + print "Empty" + } + + + + These conditions are useful, but in Mutt they cannot be nested + within one another. This patch uses the notation + %<VAR?TRUE&FALSE> and allows them to be nested. + + + + The %<...> notation was used to format the + current local time. but that's not really very useful since mutt + has no means of refreshing the screen periodically. + + + + A simple nested condition might be: + (Some whitespace has been introduced for clarity) + + + + %<x? %<y? XY & X > & %<y? Y & NONE > > Conditions + %<y? XY & X > x>0 + XY x>0,y>0 + X x>0,y=0 + + + + %<x? %<y? XY & X > & %<y? Y & NONE > > Conditions + %<y? Y & NONE > x=0 + Y x=0,y>0 + NONE x=0,y=0 + + + Equivalent to: + + + if (x > 0) { + if (y > 0) { + print 'XY' + } else { + print 'X' + } + } else { + if (y > 0) { + print 'Y' + } else { + print 'NONE' + } + } + + + Examples: + + +set index_format='%4C %Z %{%b %d} %-25.25n %s%> %<M?%M Msgs &%<l?%l Lines&%c Bytes>>' + + + + if a thread is folded + display the number of messages (%M) + else if we know how many lines in the message + display lines in message (%l) + else + display the size of the message in bytes (%c) + + + +set index_format='%4C %Z %{%b %d} %-25.25n %<M?[%M] %s&%s%* %<l?%l&%c>>' + + + + if a thread is folded + display the number of messages (%M) + display the subject (%s) + else if we know how many lines in the message + display lines in message (%l) + else + display the size of the message in bytes (%c) + + + + + + Variables + The nested-if patch doesn't have any config of its own. + It modifies the behavior of the format strings. + + + + + + Muttrc + +# Example Mutt config file for the 'nested-if' feature. + +# This patch uses the format: '%<VAR?TRUE&FALSE>' for conditional +# format strings that can be nested. + +# Example 1 +# if a thread is folded +# display the number of messages (%M) +# else if we know how many lines in the message +# display lines in message (%l) +# else display the size of the message in bytes (%c) +set index_format='%4C %Z %{%b %d} %-25.25n %s%> %<M?%M Msgs &%<l?%l Lines&%c Bytes>>' + +# Example 2 +# if a thread is folded +# display the number of messages (%M) +# display the subject (%s) +# else if we know how many lines in the message +# display lines in message (%l) +# else +# display the size of the message in bytes (%c) +set index_format='%4C %Z %{%b %d} %-25.25n %<M?[%M] %s&%s%* %<l?%l&%c>>' + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + cond-date patch + $index_format + $status_format + + + + + Known Bugs + Patch overwrites $<fmt> handler in $index_format + + + + Credits + + David Champion dgc@uchicago.edu + Richard Russon rich@flatcap.org + + + + + + Conditional Dates Patch + Use rules to choose date format + + + Patch + + + To check if Mutt supports Conditional Dates, look for + patch-cond-date in the mutt version. + See: . + + + + Dependencies: + mutt-1.5.24 + nested-if patch + + + + This patch is part of the NeoMutt Project. + + + + + Introduction + + + The cond-date patch allows you to construct + $index_format expressions based on the age of the email. + + + + Mutt's default $index_format displays email dates in the + form: abbreviated-month day-of-month — Jan 14. + + + + The format is configurable but only per-mailbox. This patch allows you + to configure the display depending on the age of the email. + + + + Potential Formatting Scheme + + + + Email Sent + Format + Example + + + + + Today + %H:%M + 13:23 + + + This Month + %a %d + Thu 17 + + + This Year + %b %d + Dec 10 + + + Older than 1 Year + %m/%y + 06/14 + + + +
+ + + For an explanation of the date formatting strings, see + strftime(3). + + + + By carefully picking your formats, the dates can remain + unambiguous and compact. + + + + Mutt's conditional format strings have the form: + (whitespace introduced for clarity) + + + %? TEST ? TRUE & FALSE ? + + + The examples below use the test %[ — the date + of the message in the local timezone. They will also work with + %( — the local time that the message arrived. + + + + The date tests are of the form: + + + %[nX? TRUE & FALSE ? + + + n is an optional count (defaults to 1 if missing) + X is the time period + + + + Date Formatting Codes + + + + Letter + Time Period + + + + + y + Years + + + m + Months + + + w + Weeks + + + d + Days + + + H + Hours + + + M + Minutes + + + +
+ + + Example Date Tests + + + + Test + Meaning + + + + + %[y + This year + + + %[1y + This year + + + %[6m + In the last 6 months + + + %[w + This week + + + %[d + Today + + + %[4H + In the last 4 hours + + + +
+ + + Example 1 + + We start with a one-condition test. + + + Example 1 + + + + Test + Date Range + Format String + Example + + + + + %[1m + This month + %[%b %d] + Dec 10 + + + + Older + %[%Y-%m-%d] + 2015-04-23 + + + +
+ + The $index_format string would contain: + +%?[1m?%[%b %d]&%[%Y-%m-%d]? + + + + Reparsed a little, for clarity, you can see the + test condition and the two format strings. + + + +%?[1m? & ? + %[%b %d] %[%Y-%m-%d] + + +
+ + + Example 2 + + + This example contains three test conditions and four date formats. + + + + Example 2 + + + + Test + Date Range + Format String + Example + + + + + %[d + Today + %[%H:%M ] + 12:34 + + + %[m + This month + %[%a %d] + Thu 12 + + + %[y + This year + %[%b %d] + Dec 10 + + + + Older + %[%m/%y ] + 06/15 + + + +
+ + The $index_format string would contain: + + +%<[y?%<[m?%<[d?%[%H:%M ]&%[%a %d]>&%[%b %d]>&%[%m/%y ]> + + + + Reparsed a little, for clarity, you can see the + test conditions and the four format strings. + + + +%<[y? &%[%m/%y ]> Older + %<[m? &%[%b %d]> This year + %<[d? &%[%a %d]> This month + %[%H:%M ] Today + + + + This a another view of the same example, with some whitespace + for clarity. + + + +%<[y? %<[m? %<[d? AAA & BBB > & CCC > & DDD > + + + +AAA = %[%H:%M ] +BBB = %[%a %d] +CCC = %[%b %d] +DDD = %[%m/%y ] + +
+
+ + + Variables + + + The cond-date patch doesn't have any config of its own. + It modifies the behavior of the format strings. + + + + + + + Muttrc + +# Example Mutt config file for the 'index-color' feature. +# +# The default index_format is: +# '%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s' +# +# We replace the date field '%{%b %d}', giving: +set index_format='%4C %Z %<[y?%<[m?%<[d?%[%H:%M ]&%[%a %d]>&%[%b %d]>&%[%m/%y ]> %-15.15L (%?l?%4l&%4c?) %s' + +# Test Date Range Format String Example +# -------------------------------------------- +# %[d Today %[%H:%M ] 12:34 +# %[m This month %[%a %d] Thu 12 +# %[y This year %[%b %d] Dec 10 +# - Older %[%m/%y ] 06/15 + +# vim: syntax=muttrc + + + + + See Also + + + NeoMutt Project + $index_format + nested-if patch + strftime(3) + + + + + Known Bugs + + + Date parsing doesn't quite do what you expect. + 1w doesn't mean the in the last 7 days, but + this week. This doesn't match + the normal Mutt behaviour: for example ~d>1w + means emails dated in the last 7 days. + + + + + + Credits + + Aaron Schrab aaron@schrab.com + Eric Davis edavis@insanum.com + Richard Russon rich@flatcap.org + + +
+ + + TLS-SNI Patch + Negotiate with a server for a TSL/SSL certificate + + + Patch + + + To check if Mutt supports TLS-SNI, look for + patch-tls-sni in the mutt version. + See: . + + + + Dependencies: + mutt-1.5.24 + OpenSSL + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The TLS-SNI patch adds support for TLS virtual hosting. + If your mail server doesn't support this everything will still work + normally. + + + + TLS supports sending the expected server hostname during the + handshake, via the SNI extension. This can be used to select a + server certificate to issue to the client, permitting + virtual-hosting without requiring multiple IP addresses. + + + + This has been tested against Exim 4.80, which optionally logs SNI + and can perform vhosting. + + + + To verify TLS SNI support by a server, you can use: + + + +openssl s_client -host <imap server> -port <port> -tls1 -servername <imap server> + + + + + + + Muttrc + None + + + + See Also + + + NeoMutt Project + + + + + Known Bugs + None + + + + Credits + + Jeremy Katz katzj@linuxpower.org + Phil Pennock mutt-dev@spodhuis.demon.nl + Richard Russon rich@flatcap.org + + + + + + Sidebar Patch + Overview of mailboxes + + + Patch + + + To check if Mutt supports Sidebar, look for + +USE_SIDEBAR in the mutt version. + See: . + + + + Dependencies: + mutt-1.5.24 + + + This patch is part of the NeoMutt Project. + + + + Introduction + + + The Sidebar shows a list of all your mailboxes. The list can be + turned on and off, it can be themed and the list style can be + configured. + + + + This part of the manual is a reference guide. + If you want a simple introduction with examples see the + Sidebar Howto. + If you just want to get started, you could use the sample + Sidebar muttrc. + + + + This version of Sidebar is based on Terry Chan's + 2015-11-11 release. + It contains many + new features, + lots of + bugfixes. + + + + + Variables + + + Sidebar Variables + + + + Name + Type + Default + + + + + sidebar_delim_chars + string + /. + + + sidebar_divider_char + string + | + + + sidebar_folder_indent + boolean + no + + + sidebar_format + string + %B%?F? [%F]?%* %?N?%N/?%S + + + sidebar_indent_string + string +    (two spaces) + + + sidebar_new_mail_only + boolean + no + + + sidebar_next_new_wrap + boolean + no + + + sidebar_refresh_time + number + 60 + + + sidebar_short_path + boolean + no + + + sidebar_sort_method + enum + SORT_ORDER + + + sidebar_visible + boolean + no + + + sidebar_whitelist + list + (empty) + + + sidebar_width + number + 20 + + + +
+
+ + + Functions + + + Sidebar adds the following functions to Mutt. + By default, none of them are bound to keys. + + + + Sidebar Functions + + + + Menus + Function + Description + + + + + index,pager + <sidebar-next> + Move the highlight to next mailbox + + + index,pager + <sidebar-next-new> + Move the highlight to next mailbox with new mail + + + index,pager + <sidebar-open> + Open highlighted mailbox + + + index,pager + <sidebar-page-down> + Scroll the Sidebar down 1 page + + + index,pager + <sidebar-page-up> + Scroll the Sidebar up 1 page + + + index,pager + <sidebar-prev> + Move the highlight to previous mailbox + + + index,pager + <sidebar-prev-new> + Move the highlight to previous mailbox with new mail + + + index,pager + <sidebar-toggle-visible> + Make the Sidebar (in)visible + + + +
+
+ + + Commands + + sidebar_whitelist + + mailbox + + + mailbox + + + + + + Colors + + + Sidebar Colors + + + + Name + Default Color + Description + + + + + sidebar_divider + default + The dividing line between the Sidebar and the Index/Pager panels + + + sidebar_flagged + default + Mailboxes containing flagged mail + + + sidebar_highlight + underline + Cursor to select a mailbox + + + sidebar_indicator + mutt indicator + The mailbox open in the Index panel + + + sidebar_new + default + Mailboxes containing new mail + + + sidebar_spoolfile + default + Mailbox that receives incoming mail + + + +
+ + If the sidebar_indicator color isn't set, then the default Mutt + indicator color will be used (the color used in the index panel). +
+ + + Sort + + + Sidebar Sort + + + + Sort + Description + + + + + alpha + Alphabetically by path + + + count + Total number of messages + + + flagged + Number of flagged messages + + + name + Alphabetically by path + + + new + Number of new messages + + + path + Alphabetically by path + + + unsorted + Do not resort the paths + + + +
+
+ + + Muttrc + + # This is a complete list of sidebar-related configuration. + + # -------------------------------------------------------------------------- + # VARIABLES - shown with their default values + # -------------------------------------------------------------------------- + + # Should the Sidebar be shown? + set sidebar_visible = no + + # How wide should the Sidebar be in screen columns? + # Note: Some characters, e.g. Chinese, take up two columns each. + set sidebar_width = 20 + + # Should the mailbox paths be abbreviated? + set sidebar_short_path = no + + # When abbreviating mailbox path names, use any of these characters as path + # separators. Only the part after the last separators will be shown. + # For file folders '/' is good. For IMAP folders, often '.' is useful. + set sidebar_delim_chars = '/.' + + # If the mailbox path is abbreviated, should it be indented? + set sidebar_folder_indent = no + + # Indent mailbox paths with this string. + set sidebar_indent_string = ' ' + + # Make the Sidebar only display mailboxes that contain new, or flagged, + # mail. + set sidebar_new_mail_only = no + + # Any mailboxes that are whitelisted will always be visible, even if the + # sidebar_new_mail_only option is enabled. + sidebar_whitelist '/home/user/mailbox1' + sidebar_whitelist '/home/user/mailbox2' + + # When searching for mailboxes containing new mail, should the search wrap + # around when it reaches the end of the list? + set sidebar_next_new_wrap = no + + # The character to use as the divider between the Sidebar and the other Mutt + # panels. + # Note: Only the first character of this string is used. + set sidebar_divider_char = '|' + + # Display the Sidebar mailboxes using this format string. + set sidebar_format = '%B%?F? [%F]?%* %?N?%N/?%S' + + # Sidebar will not refresh its list of mailboxes any more frequently than + # this number of seconds. This will help reduce disk/network traffic. + set sidebar_refresh_time = 60 + + # Sort the mailboxes in the Sidebar using this method: + # count - total number of messages + # flagged - number of flagged messages + # new - number of new messages + # path - mailbox path + # unsorted - do not sort the mailboxes + set sidebar_sort_method = 'unsorted' + + # -------------------------------------------------------------------------- + # FUNCTIONS - shown with an example mapping + # -------------------------------------------------------------------------- + + # Move the highlight to the previous mailbox + bind index,pager \Cp sidebar-prev + + # Move the highlight to the next mailbox + bind index,pager \Cn sidebar-next + + # Open the highlighted mailbox + bind index,pager \Co sidebar-open + + # Move the highlight to the previous page + # This is useful if you have a LOT of mailboxes. + bind index,pager <F3> sidebar-page-up + + # Move the highlight to the next page + # This is useful if you have a LOT of mailboxes. + bind index,pager <F4> sidebar-page-down + + # Move the highlight to the previous mailbox containing new, or flagged, + # mail. + bind index,pager <F5> sidebar-prev-new + + # Move the highlight to the next mailbox containing new, or flagged, mail. + bind index,pager <F6> sidebar-next-new + + # Toggle the visibility of the Sidebar. + bind index,pager B sidebar-toggle-visible + + # -------------------------------------------------------------------------- + # COLORS - some unpleasant examples are given + # -------------------------------------------------------------------------- + # Note: All color operations are of the form: + # color OBJECT FOREGROUND BACKGROUND + + # Color of the current, open, mailbox + # Note: This is a general Mutt option which colors all selected items. + color indicator cyan black + + # Color of the highlighted, but not open, mailbox. + color sidebar_highlight black color8 + + # Color of the divider separating the Sidebar from Mutt panels + color sidebar_divider color8 black + + # Color to give mailboxes containing flagged mail + color sidebar_flagged red black + + # Color to give mailboxes containing new mail + color sidebar_new green black + + # -------------------------------------------------------------------------- + + # vim: syntax=muttrc + + + + + See Also + + + Regular Expressions + Patterns + Color command + notmuch patch + + + + + Known Bugs + Unsorted isn't + + + + Credits + + Justin Hibbits jrh29@po.cwru.edu + Thomer M. Gil mutt@thomer.com + David Sterba dsterba@suse.cz + Evgeni Golov evgeni@debian.org + Fabian Groffen grobian@gentoo.org + Jason DeTiberus jdetiber@redhat.com + Stefan Assmann sassmann@kpanic.de + Steve Kemp steve@steve.org.uk + Terry Chan tchan@lunar-linux.org + Tyler Earnest tylere@rne.st + Richard Russon rich@flatcap.org + + +
+ diff --cc functions.h index 23af09914,9d7850c6b..d47771fb3 --- a/functions.h +++ b/functions.h @@@ -167,8 -167,17 +167,18 @@@ const struct binding_t OpMain[] = { /* { "mail-key", OP_MAIL_KEY, "\033k" }, { "decrypt-copy", OP_DECRYPT_COPY, NULL }, { "decrypt-save", OP_DECRYPT_SAVE, NULL }, + { "quasi-delete", OP_MAIN_QUASI_DELETE, NULL }, + #ifdef USE_SIDEBAR + { "sidebar-next", OP_SIDEBAR_NEXT, NULL }, + { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW, NULL }, + { "sidebar-open", OP_SIDEBAR_OPEN, NULL }, + { "sidebar-page-down", OP_SIDEBAR_PAGE_DOWN, NULL }, + { "sidebar-page-up", OP_SIDEBAR_PAGE_UP, NULL }, + { "sidebar-prev", OP_SIDEBAR_PREV, NULL }, + { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW, NULL }, + { "sidebar-toggle-visible", OP_SIDEBAR_TOGGLE_VISIBLE, NULL }, + #endif { NULL, 0, NULL } }; @@@ -272,8 -281,18 +282,19 @@@ const struct binding_t OpPager[] = { / { "decrypt-save", OP_DECRYPT_SAVE, NULL }, { "what-key", OP_WHAT_KEY, NULL }, + { "quasi-delete", OP_MAIN_QUASI_DELETE, NULL }, + #ifdef USE_SIDEBAR + { "sidebar-next", OP_SIDEBAR_NEXT, NULL }, + { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW, NULL }, + { "sidebar-open", OP_SIDEBAR_OPEN, NULL }, + { "sidebar-page-down", OP_SIDEBAR_PAGE_DOWN, NULL }, + { "sidebar-page-up", OP_SIDEBAR_PAGE_UP, NULL }, + { "sidebar-prev", OP_SIDEBAR_PREV, NULL }, + { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW, NULL }, + { "sidebar-toggle-visible", OP_SIDEBAR_TOGGLE_VISIBLE, NULL }, + #endif + { NULL, 0, NULL } }; diff --cc menu.c index 46ea6c269,8eed91ce3..dec077428 --- a/menu.c +++ b/menu.c @@@ -347,8 -309,8 +357,8 @@@ void menu_redraw_motion (MUTTMENU *menu { menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent); menu_pad_string (buf, sizeof (buf)); - move (menu->oldcurrent + menu->offset - menu->top, 3); + move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth + 3); - print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1); + print_enriched_string (menu->oldcurrent, menu->color (menu->oldcurrent), (unsigned char *) buf, 1); } /* now draw it in the new location */ @@@ -366,8 -328,8 +376,8 @@@ menu_make_entry (buf, sizeof (buf), menu, menu->current); menu_pad_string (buf, sizeof (buf)); SETCOLOR(MT_COLOR_INDICATOR); - move(menu->current - menu->top + menu->offset, 0); - move(menu->current - menu->top + menu->offset, SidebarWidth); - print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0); ++ move (menu->current - menu->top + menu->offset, SidebarWidth); + print_enriched_string (menu->current, menu->color (menu->current), (unsigned char *) buf, 0); } menu->redraw &= REDRAW_STATUS; NORMAL_COLOR; diff --cc mutt_curses.h index b7bf5fb1f,fbcbb87df..5804b5f0a --- a/mutt_curses.h +++ b/mutt_curses.h @@@ -122,19 -125,16 +125,27 @@@ enu MT_COLOR_SEARCH, MT_COLOR_BOLD, MT_COLOR_UNDERLINE, - MT_COLOR_INDEX, MT_COLOR_PROMPT, + MT_COLOR_PROGRESS, + #ifdef USE_SIDEBAR + MT_COLOR_DIVIDER, + MT_COLOR_FLAGGED, + MT_COLOR_HIGHLIGHT, + MT_COLOR_NEW, + MT_COLOR_SB_INDICATOR, + MT_COLOR_SB_SPOOLFILE, + #endif + /* please no non-MT_COLOR_INDEX objects after this point */ + MT_COLOR_INDEX, + MT_COLOR_INDEX_AUTHOR, + MT_COLOR_INDEX_FLAGS, + MT_COLOR_INDEX_SUBJECT, + /* below here - only index coloring stuff that doesn't have a pattern */ + MT_COLOR_INDEX_COLLAPSED, + MT_COLOR_INDEX_DATE, + MT_COLOR_INDEX_LABEL, + MT_COLOR_INDEX_NUMBER, + MT_COLOR_INDEX_SIZE, MT_COLOR_MAX }; diff --cc pager.c index 4b1e79408,223ea70f8..58829399c --- a/pager.c +++ b/pager.c @@@ -1804,14 -1833,18 +1833,18 @@@ mutt_pager (const char *banner, const c size_t l2 = sizeof (buffer); hfi.hdr = (IsHeader (extra)) ? extra->hdr : extra->bdy->hdr; mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT); - mutt_draw_statusline (COLS, buffer); - mutt_paddstr (statuswidth, buffer); ++ mutt_draw_statusline (statuswidth, buffer); } else { char bn[STRING]; snprintf (bn, sizeof (bn), "%s (%s)", banner, pager_progress_str); - mutt_draw_statusline (COLS, bn); - mutt_paddstr (statuswidth, bn); ++ mutt_draw_statusline (statuswidth, bn); } + #ifdef USE_SIDEBAR + if (!option (OPTSTATUSONTOP) || PagerIndexLines == 0) + SidebarWidth = sw; /* Restore the sidebar width */ + #endif NORMAL_COLOR; if (option(OPTTSENABLED) && TSSupported) { diff --cc sort.h index 5f66f79ea,f24491b95..207da870f --- a/sort.h +++ b/sort.h @@@ -31,9 -31,12 +31,12 @@@ #define SORT_KEYID 12 #define SORT_TRUST 13 #define SORT_SPAM 14 -#define SORT_COUNT 15 -#define SORT_COUNT_NEW 16 -#define SORT_DESC 17 +#define SORT_DESC 15 +#define SORT_COUNT 16 +#define SORT_COUNT_NEW 17 + #define SORT_FLAGGED 18 + #define SORT_PATH 19 + /* dgc: Sort & SortAux are shorts, so I'm bumping these bitflags up from * bits 4 & 5 to bits 8 & 9 to make room for more sort keys in the future. */ #define SORT_MASK 0xff