(symbol-file): Remove unused variable `functions'.
[bpt/emacs.git] / lisp / startup.el
index 8afdb8c..4ec30fd 100644 (file)
@@ -326,7 +326,12 @@ is less convenient."
   :type '(choice (const nil) string)
   :group 'mail)
 
-(defcustom user-mail-address nil
+(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'."
@@ -424,6 +429,9 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
       (save-excursion
        (set-buffer (get-buffer "*Messages*"))
        (setq default-directory dir)))
+    ;; `user-full-name' is now known; reset its standard-value here.
+    (put 'user-full-name 'standard-value
+        (list (default-value 'user-full-name)))
     ;; For root, preserve owner and group when editing files.
     (if (equal (user-uid) 0)
        (setq backup-by-copying-when-mismatch t))
@@ -908,11 +916,23 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
                      (setq user-init-file t)
                      (load user-init-file-1 t t)
                      
-                     ;; If we did not find the user's init file,
-                     ;; set user-init-file conclusively to nil;
-                     ;; don't let it be set from default.el.
-                     (if (eq user-init-file t)
-                         (setq user-init-file user-init-file-1))
+                     (when (eq user-init-file t)
+                       ;; If we did not find ~/.emacs, try
+                       ;; ~/.emacs.d/.emacs.
+                       (let ((otherfile
+                              (expand-file-name
+                               (file-name-nondirectory user-init-file-1)
+                               (file-name-as-directory
+                                (expand-file-name
+                                 ".emacs.d"
+                                 (file-name-directory user-init-file-1))))))
+                         (load otherfile t t)
+
+                         ;; If we did not find the user's init file,
+                         ;; set user-init-file conclusively.
+                         ;; Don't let it be set from default.el.
+                         (when (eq user-init-file t)
+                           (setq user-init-file user-init-file-1))))
                      
                      ;; If we loaded a compiled file, set
                      ;; `user-init-file' to the source version if that
@@ -1007,7 +1027,7 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
        (set-language-environment current-language-environment)))
     
     ;; Do this here in case the init file sets mail-host-address.
-    (or user-mail-address
+    (if (equal user-mail-address "")
        (setq user-mail-address (concat (user-login-name) "@"
                                        (or mail-host-address
                                            (system-name)))))
@@ -1197,12 +1217,10 @@ where FACE is a valid face specification, as it can be used with
          (insert-image img (propertize "xxx" 'help-echo help-echo
                                        'keymap map)))
        (insert "\n"))))
-  (if (eq system-type 'gnu/linux)
-      (fancy-splash-insert
-       :face '(variable-pitch :foreground "red")
-       "GNU Emacs is one component of a Linux-based GNU system.")
-    (fancy-splash-insert
-     :face '(variable-pitch :foreground "red")
+  (fancy-splash-insert
+   :face '(variable-pitch :foreground "red")
+   (if (eq system-type 'gnu/linux)
+       "GNU Emacs is one component of the GNU/Linux operating system."
      "GNU Emacs is one component of the GNU operating system."))
   (insert "\n")
   (unless (equal (buffer-name fancy-splash-outer-buffer) "*scratch*")
@@ -1322,14 +1340,15 @@ we put it on this frame."
   (when (or (and (display-color-p)
                 (image-type-available-p 'xpm))
            (image-type-available-p 'pbm))
-    (let* ((frame (fancy-splash-frame))
-          (img (create-image (or fancy-splash-image
-                                 (if (and (display-color-p)
-                                          (image-type-available-p 'xpm))
-                                     "splash.xpm" "splash.pbm"))))
-          (image-height (and img (cdr (image-size img))))
-          (window-height (1- (window-height (frame-selected-window frame)))))
-      (> window-height (+ image-height 19)))))
+    (let ((frame (fancy-splash-frame)))
+      (when frame
+       (let* ((img (create-image (or fancy-splash-image
+                                     (if (and (display-color-p)
+                                              (image-type-available-p 'xpm))
+                                         "splash.xpm" "splash.pbm"))))
+              (image-height (and img (cdr (image-size img))))
+              (window-height (1- (window-height (frame-selected-window frame)))))
+         (> window-height (+ image-height 19)))))))
 
 
 (defun normal-splash-screen ()
@@ -1345,9 +1364,10 @@ we put it on this frame."
            ;; each piece of output starts with one or two newlines
            ;; and does not end with any newlines.
            (insert "Welcome to GNU Emacs")
-           (if (eq system-type 'gnu/linux)
-               (insert ", one component of a Linux-based GNU system."))
-           (insert "\n")
+           (insert
+            (if (eq system-type 'gnu/linux)
+                ", one component of the GNU/Linux operating system.\n"
+              ", a part of the GNU operating system.\n"))
 
            (unless (equal (buffer-name prev-buffer) "*scratch*")
              (insert (substitute-command-keys