Add optional name for maildir shortcuts

This commit is contained in:
Manuel Wiesinger
2022-07-04 11:46:39 +02:00
parent cd23debf77
commit f16f4b5e3c
2 changed files with 7 additions and 3 deletions

View File

@ -97,6 +97,7 @@ Each of the list elements is a plist with at least:
`:key' - the shortcut key. `:key' - the shortcut key.
Optionally, you can add the following: Optionally, you can add the following:
`:name' - name of the maildir to be displayed in main-view.
`:hide' - if t, the shortcut is hidden from the main-view and `:hide' - if t, the shortcut is hidden from the main-view and
speedbar. speedbar.
`:hide-unread' - do not show the counts of unread/total number `:hide-unread' - do not show the counts of unread/total number
@ -159,7 +160,8 @@ This is compatibile with `mu4e-bookmarks'."
(seq-map (seq-map
(lambda (item) (lambda (item)
(let* ((maildir (plist-get item :maildir)) (let* ((maildir (plist-get item :maildir))
(item (plist-put item :name maildir)) (name (or (plist-get item :name) maildir))
(item (plist-put item :name name))
(item (plist-put item :query (format "maildir:\"%s\"" maildir)))) (item (plist-put item :query (format "maildir:\"%s\"" maildir))))
item)) ;; we don't need ":maildir", but it's harmless. item)) ;; we don't need ":maildir", but it's harmless.
(mu4e-maildir-shortcuts))) (mu4e-maildir-shortcuts)))

View File

@ -1977,7 +1977,8 @@ quick access to, for example:
(:maildir "/archive" :key ?a) (:maildir "/archive" :key ?a)
(:maildir "/lists" :key ?l) (:maildir "/lists" :key ?l)
(:maildir "/work" :key ?w) (:maildir "/work" :key ?w)
(:maildir "/sent" :key ?s))) (:maildir "/sent" :key ?s)
(:maildir "/lists/project/project_X" :key ?x :name "Project X")))
@end lisp @end lisp
This sets @key{i} as a shortcut for the @t{/inbox} folder --- effectively a This sets @key{i} as a shortcut for the @t{/inbox} folder --- effectively a
@ -1986,7 +1987,8 @@ query @t{maildir:/inbox}. There is a special shortcut @key{o} or @key{/} for
choose from @emph{all} maildirs that you have. There is support for choose from @emph{all} maildirs that you have. There is support for
autocompletion; note that the list of maildirs is determined when @t{mu4e} autocompletion; note that the list of maildirs is determined when @t{mu4e}
starts; if there are changes in the maildirs while @t{mu4e} is running, you starts; if there are changes in the maildirs while @t{mu4e} is running, you
need to restart @t{mu4e}. need to restart @t{mu4e}. Optionally, you can specify a name to be displayed
in the main view.
Each of the folder names is relative to your top-level maildir directory; so Each of the folder names is relative to your top-level maildir directory; so
if you keep your mail in @file{~/Maildir}, @file{/inbox} would refer to if you keep your mail in @file{~/Maildir}, @file{/inbox} would refer to