mirror of https://github.com/djcb/mu.git
Updates to mu4e-contacts.el
* mu4e/mu4e-contacts.el (mu4e-personal-address-p): Fix docstring error (return nil *only if* the address does not match any of the personal addresses, not the other way around). Unwrap unnecessary (if COND t nil) to just COND because its caller `seq-find' only distinguishes between nil and non-nil. (mu4e-personal-address): Add space in defun between name and args. Ensure double space after a sentence ends. Convert a duplicated call of (mu4e-server-properties) into using when-let and reusing its result.
This commit is contained in:
parent
581f8d7e92
commit
1ed1e486d4
|
@ -137,21 +137,21 @@ The address are either plain e-mail address or /regular
|
|||
address patterns (if any)."
|
||||
(seq-remove
|
||||
(lambda (addr) (and no-regexp (string-match-p "^/.*/" addr)))
|
||||
(when (mu4e-server-properties)
|
||||
(plist-get (mu4e-server-properties) :personal-addresses))))
|
||||
(when-let ((props (mu4e-server-properties)))
|
||||
(plist-get props :personal-addresses))))
|
||||
|
||||
(defun mu4e-personal-address-p (addr)
|
||||
"Is ADDR a personal address?
|
||||
Evaluate to nil if ADDR matches any of the personal addresses.
|
||||
Uses (mu4e-personal-addresses) for the addresses with both the plain
|
||||
addresses and /regular expressions/."
|
||||
Evaluate to nil if ADDR does not match any of the personal
|
||||
addresses. Uses \\=(mu4e-personal-addresses) for the addresses
|
||||
with both the plain addresses and /regular expressions/."
|
||||
(when addr
|
||||
(seq-find
|
||||
(lambda (m)
|
||||
(if (string-match "/\\(.*\\)/" m)
|
||||
(let ((rx (match-string 1 m))
|
||||
(case-fold-search t))
|
||||
(if (string-match rx addr) t nil))
|
||||
(string-match rx addr))
|
||||
(eq t (compare-strings addr nil nil m nil nil 'case-insensitive))))
|
||||
(mu4e-personal-addresses))))
|
||||
|
||||
|
|
Loading…
Reference in New Issue