mirror of https://github.com/djcb/mu.git
Allow to ignore addresses when doing wide replies
Introduce a new variable, mu4e-compose-reply-ignore-address, which matches addresses to be skipped when doing wide replies. This is identical in behavior to messages-dont-reply-to-names from message.el (which we default on).
This commit is contained in:
parent
ea40939810
commit
0a5224c4c8
|
@ -191,6 +191,30 @@ the list form the original."
|
|||
reply-to)))
|
||||
|
||||
|
||||
(defun mu4e~strip-ignored-addresses (addrs)
|
||||
"Return all the addresses in ADDRS not matching
|
||||
`mu4e-compose-reply-ignore-address'."
|
||||
(cond
|
||||
((null mu4e-compose-reply-ignore-address)
|
||||
addrs)
|
||||
((functionp mu4e-compose-reply-ignore-address)
|
||||
(remove-if
|
||||
(lambda (elt)
|
||||
(funcall mu4e-compose-reply-ignore-address (cdr elt)))
|
||||
addrs))
|
||||
(t
|
||||
;; regexp or list of regexps
|
||||
(let* ((regexp mu4e-compose-reply-ignore-address)
|
||||
(regexp (if (listp regexp)
|
||||
(mapconcat (lambda (elt) (concat "\\(" elt "\\)"))
|
||||
regexp "\\|")
|
||||
regexp)))
|
||||
(remove-if
|
||||
(lambda (elt)
|
||||
(string-match regexp (cdr elt)))
|
||||
addrs)))))
|
||||
|
||||
|
||||
(defun mu4e~draft-create-cc-lst (origmsg reply-all)
|
||||
"Create a list of address for the Cc: in a new message, based on
|
||||
the original message ORIGMSG, and whether it's a reply-all."
|
||||
|
@ -211,6 +235,8 @@ the original message ORIGMSG, and whether it's a reply-all."
|
|||
(mu4e~draft-address-cell-equal cc-cell to-cell))
|
||||
(mu4e~draft-create-to-lst origmsg)))
|
||||
cc-lst))
|
||||
;; remove ignored addresses
|
||||
(cc-lst (mu4e~strip-ignored-addresses cc-lst))
|
||||
;; finally, we need to remove ourselves from the cc-list
|
||||
;; unless mu4e-compose-keep-self-cc is non-nil
|
||||
(cc-lst
|
||||
|
|
|
@ -387,6 +387,18 @@ are needed for sorting the contacts."
|
|||
:type 'string
|
||||
:group 'mu4e-compose)
|
||||
|
||||
(defcustom mu4e-compose-reply-ignore-address message-dont-reply-to-names
|
||||
"Addresses to prune when doing wide replies.
|
||||
|
||||
This can be a regexp matching the address, a list of regexps
|
||||
or a predicate function. A value of nil keeps all the addresses."
|
||||
:type '(choice
|
||||
(const nil)
|
||||
function
|
||||
string
|
||||
(repeat string))
|
||||
:group 'mu4e-compose)
|
||||
|
||||
(defcustom mu4e-compose-reply-to-address nil
|
||||
"The Reply-To address (if this, for some reason, is not equal to
|
||||
the From: address.)"
|
||||
|
|
Loading…
Reference in New Issue