mu4e: support regexp patterns for personal addresses

This commit is contained in:
Dirk-Jan C. Binnema
2020-10-17 10:14:04 +03:00
parent dbff5671dd
commit 5e069d9a6f
8 changed files with 43 additions and 39 deletions

View File

@ -275,19 +275,17 @@ expressions, in which case any of those are tried for a match."
(and email (string-match rx email)))))
(mu4e-message-field msg cfield))))))
(defun mu4e-message-contact-field-matches-me (msg cfield)
"Does contact-field CFIELD in MSG match me?
Checks whether any of the of the contacts in field
CFIELD (either :to, :from, :cc or :bcc) of msg MSG matches *me*,
that is, any of the e-mail address in
`(mu4e-personal-addresses)'. Returns the contact cell that
(defun mu4e-message-contact-field-matches-me (msg cfield)
"Does contact-field CFIELD in MSG match me? Checks whether any
of the of the contacts in field CFIELD (either :to, :from, :cc or
:bcc) of msg MSG matches *me*, that is, any of the addresses for
which `mu4e-personal-address-p' return t. Returns the contact
cell that matched, or nil."
(cl-find-if
(lambda (cc-cell)
(cl-member-if
(lambda (addr)
(string= (downcase addr) (downcase (cdr cc-cell))))
(mu4e-personal-addresses)))
(lambda (addr)
(mu4e-personal-address-p (cdr cc-cell)))
(mu4e-message-field msg cfield)))))
(defsubst mu4e-message-part-field (msgpart field)