mirror of https://github.com/djcb/mu.git
mu4e-contacts: add mu4e-personal-or-alternative-address
This commit is contained in:
parent
2a28b4efbb
commit
24f1fe8d45
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(require 'cl-lib)
|
(require 'cl-lib)
|
||||||
|
(require 'message)
|
||||||
(require 'mu4e-helpers)
|
(require 'mu4e-helpers)
|
||||||
(require 'mu4e-update)
|
(require 'mu4e-update)
|
||||||
|
|
||||||
|
@ -79,13 +80,6 @@ their canonical counterpart; useful as an example."
|
||||||
(mail (plist-get contact :mail)))
|
(mail (plist-get contact :mail)))
|
||||||
(list :name name :mail mail)))
|
(list :name name :mail mail)))
|
||||||
|
|
||||||
(make-obsolete-variable 'mu4e-contact-rewrite-function
|
|
||||||
"mu4e-contact-process-function (see docstring)"
|
|
||||||
"mu4e 1.3.2")
|
|
||||||
(make-obsolete-variable 'mu4e-compose-complete-ignore-address-regexp
|
|
||||||
"mu4e-contact-process-function (see docstring)"
|
|
||||||
"mu4e 1.3.2")
|
|
||||||
|
|
||||||
(defcustom mu4e-contact-process-function
|
(defcustom mu4e-contact-process-function
|
||||||
(lambda(addr)
|
(lambda(addr)
|
||||||
(cond
|
(cond
|
||||||
|
@ -154,18 +148,18 @@ with both the plain addresses and /regular expressions/."
|
||||||
(eq t (compare-strings addr nil nil m nil nil 'case-insensitive))))
|
(eq t (compare-strings addr nil nil m nil nil 'case-insensitive))))
|
||||||
(mu4e-personal-addresses))))
|
(mu4e-personal-addresses))))
|
||||||
|
|
||||||
(define-obsolete-function-alias 'mu4e-user-mail-address-p
|
(defun mu4e-personal-or-alternative-address ()
|
||||||
'mu4e-personal-address-p "1.5.5")
|
"Return a function matching user's addresses.
|
||||||
|
Function takes one parameter, an address. This glues mu4e's
|
||||||
|
personal addresses together with gnus'
|
||||||
;; don't use the older vars anymore
|
`message-alternative-emails'."
|
||||||
(make-obsolete-variable 'mu4e-user-mail-address-regexp
|
(let* ((alts message-alternative-emails))
|
||||||
'mu4e-user-mail-address-list "0.9.9.x")
|
(lambda (addr)
|
||||||
(make-obsolete-variable 'mu4e-my-email-addresses
|
(or (mu4e-personal-address-p addr)
|
||||||
'mu4e-user-mail-address-list "0.9.9.x")
|
(cond
|
||||||
(make-obsolete-variable 'mu4e-user-mail-address-list
|
((functionp alts) (funcall alts addr))
|
||||||
"determined by server; see `mu4e-personal-addresses'."
|
((stringp alts) (string-match alts addr))
|
||||||
"1.3.8")
|
(t nil))))))
|
||||||
|
|
||||||
|
|
||||||
;; Helpers
|
;; Helpers
|
||||||
|
@ -192,7 +186,7 @@ matches, nil is returned, if not, it returns a symbol
|
||||||
((= (aref ph 0) ?\")
|
((= (aref ph 0) ?\")
|
||||||
(if (string-match "\"\\([^\"\\\n]\\|\\\\.\\|\\\\\n\\)*\"" ph)
|
(if (string-match "\"\\([^\"\\\n]\\|\\\\.\\|\\\\\n\\)*\"" ph)
|
||||||
'rfc822-quoted-string
|
'rfc822-quoted-string
|
||||||
'rfc822-containing-quote)) ; starts with quote, but doesn't end with one
|
'rfc822-containing-quote)) ; starts with quote, but doesn't end with one
|
||||||
((string-match-p "[\"]" ph) 'rfc822-containing-quote)
|
((string-match-p "[\"]" ph) 'rfc822-containing-quote)
|
||||||
((string-match-p "[\000-\037()\*<>@,;:\\\.]+" ph) nil)
|
((string-match-p "[\000-\037()\*<>@,;:\\\.]+" ph) nil)
|
||||||
(t 'rfc822-atom)))
|
(t 'rfc822-atom)))
|
||||||
|
|
Loading…
Reference in New Issue