mu4e: make mu4e refresh itself
update using the 'ping' function, so read/unread counts get updated. add a 'g' binding for the main-view.
This commit is contained in:
@ -59,6 +59,7 @@
|
||||
(define-key map "A" 'mu4e-about)
|
||||
(define-key map "N" 'mu4e-news)
|
||||
(define-key map "H" 'mu4e-display-manual)
|
||||
(define-key map "g" 'mu4e)
|
||||
map)
|
||||
|
||||
"Keymap for the *mu4e-main* buffer.")
|
||||
|
||||
@ -806,28 +806,24 @@ first. If mu4e is already running, execute function FUNC (if
|
||||
non-nil). Otherwise, check various requireme`'nts, then start mu4e.
|
||||
When successful, call FUNC (if non-nil) afterwards."
|
||||
;; if we're already running, simply go to the main view
|
||||
(if (mu4e-running-p) ;; already running?
|
||||
(when func (funcall func)) ;; yes! run func if defined
|
||||
(progn
|
||||
;; no! try to set a context, do some checks, set up pong handler and ping
|
||||
;; the server maybe switch the context
|
||||
(mu4e~context-autoswitch nil mu4e-context-policy)
|
||||
(mu4e~check-requirements)
|
||||
;; set up the 'pong' handler func
|
||||
(setq mu4e-pong-func (lambda (props) (mu4e~pong-handler props func)))
|
||||
;; wake up server
|
||||
(mu4e~proc-ping
|
||||
(mapcar ;; send it a list of queries we'd like to see read/unread info
|
||||
;; for.
|
||||
(lambda(bm) (plist-get bm :query))
|
||||
(seq-filter (lambda (bm) ;; exclude bookmarks that are not strings,
|
||||
;; and with these flags.
|
||||
(and (stringp (plist-get bm :query))
|
||||
(not (or (plist-get bm :hide) (plist-get bm :hide-unread)))))
|
||||
(mu4e-bookmarks))))
|
||||
;; maybe request the list of contacts, automatically refresh after
|
||||
;; reindexing
|
||||
(mu4e~request-contacts-maybe))))
|
||||
(unless (mu4e-running-p) ;; already running?
|
||||
;; no! try to set a context, do some checks, set up pong handler and ping
|
||||
;; the server maybe switch the context
|
||||
(mu4e~context-autoswitch nil mu4e-context-policy)
|
||||
(mu4e~check-requirements))
|
||||
(setq mu4e-pong-func (lambda (props) (mu4e~pong-handler props func)))
|
||||
(mu4e~proc-ping
|
||||
(mapcar ;; send it a list of queries we'd like to see read/unread info
|
||||
;; for.
|
||||
(lambda(bm) (plist-get bm :query))
|
||||
(seq-filter (lambda (bm) ;; exclude bookmarks that are not strings,
|
||||
;; and with these flags.
|
||||
(and (stringp (plist-get bm :query))
|
||||
(not (or (plist-get bm :hide) (plist-get bm :hide-unread)))))
|
||||
(mu4e-bookmarks))))
|
||||
;; maybe request the list of contacts, automatically refreshed after
|
||||
;; reindexing
|
||||
(unless mu4e~contacts (mu4e~request-contacts-maybe)))
|
||||
|
||||
(defun mu4e-clear-caches ()
|
||||
"Clear any cached resources."
|
||||
|
||||
Reference in New Issue
Block a user