]> git.eshelyaron.com Git - emacs.git/commitdiff
(user-mail-address): Initialize from the `EMAIL' environment variable first.
authorEli Zaretskii <eliz@gnu.org>
Sat, 22 Jul 2006 10:37:52 +0000 (10:37 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 22 Jul 2006 10:37:52 +0000 (10:37 +0000)
Document this.
(command-line): Ditto.

lisp/ChangeLog
lisp/startup.el

index a7b5ca1f3294bd67b4c0dcd0914914180630e50f..d49a24a0e8eb3eb68000f4d043358c7925ee72bc 100644 (file)
@@ -1,3 +1,9 @@
+2006-07-22  Micha\e,Ak\e(Bl Cadilhac  <michael.cadilhac@lrde.org>
+
+       * startup.el (user-mail-address): Initialize from the `EMAIL'
+       environment variable first.  Document this.
+       (command-line): Ditto.
+
 2006-07-22  Nick Roberts  <nickrob@snap.net.nz>
 
        * help-mode.el (help-function-def, help-variable-def)
index d41c812565f87adc142c7e716f582b1470481247..cb6048728abe22444e5640ad7dbb3d47ba2bc379 100644 (file)
@@ -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