Mu4e: Fix setting default context
The default-p argument to `set-email-account!` now works as intended. mu4e checks the first context on startup to determine the default and uses functions for that, so we can't really get around it by setting the bare mu4e~context-current variable.
This commit is contained in:
parent
95971d2dc7
commit
3d54471b2a
1 changed files with 2 additions and 3 deletions
|
@ -23,6 +23,7 @@ default/fallback account."
|
||||||
(when (version< mu4e-mu-version "1.4")
|
(when (version< mu4e-mu-version "1.4")
|
||||||
(when-let (address (cdr (assq 'user-mail-address letvars)))
|
(when-let (address (cdr (assq 'user-mail-address letvars)))
|
||||||
(add-to-list 'mu4e-user-mail-address-list address)))
|
(add-to-list 'mu4e-user-mail-address-list address)))
|
||||||
|
;; remove existing context with same label
|
||||||
(setq mu4e-contexts
|
(setq mu4e-contexts
|
||||||
(cl-loop for context in mu4e-contexts
|
(cl-loop for context in mu4e-contexts
|
||||||
unless (string= (mu4e-context-name context) label)
|
unless (string= (mu4e-context-name context) label)
|
||||||
|
@ -37,9 +38,7 @@ default/fallback account."
|
||||||
(string-prefix-p (format "/%s" label)
|
(string-prefix-p (format "/%s" label)
|
||||||
(mu4e-message-field msg :maildir))))
|
(mu4e-message-field msg :maildir))))
|
||||||
:vars letvars)))
|
:vars letvars)))
|
||||||
(push context mu4e-contexts)
|
(add-to-list 'mu4e-contexts context (not default-p))
|
||||||
(when default-p
|
|
||||||
(setq-default mu4e-context-current context))
|
|
||||||
context)))
|
context)))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue