Mutt sidebar (folder list) patch

News

April 12, 2014 Updated patch for pristine mutt-1.5.23 source package.
February 19, 2013 Added the sidebar shortpath_indent patch courtesy of v4hn (fellow lunar dev).
August 29, 2012 Updated patch for pristine mutt-1.5.21 source package.
Also incorporated 16 patches from Julius Plenz (patches 0005 through 0020).
June 19, 2009 Updated patch for pristine mutt-1.5.20 source package.
June 18, 2009 Added IMAP folder sorting patch courtesy of Jan Larres
May 22, 2009 Added maildir patches courtesy of Stuart Henderson and Aneesh Kumar
March 8, 2009 Updated patch for pristine mutt-1.5.19 source package.
June 11, 2008 Fixes the indenting folder patch — no more null’s being displayed.
May 17, 2008 Updated patch for pristine mutt-1.5.18 source package.
April 12, 2008 Incorporated patches from Tomas Hoger (multiple pages of mailboxes screen display fixed),
Nicolas Duboc (flagged emails), Micha Lenk (indenting folders relative to folder depth).
November 3, 2007 Updated patch for pristine mutt-1.5.17 source package.
July 4, 2007 Updated patch for pristine mutt-1.5.16 source package.
April 8, 2007 Updated patch for pristine mutt-1.5.15 source package.
February 23, 2007 Updated patch for pristine mutt-1.5.14 source package.
October 23, 2006 Incorporated a patch from Andreas Krennmair that allows the sidebar delimiter to be user-configured.
August 30, 2006 Incorporated a patch from Eugene Paskevich that corrects a problem the sidebar code
has with the regular mutt status line at the bottom of the screen.
August 28, 2006 Updated patch for pristine mutt-1.5.13 source package.
Incorporated a patch from Dr. Werner Fink to behave better with other mutt patches and to make sidebar
play nicer with autoconfigure.
August 4, 2006 Updated patch for pristine mutt-1.5.12 source package.
Incorporated a patch from Charles Killian for better refresh of IMAP folder message counts.
July 21, 2006
New maintainer is Terry P. Chan.

I’ll only be maintaining the patch for the pristine mutt source tarballs (i.e.
unpatched mutt source). So that also means no Debian packages, and
no RPM’s.

July 20, 2006 Patch for pristine mutt-1.5.12 source package.

Introduction

Mutt is the mail client of choice for people who are wary of fancy graphical user interfaces. I do like Mozilla Thunderbird, Balsa, and even Outlook Express. My biggest problem with all of these mail clients, however, is that I cannot use Vim to write my emails.

Unfortunately, though, mutt lacks an important feature that most email clients do have: a folder list that allows you to see all mail folders you have and how many (new) emails they each contain.

Justin Hibbits wrote a mutt patch that is an approximate fix to this problem. Thomer M. Gil helped him by adding some features and fixing some bugs. I temporarily borrowed most of the text from Thomer’s mutt sidebar page, at least until I can find the time to figure out what needs to change here.

Features

  • A sidebar with a list of folders on the left side of the mutt window.
  • Hide/Unhide the sidebar with a single keystroke.
  • Every line in the sidebar lists a folder with the total and new number of messages in it.
  • Optionally highlight folders with new messages.
  • Scroll up and down the list of folders and open the selected folder.
  • Configurable sidebar width and colors.
  • Configurable key bindings.

Screenshot

Download

Patches

Announcements

If you want an announcement when I release a new version of the patch, subscribe to the Mutt Folder List freecode project.

Installation

Get the unpatched mutt 1.5.23 tarball, untar it, and apply the patch. For example:

$ wget -q -O - ftp://ftp.mutt.org/mutt/devel/mutt-1.5.23.tar.gz | tar xvfz -
$ cd ./mutt-1.5.23
$ wget -q -O - http://lunar-linux.org/~tchan/mutt/patch-1.5.23.sidebar.20140412.txt | patch -p1
$ ./configure
$ make
$ ./mutt
$ make install (optional, you need to be root for this)

Documentation

Here are the relevant settings from my muttrc:

# set up the sidebar, default not visible
set sidebar_width=12
set sidebar_visible=no
set sidebar_delim='|'
set sidebar_sort=yes

# which mailboxes to list in the sidebar
mailboxes =inbox =ml

# color of folders with new mail
color sidebar_new yellow default

# ctrl-n, ctrl-p to select next, prev folder
# ctrl-o to open selected folder
bind index CP sidebar-prev
bind index CN sidebar-next
bind index CO sidebar-open
bind pager CP sidebar-prev
bind pager CN sidebar-next
bind pager CO sidebar-open

# I don’t need these. just for documentation purposes. See below.
# sidebar-scroll-up
# sidebar-scroll-down

# b toggles sidebar visibility
macro index b ‘<enter-command>toggle sidebar_visible<enter>’
macro pager b ‘<enter-command>toggle sidebar_visible<enter>’

# Remap bounce-message function to “B”
bind index B bounce-message

#
# Mario Holbe suggests:
# macro index b ‘<enter-command>toggle sidebar_visible<enter><refresh>’
# macro pager b ‘<enter-command>toggle sidebar_visible<enter><redraw-screen>’
#

sidebar_width (number)
Width of the sidebar.

sidebar_visible (boolean)
Whether or not the sidebar is visible.

sidebar_delim (string)
Specifies the delimiter between the sidebar and other screens

sidebar_sort
This specifies whether or not to sort the folders in the sidebar alphabetically, mainly for IMAP user.

color sidebar_new [fg] [bg]
The foreground (fg) and background (bg) color of folders that contain new mail.

sidebar-prev
Mutt’s name for the operation that selects the previous folder.

sidebar-next
Mutt’s name for the operation that selects the next folder.

sidebar-open
Mutt’s name for the operation that opens the currently selected folder.

sidebar-scroll-up
Only useful if you have more folders than lines in your terminal: scrolls one
page up through the list of folders.

sidebar-scroll-down
Only useful if you have more folders than lines in your terminal: scrolls one
page down through the list of folders.

sidebar_format (string)
Format string for the sidebar. The sequences `%N’, `%F’ and `%S’ will
be replaced by the number of new or flagged messages or the total size
of them mailbox. `%B’ will be replaced with the name of the mailbox.
The `%!’ sequence will be expanded to `!’ if there is one flagged
message; to `!!’ if there are two flagged messages; and to `n!’ for n
flagged messages, n>2.

sidebar_folderindent (boolean)
Should folders be indented in the sidebar.

sidebar_indentstr (string)
This specifies the string that is used to indent items with
sidebar_folderindent= yes.

sidebar_shortpath (boolean)
Should the sidebar shorten the path showed.

Bugs and patches

Bugs? Probably! Patches? Yes, please!

URL: http://www.lunar-linux.org/mutt-sidebar/
Copyright © 1994-2006 by Thomer M. Gil
Portions Copyright © 2006-2014 by Terry P. Chan