master branch is experimental
This extension adds a maildir summary in mu4e-main-view
.
It runs a mu
command (async) in a shell process for each maildir to count unread and total mails.
This extension needs mu4e version 0.9.9.5 or newer to work.
This extension expects the following maildir structure in mu4e-maildir
directory
account1/
inbox/
drafts/
...
account2/
inbox/
drafts/
...
It's available on MELPA.
M-x package-install mu4e-maildirs-extension
(mu4e-maildirs-extension)
Or you can copy mu4e-maildirs-extension.el
file in your load path and add the following in your ~/.emacs
startup file:
(require 'mu4e-maildirs-extension)
(mu4e-maildirs-extension)
The following key-bindings are added in mu4e-main-view
:
u
Update the indexC-u u
only clear the cacheC-u C-u u
clear the cache and refresh.SPC
Collapse/Expand maildir at point.C-u SPC
Collapse/Expand maildir at point and its children.RET
Jump to the maildir at point.C-u RET
Jump to the maildir at point but show only unread mails.
If the extension has been loaded, simply call M-x customize-group
and type mu4e-maildirs-extension
.
Key shortcut to update index and cache.
Action text to display for updating the index and cache. If set to 'Don't Display (nil)' it won't be displayed.
Hook called after inserting a maildir.
Hook called before inserting a maildir.
The bookmark stats format.
Available formatters:
%u is the unread count %t is the total count
A function to build the bookmark format spec.
Predicate function used to highlight.
Regex to highlight when `mu4e-maildirs-extension-bookmark-hl-pred' matches.
The command to count a maildir. [Most people won't need to edit this].
List of folders to show. If set to nil all folders are shown.
Example: '("/account1/INBOX" "/account2/INBOX")
The default level to collapse maildirs. Set `nil' to disable.
The separator to fake a hierarchy using directory names. For example:
/Archive
/Archive.foo
/Archive.foo.bar
/Archive.baz
Offlineimap does this when setting `sep = .'.
The place where the maildirs section should be inserted.
The prefix for collapsed maildir.
The prefix for default maildir.
The prefix for expanded maildir.
The maildir format.
Available formatters:
%i is the folder indentation %p is the maildir prefix %l is the folder level %e is the expand flag %P is the maildir path %n is the maildir name %u is the unread count %t is the total count
A function to build the maildir format spec.
Predicate function used to highlight.
Regex to highlight when `mu4e-maildirs-extension-maildir-hl-pred' matches.
Maildir indentation.
The char used for indentation.
Max parallel processes.
The function to format the bookmark info. Default displays as ' (unread/total)'.
The function to format the maildir info. Default displays as '| maildir_name (unread/total)'.
The title for the maildirs extension section. If set to `nil' it won't be displayed.
If non-nil, hide maildirs that do not contain new mail.
Key shortcut to expand/collapse maildir at point.
The string to show while updating in background.
If non-nil, show the bookmarks count in the mu4e main view.
If non-nil, show the maildir summary in the mu4e main view.
Face for a normal maildir.
Face for a highlighted maildir.
If you need more customization you can change the default format | maildir_name (unread/total)
providing your own function. For example, to highlight only the unread count you could use something like this in your .emacs
:
(defun my/mu4e-maildirs-extension-propertize-unread-only (item)
"Propertize only the maildir unread count using ITEM plist."
(let ((unread (or (plist-get item :unread) 0))
(total (or (plist-get item :total) 0)))
(format "\t%s%s %s (%s/%s)"
(plist-get item :indent)
(plist-get item :prefix)
(plist-get item :name)
(propertize (number-to-string unread)
'face (cond
((> unread 0) 'mu4e-maildirs-extension-maildir-hl-face)
(t 'mu4e-maildirs-extension-maildir-face)))
total)))
Then set mu4e-maildirs-extension-propertize-func
to my/mu4e-maildirs-extension-propertize-unread-only
in the customize-group
area.
If you update the index outside emacs (by calling mu
directly) you will need to update the mu4e-main-view
using C-u C-u u
or calling (mu4e-maildirs-extension-force-update '(16))
Short summary of changes:
-
master:
- Use mu4e-mu-binary
- Add variables:
- mu4e-maildirs-extension-use-bookmarks
- mu4e-maildirs-extension-use-maildirs
- Add bookmarks support (experimental)
- Improve customizations.
- Add new highlight options.
- Add -load/-unload functions
- Rename variables (old -> new):
- mu4e-maildirs-extension-submaildir-indent -> mu4e-maildirs-extension-maildir-indent
- mu4e-maildirs-extension-maildir-separator -> mu4e-maildirs-extension-maildir-collapsed-prefix
- mu4e-maildirs-extension-submaildir-separator -> mu4e-maildirs-extension-maildir-default-prefix
- mu4e-maildirs-extension-maildir-unread-face -> mu4e-maildirs-extension-maildir-hl-face
- mu4e-maildirs-extension-cached-maildirs-data -> mu4e-maildirs-extension-maildirs
- Add new variables:
- mu4e-maildirs-extension-maildir-format
- mu4e-maildirs-extension-maildir-format-spec
- mu4e-maildirs-extension-maildir-hl-regex
- mu4e-maildirs-extension-maildir-hl-pred
- mu4e-maildirs-extension-before-insert-maildir-hook
- mu4e-maildirs-extension-after-insert-maildir-hook
- mu4e-maildirs-extension-maildir-indent-char
- mu4e-maildirs-extension-default-collapse-level
- mu4e-maildirs-extension-maildir-expanded-prefix
- mu4e-maildirs-extension-fake-maildir-separator
- mu4e-maildirs-extension-parallel-processes
- Allow maildirs at point to collapse/expand.
- Add async support
-
v0.8:
- Auto-update
mu4e-main-view
if the index have changed and the buffer is visible. - Use universal argument to be able to manually clear the cache and refresh (
C-u u
andC-u C-u u
)
- Auto-update