From: Eli Zaretskii Date: Sat, 22 Jul 2006 10:37:52 +0000 (+0000) Subject: (user-mail-address): Initialize from the `EMAIL' environment variable first. X-Git-Tag: emacs-pretest-22.0.90~1293 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cee0c9967372fd59cb08630c1b28c3d3aa68cf83;p=emacs.git (user-mail-address): Initialize from the `EMAIL' environment variable first. Document this. (command-line): Ditto. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a7b5ca1f329..d49a24a0e8e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-07-22 Micha,Ak(Bl Cadilhac + + * startup.el (user-mail-address): Initialize from the `EMAIL' + environment variable first. Document this. + (command-line): Ditto. + 2006-07-22 Nick Roberts * help-mode.el (help-function-def, help-variable-def) diff --git a/lisp/startup.el b/lisp/startup.el index d41c812565f..cb6048728ab 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -247,14 +247,16 @@ this variable usefully is to set it while building and dumping Emacs." :group 'mail) (defcustom user-mail-address (if command-line-processed - (concat (user-login-name) "@" - (or mail-host-address - (system-name))) + (or (getenv "EMAIL") + (concat (user-login-name) "@" + (or mail-host-address + (system-name)))) ;; Empty string means "not set yet". "") "*Full mailing address of this user. -This is initialized based on `mail-host-address', -after your init file is read, in case it sets `mail-host-address'." +This is initialized with environment variable `EMAIL' or, as a +fallback, using `mail-host-address'. This is done after your +init file is read, in case it sets `mail-host-address'." :type 'string :group 'mail) @@ -977,9 +979,10 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." ;; Do this here in case the init file sets mail-host-address. (if (equal user-mail-address "") - (setq user-mail-address (concat (user-login-name) "@" - (or mail-host-address - (system-name))))) + (setq user-mail-address (or (getenv "EMAIL") + (concat (user-login-name) "@" + (or mail-host-address + (system-name)))))) ;; Originally face attributes were specified via ;; `font-lock-face-attributes'. Users then changed the default