mirror of https://github.com/djcb/mu.git
Merge bdc36c0b0f
into bbd949e9e7
This commit is contained in:
commit
646725ccfe
|
@ -44,7 +44,6 @@
|
||||||
:key ?t)
|
:key ?t)
|
||||||
( :name "Last 7 days"
|
( :name "Last 7 days"
|
||||||
:query "date:7d..now"
|
:query "date:7d..now"
|
||||||
:hide-unread t
|
|
||||||
:key ?w)
|
:key ?w)
|
||||||
( :name "Messages with images"
|
( :name "Messages with images"
|
||||||
:query "mime:image/*"
|
:query "mime:image/*"
|
||||||
|
|
|
@ -86,6 +86,12 @@ nil otherwise."
|
||||||
(function :tag "Function return folder name"))
|
(function :tag "Function return folder name"))
|
||||||
:group 'mu4e-folders)
|
:group 'mu4e-folders)
|
||||||
|
|
||||||
|
(defcustom mu4e-maildirs nil
|
||||||
|
"A custom list of maildirs"
|
||||||
|
:type '(repeat string)
|
||||||
|
:version "1.3.9"
|
||||||
|
:group 'mu4e-folders)
|
||||||
|
|
||||||
(defcustom mu4e-maildir-shortcuts nil
|
(defcustom mu4e-maildir-shortcuts nil
|
||||||
"A list of maildir shortcuts.
|
"A list of maildir shortcuts.
|
||||||
This makes it possible to quickly go to a particular
|
This makes it possible to quickly go to a particular
|
||||||
|
@ -163,6 +169,12 @@ mime-type are nil."
|
||||||
"Cached list of maildirs.")
|
"Cached list of maildirs.")
|
||||||
|
|
||||||
|
|
||||||
|
(defun mu4e-maildirs ()
|
||||||
|
"Get `mu4e-maildirs'."
|
||||||
|
(seq-map (lambda (item)
|
||||||
|
`(:maildir ,item :key ,?.))
|
||||||
|
mu4e-maildirs))
|
||||||
|
|
||||||
(defun mu4e-maildir-shortcuts ()
|
(defun mu4e-maildir-shortcuts ()
|
||||||
"Get `mu4e-maildir-shortcuts' in the (new) format.
|
"Get `mu4e-maildir-shortcuts' in the (new) format.
|
||||||
Converts from the old format if needed."
|
Converts from the old format if needed."
|
||||||
|
|
|
@ -228,7 +228,7 @@ for aligning them."
|
||||||
;; note, we have a function for the binding,
|
;; note, we have a function for the binding,
|
||||||
;; and perhaps a different one for the lambda.
|
;; and perhaps a different one for the lambda.
|
||||||
(cond
|
(cond
|
||||||
((eq item-type 'maildirs)
|
((or (eq item-type 'maildirs) (eq item-type 'maildirs-with-shortcut))
|
||||||
(list #'mu4e-search-maildir #'mu4e-search
|
(list #'mu4e-search-maildir #'mu4e-search
|
||||||
query))
|
query))
|
||||||
((eq item-type 'bookmarks)
|
((eq item-type 'bookmarks)
|
||||||
|
@ -239,11 +239,17 @@ for aligning them."
|
||||||
(concat
|
(concat
|
||||||
(mu4e--main-action
|
(mu4e--main-action
|
||||||
;; main title
|
;; main title
|
||||||
(format "\t* [@] %s "
|
(if (eq item-type 'maildirs)
|
||||||
(propertize
|
(format "\t* %s "
|
||||||
name
|
(propertize
|
||||||
'face (if favorite 'mu4e-header-key-face nil)
|
name
|
||||||
'help-echo query))
|
'face (if favorite 'mu4e-header-key-face nil)
|
||||||
|
'help-echo query))
|
||||||
|
(format "\t* [@] %s "
|
||||||
|
(propertize
|
||||||
|
name
|
||||||
|
'face (if favorite 'mu4e-header-key-face nil)
|
||||||
|
'help-echo query)))
|
||||||
;; function to call when activated
|
;; function to call when activated
|
||||||
(lambda () (interactive)
|
(lambda () (interactive)
|
||||||
(funcall (nth 1 item-info)
|
(funcall (nth 1 item-info)
|
||||||
|
@ -312,8 +318,19 @@ Otherwise, do nothing."
|
||||||
(propertize " Bookmarks\n\n" 'face 'mu4e-title-face)
|
(propertize " Bookmarks\n\n" 'face 'mu4e-title-face)
|
||||||
(mu4e--main-items 'bookmarks max-length)
|
(mu4e--main-items 'bookmarks max-length)
|
||||||
"\n"
|
"\n"
|
||||||
(propertize " Maildirs\n\n" 'face 'mu4e-title-face)
|
(if (eq mu4e-maildir-shortcuts nil)
|
||||||
(mu4e--main-items 'maildirs max-length)
|
""
|
||||||
|
(concat
|
||||||
|
(propertize " Quick access maildirs\n\n" 'face 'mu4e-title-face)
|
||||||
|
(mu4e--main-items 'maildirs-with-shortcut max-length)
|
||||||
|
"\n"))
|
||||||
|
|
||||||
|
(if (eq mu4e-maildirs nil)
|
||||||
|
""
|
||||||
|
(concat
|
||||||
|
(propertize " Other maildirs\n\n" 'face 'mu4e-title-face)
|
||||||
|
(mu4e--main-items 'maildirs max-length)
|
||||||
|
"\n"))
|
||||||
"\n"
|
"\n"
|
||||||
(propertize " Misc\n\n" 'face 'mu4e-title-face)
|
(propertize " Misc\n\n" 'face 'mu4e-title-face)
|
||||||
(mu4e--main-action "\t* [@]Choose query\n"
|
(mu4e--main-action "\t* [@]Choose query\n"
|
||||||
|
|
|
@ -92,10 +92,12 @@ If ITEMS does not yet have a favorite item, pick the first."
|
||||||
items)
|
items)
|
||||||
|
|
||||||
(defvar mu4e--bookmark-items-cached nil "Cached bookmarks query items.")
|
(defvar mu4e--bookmark-items-cached nil "Cached bookmarks query items.")
|
||||||
|
(defvar mu4e--maildir-with-shortcut-items-cached nil "Cached maildirs query items.")
|
||||||
(defvar mu4e--maildir-items-cached nil "Cached maildirs query items.")
|
(defvar mu4e--maildir-items-cached nil "Cached maildirs query items.")
|
||||||
|
|
||||||
(declare-function mu4e-bookmarks "mu4e-bookmarks")
|
(declare-function mu4e-bookmarks "mu4e-bookmarks")
|
||||||
(declare-function mu4e-maildir-shortcuts "mu4e-folders")
|
(declare-function mu4e-maildir-shortcuts "mu4e-folders")
|
||||||
|
(declare-function mu4e-maildirs "mu4e-folders")
|
||||||
|
|
||||||
(defun mu4e--query-item-display-counts (item)
|
(defun mu4e--query-item-display-counts (item)
|
||||||
"Get the count display string for some query-data ITEM."
|
"Get the count display string for some query-data ITEM."
|
||||||
|
@ -123,6 +125,7 @@ With RESET-BASELINE, reset the baseline first."
|
||||||
(setq mu4e--query-items-baseline nil
|
(setq mu4e--query-items-baseline nil
|
||||||
mu4e--query-items-baseline-tstamp nil
|
mu4e--query-items-baseline-tstamp nil
|
||||||
mu4e--bookmark-items-cached nil
|
mu4e--bookmark-items-cached nil
|
||||||
|
mu4e--maildir-with-shortcut-items-cached nil
|
||||||
mu4e--maildir-items-cached nil
|
mu4e--maildir-items-cached nil
|
||||||
mu4e--last-delta-unread 0))
|
mu4e--last-delta-unread 0))
|
||||||
(mu4e--server-queries
|
(mu4e--server-queries
|
||||||
|
@ -146,6 +149,7 @@ I.e. what we get in response to mu4e--query-items-refresh."
|
||||||
mu4e--query-items-baseline-tstamp (current-time)))
|
mu4e--query-items-baseline-tstamp (current-time)))
|
||||||
|
|
||||||
(setq mu4e--bookmark-items-cached nil
|
(setq mu4e--bookmark-items-cached nil
|
||||||
|
mu4e--maildir-with-shortcut-items-cached nil
|
||||||
mu4e--maildir-items-cached nil)
|
mu4e--maildir-items-cached nil)
|
||||||
(mu4e-query-items) ;; for side-effects
|
(mu4e-query-items) ;; for side-effects
|
||||||
;; tell the world.
|
;; tell the world.
|
||||||
|
@ -240,12 +244,15 @@ for use in various places."
|
||||||
(setq mu4e--bookmark-items-cached
|
(setq mu4e--bookmark-items-cached
|
||||||
(mu4e--query-items-pick-favorite
|
(mu4e--query-items-pick-favorite
|
||||||
(mu4e--make-query-items (mu4e-bookmarks) 'bookmarks)))))
|
(mu4e--make-query-items (mu4e-bookmarks) 'bookmarks)))))
|
||||||
|
((equal type 'maildirs-with-shortcut)
|
||||||
|
(or mu4e--maildir-with-shortcut-items-cached
|
||||||
|
(setq mu4e--maildir-with-shortcut-items-cached (mu4e--make-query-items (mu4e-maildir-shortcuts) 'maildirs))))
|
||||||
((equal type 'maildirs)
|
((equal type 'maildirs)
|
||||||
(or mu4e--maildir-items-cached
|
(or mu4e--maildir-items-cached
|
||||||
(setq mu4e--maildir-items-cached
|
(setq mu4e--maildir-items-cached (mu4e--make-query-items (mu4e-maildirs) 'maildirs))))
|
||||||
(mu4e--make-query-items (mu4e-maildir-shortcuts) 'maildirs))))
|
|
||||||
((not type)
|
((not type)
|
||||||
(append (mu4e-query-items 'bookmarks)
|
(append (mu4e-query-items 'bookmarks)
|
||||||
|
(mu4e-query-items 'maildirs-with-shortcut)
|
||||||
(mu4e-query-items 'maildirs)))
|
(mu4e-query-items 'maildirs)))
|
||||||
(t
|
(t
|
||||||
(mu4e-error "No such type %s" type))))
|
(mu4e-error "No such type %s" type))))
|
||||||
|
|
Loading…
Reference in New Issue