Josiah Schwab <
jsc...@gmail.com> writes:
> Can you solve your problem with a bookmark? Something like
>
> (defun jws/mu4e-addressed-to-me ()
> (mapconcat (lambda (a) (format "to:%s" a)) mu4e-user-mail-address-list " OR "))
>
> (setq mu4e-bookmarks
> `( (,(jws/mu4e-addressed-to-me) "To Me" ?m)))
that's what I had in mind but was looking for a better solution.
> You likely want to replace the lambda with something more general (to &
> cc, etc.)
the 'recip' field matches to, cc and bcc directly.
Here is what I came up with:
(setq my:mu4e-account-alist
'(("GMail"
...
("Pro"
...
("Lille1"
...
("Perso"
...)))
(defun my:mu4e-account-names ()
(mapcar #'car my:mu4e-account-alist))
(defun my:mu4e-addressed-to-me ()
(mapconcat
(lambda (address) (format "recip:%s" address))
mu4e-user-mail-address-list " OR "))
(defun my:mu4e-in-inbox ()
(mapconcat
(lambda (account-name) (format "maildir:/%s/INBOX" account-name))
(my:mu4e-account-names)
" OR "))
(add-to-list 'mu4e-bookmarks
`(,(concat
"("
(my:mu4e-addressed-to-me)
") AND ("
(my:mu4e-in-inbox)
" OR maildir:\"/GMail/All Mail\") AND (tag:\\\\Inbox OR NOT maildir:\"/GMail/All Mail\")") "Inbox" ?i))
Yes, that's a bit complex :-).
Thanks for your help