aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/mail
diff options
context:
space:
mode:
authorGlenn Morris2017-02-17 19:06:15 -0500
committerGlenn Morris2017-02-17 19:06:15 -0500
commit8675f9c8b8a002530d0c4e0263bb3d4cf3a649fa (patch)
tree458537063b7b9974209a0fbedcba2799247f2153 /lisp/mail
parentf3eaab0a3749822592ddf36e591dcafd31451177 (diff)
downloademacs-8675f9c8b8a002530d0c4e0263bb3d4cf3a649fa.tar.gz
emacs-8675f9c8b8a002530d0c4e0263bb3d4cf3a649fa.zip
Ensure that user-mail-address always has a value
* lisp/startup.el (user-mail-address): Initialize in the normal way. (command-line): Reset user-mail-address if needed using standard custom machinery. * lisp/mail/feedmail.el (feedmail-fiddle-from): * lisp/mail/rmail.el (rmail-unknown-mail-followup-to): * lisp/mail/rmailsum.el (rmail-header-summary): Simplify now that user-mail-address is always set. ; * doc/lispref/os.texi (System Environment): Remove fixme comment.
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/feedmail.el19
-rw-r--r--lisp/mail/rmail.el7
-rw-r--r--lisp/mail/rmailsum.el10
3 files changed, 8 insertions, 28 deletions
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el
index 53791565bb1..e0bd4590b13 100644
--- a/lisp/mail/feedmail.el
+++ b/lisp/mail/feedmail.el
@@ -2759,24 +2759,17 @@ return that value."
2759 (cond 2759 (cond
2760 ;; nil means do nothing 2760 ;; nil means do nothing
2761 ((eq nil feedmail-from-line) nil) 2761 ((eq nil feedmail-from-line) nil)
2762 ;; t is the same a using the default computation, so compute it and recurse 2762 ;; t is the same as using the default computation, so compute it and recurse
2763 ;; user-full-name suggested by kpc@ptolemy.arc.nasa.gov (=Kimball Collins) 2763 ;; user-full-name suggested by kpc@ptolemy.arc.nasa.gov (=Kimball Collins)
2764 ;; improvement using user-mail-address suggested by 2764 ;; improvement using user-mail-address suggested by
2765 ;; gray@austin.apc.slb.com (Douglas Gray Stephens) 2765 ;; gray@austin.apc.slb.com (Douglas Gray Stephens)
2766 ;; improvement using mail-host-address suggested by "Jason Eisner" <jason@cs.jhu.edu>
2767 ;; ((this situation really is hopeless, though)
2768 ((eq t feedmail-from-line) 2766 ((eq t feedmail-from-line)
2769 (let ((feedmail-from-line 2767 (let ((feedmail-from-line
2770 (let ((at-stuff 2768 (cond
2771 (if (> (length user-mail-address) 0) 2769 ((eq mail-from-style nil) user-mail-address)
2772 user-mail-address 2770 ((eq mail-from-style 'parens) (concat user-mail-address " (" (user-full-name) ")"))
2773 (concat (user-login-name) "@" 2771 ((eq mail-from-style 'angles) (concat "\"" (user-full-name) "\" <" user-mail-address ">"))
2774 (or mail-host-address (system-name)))))) 2772 )))
2775 (cond
2776 ((eq mail-from-style nil) at-stuff)
2777 ((eq mail-from-style 'parens) (concat at-stuff " (" (user-full-name) ")"))
2778 ((eq mail-from-style 'angles) (concat "\"" (user-full-name) "\" <" at-stuff ">"))
2779 ))))
2780 (feedmail-fiddle-from))) 2773 (feedmail-fiddle-from)))
2781 2774
2782 ;; if it's a string, simply make a fiddle-plex out of it and recurse 2775 ;; if it's a string, simply make a fiddle-plex out of it and recurse
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 695638fa062..4b72b3562d1 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -2665,12 +2665,7 @@ Ask the user whether to add that list name to `mail-mailing-lists'."
2665 (concat "^\\(" 2665 (concat "^\\("
2666 (regexp-quote (user-login-name)) 2666 (regexp-quote (user-login-name))
2667 "\\($\\|@\\)\\|" 2667 "\\($\\|@\\)\\|"
2668 (regexp-quote 2668 (regexp-quote user-mail-address)
2669 (if (> (length user-mail-address) 0)
2670 user-mail-address
2671 (concat (user-login-name) "@"
2672 (or mail-host-address
2673 (system-name)))))
2674 "\\>\\)")) 2669 "\\>\\)"))
2675 addr)) 2670 addr))
2676 (y-or-n-p 2671 (y-or-n-p
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 729538173a0..37ac46c6af6 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -753,15 +753,7 @@ the message being processed."
753 (concat "^\\(" 753 (concat "^\\("
754 (regexp-quote (user-login-name)) 754 (regexp-quote (user-login-name))
755 "\\($\\|@\\)\\|" 755 "\\($\\|@\\)\\|"
756 (regexp-quote 756 (regexp-quote user-mail-address)
757 ;; Don't lose if run from init file
758 ;; where user-mail-address is not
759 ;; set yet.
760 (if (> (length user-mail-address) 0)
761 user-mail-address
762 (concat (user-login-name) "@"
763 (or mail-host-address
764 (system-name)))))
765 "\\>\\)")) 757 "\\>\\)"))
766 from)) 758 from))
767 ;; No From field, or it's this user. 759 ;; No From field, or it's this user.