mu4e: Improve personal-address handling

Make mu4e-personal-address-p safe for being called with nil.

Upgrade code that used mu4e-user-mail-address-p to
mu4e-personal-address-p.

Update docs.

Add some more helpers to mu4e-message, and avoid some byte-compiler
warnings.
This commit is contained in:
Dirk-Jan C. Binnema
2020-10-19 22:39:25 +03:00
parent 6fc294102b
commit 4985f5c959
5 changed files with 30 additions and 14 deletions

View File

@ -2766,8 +2766,7 @@ message. An example should clarify this:
((mu4e-message-contact-field-matches msg :to
"mu-discuss@@googlegroups.com")
"/mu")
;; messages sent directly to me go to /archive
;; also `mu4e-user-mail-address-p' can be used
;; messages sent directly to some spefic address me go to /private
((mu4e-message-contact-field-matches msg :to "me@@example.com")
"/private")
;; messages with football or soccer in the subject go to /football
@ -2775,9 +2774,7 @@ message. An example should clarify this:
(mu4e-message-field msg :subject))
"/football")
;; messages sent by me go to the sent folder
((find-if
(lambda (addr)
(mu4e-message-contact-field-matches msg :from addr))
((mu4e-message-sent-by-me msg
(mu4e-personal-addresses))
mu4e-sent-folder)
;; everything else goes to /archive