emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Proposal] Retrieve MAILADDRESS as user-mail-address default value.


From: Michaël Cadilhac
Subject: [Proposal] Retrieve MAILADDRESS as user-mail-address default value.
Date: Wed, 19 Jul 2006 13:54:30 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

Hi!

A  guy  on the  list  screwed  its ChangeLog  entry  by  making it  in
emacs -Q, well, I'm not the last one that would make the error :-)

I started to write him « Maybe we can set environment variables to fix
that once and for  all! Let's see, for the full name,  we just have to
use NAME. And for the email, we... Oh, what the heck ! »

Hum... Well, I propose the following change.

Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.9820
diff -c -0 -r1.9820 ChangeLog
*** lisp/ChangeLog      17 Jul 2006 04:07:48 -0000      1.9820
--- lisp/ChangeLog      19 Jul 2006 11:21:17 -0000
***************
*** 0 ****
--- 1,6 ----
+ 2006-07-19  Michaël Cadilhac  <address@hidden>
+ 
+       * startup.el (user-mail-address): Initialize with `MAILADDRESS'
+       environment variable first. Document it.
+       (command-line): Ditto.
+ 
Index: lisp/startup.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/startup.el,v
retrieving revision 1.409
diff -c -r1.409 startup.el
*** lisp/startup.el     24 May 2006 13:22:12 -0000      1.409
--- lisp/startup.el     19 Jul 2006 11:44:05 -0000
***************
*** 247,260 ****
    :group 'mail)
  
  (defcustom user-mail-address (if command-line-processed
!                                (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'."
    :type 'string
    :group 'mail)
  
--- 247,262 ----
    :group 'mail)
  
  (defcustom user-mail-address (if command-line-processed
!                                (or (getenv "MAILADDRESS")
!                                    (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 with environment variable `MAILADDRESS' 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,985 ****
  
      ;; 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)))))
  
      ;; Originally face attributes were specified via
      ;; `font-lock-face-attributes'.  Users then changed the default
--- 979,988 ----
  
      ;; Do this here in case the init file sets mail-host-address.
      (if (equal user-mail-address "")
!       (setq user-mail-address (or (getenv "MAILADDRESS")
!                                   (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
If needed, the following documents it in NEWS :

Index: etc/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/etc/ChangeLog,v
retrieving revision 1.430
diff -c -r1.430 ChangeLog
*** etc/ChangeLog       14 Jul 2006 15:04:08 -0000      1.430
--- etc/ChangeLog       19 Jul 2006 11:42:59 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2006-07-19  Michaël Cadilhac  <address@hidden>
+ 
+       * NEWS: Document `user-mail-address' initialization.
+ 
  2006-07-14  Kim F. Storm  <address@hidden>
  
        * PROBLEMS: Emacs now requires ws2_32.dll on Windows.
Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.1376
diff -c -r1.1376 NEWS
*** etc/NEWS    14 Jul 2006 23:29:43 -0000      1.1376
--- etc/NEWS    19 Jul 2006 11:42:59 -0000
***************
*** 238,243 ****
--- 238,248 ----
  modified buffers, it saves the abbrevs too if they have changed.  It
  can do this either silently or asking for confirmation first,
  according to the value of `save-abbrevs'.
+ 
+ +++
+ ** Initialize `user-mail-address' with env variable `MAILADDRESS' first.
+ The variable `user-mail-address' is initialized with the environment
+ variable `MAILADDRESS' before defaulting it to `user-login-name'@host.

  * Incompatible Editing Changes in Emacs 22.1
  
TIA !

-- 
 |      Michaël `Micha' Cadilhac   |  All your base are belong to us.       |
 |         Epita/LRDE Promo 2007   |    You have no change to survive       |
 | http://www.lrde.org/~cadilh_m   |       make your time, hahaha.          |
 `--  -   JID: address@hidden --'       -- Zero Wings               -  --'

Attachment: pgpGhA9IrmRl7.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]