* lisp/net/tramp.el (tramp-default-method): scp is the default method.
[bpt/emacs.git] / lisp / startup.el
index bc51b4e..8268ac5 100644 (file)
@@ -283,7 +283,8 @@ from being initialized."
 
 (defvar init-file-debug nil)
 
-(defvar init-file-had-error nil)
+(defvar init-file-had-error nil
+  "Non-nil if there was an error loading the user's init file.")
 
 (defvar normal-top-level-add-subdirs-inode-list nil)
 
@@ -779,6 +780,7 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
   (custom-reevaluate-setting 'mouse-wheel-up-event)
   (custom-reevaluate-setting 'file-name-shadow-mode)
   (custom-reevaluate-setting 'send-mail-function)
+  (custom-reevaluate-setting 'focus-follows-mouse)
 
   ;; Register default TTY colors for the case the terminal hasn't a
   ;; terminal init file.
@@ -1113,10 +1115,7 @@ regardless of the value of this variable."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defvar fancy-splash-text
-  '((:face variable-pitch
-          "You can do basic editing with the menu bar and scroll bar \
-using the mouse.\n\n"
-          :face (variable-pitch :weight bold)
+  '((:face (variable-pitch :weight bold)
           "Important Help menu items:\n"
           :face variable-pitch
            (lambda ()
@@ -1140,8 +1139,8 @@ using the mouse.\n\n"
                 "\n")))
            :face variable-pitch "\
 Emacs FAQ\tFrequently asked questions and answers
-Read the Emacs Manual\tView the Emacs manual using Info
-\(Non)Warranty\tGNU Emacs comes with "
+View Emacs Manual\tView the Emacs manual using Info
+Absence of Warranty\tGNU Emacs comes with "
           :face (variable-pitch :slant oblique)
           "ABSOLUTELY NO WARRANTY\n"
           :face variable-pitch
@@ -1149,18 +1148,24 @@ Read the Emacs Manual\tView the Emacs manual using Info
 Copying Conditions\tConditions for redistributing and changing Emacs
 Getting New Versions\tHow to obtain the latest version of Emacs
 More Manuals / Ordering Manuals       Buying printed manuals from the FSF\n")
-  (:face variable-pitch
-          "You can do basic editing with the menu bar and scroll bar \
-using the mouse.\n\n"
-          :face (variable-pitch :weight bold)
-          "Useful File menu items:\n"
-          :face variable-pitch "\
-Exit Emacs\t(Or type Control-x followed by Control-c)
+  (:face (variable-pitch :weight bold)
+        "Useful File menu items:\n"
+        :face variable-pitch
+        "Exit Emacs\t\t(Or type "
+        :face default
+        "Control-x"
+        :face variable-pitch
+        " followed by "
+        :face default
+        "Control-c"
+        :face variable-pitch
+        ")
 Recover Crashed Session\tRecover files you were editing before a crash
 
 
 
 
+
 "
           ))
   "A list of texts to show in the middle part of splash screens.
@@ -1265,16 +1270,23 @@ where FACE is a valid face specification, as it can be used with
        "GNU Emacs is one component of the GNU/Linux operating system."
      "GNU Emacs is one component of the GNU operating system."))
   (insert "\n")
-  (if fancy-splash-outer-buffer
-      (fancy-splash-insert
-       :face 'variable-pitch
-       (substitute-command-keys
-       (concat
-        "Type \\[recenter] to begin editing"
-        (if (equal (buffer-name fancy-splash-outer-buffer)
-                   "*scratch*")
-            ".\n"
-          " your file.\n"))))))
+  (fancy-splash-insert
+   :face 'variable-pitch
+   "You can do basic editing with the menu bar and scroll bar \
+using the mouse.\n\n")
+  (when fancy-splash-outer-buffer
+    (fancy-splash-insert
+     :face 'variable-pitch
+     "Type "
+     :face 'default
+     (substitute-command-keys
+      "\\[recenter]")
+     :face 'variable-pitch
+     " to begin editing"
+     (if (equal (buffer-name fancy-splash-outer-buffer)
+               "*scratch*")
+        ".\n"
+       " your file.\n"))))
 
 (defun fancy-splash-tail ()
   "Insert the tail part of the splash screen into the current buffer."
@@ -1301,7 +1313,11 @@ where FACE is a valid face specification, as it can be used with
          t)
         (fancy-splash-insert :face '(variable-pitch :foreground "red")
                              "\n\nIf an Emacs session crashed recently, "
-                             "type M-x recover-session RET\nto recover"
+                             "type "
+                             :face '(fixed-pitch :foreground "red")
+                             "Meta-x recover-session RET"
+                             :face '(variable-pitch :foreground "red")
+                             "\nto recover"
                              " the files you were editing."))))
 
 (defun fancy-splash-screens-1 (buffer)
@@ -1346,7 +1362,6 @@ mouse."
 
 (defun fancy-splash-screens (&optional hide-on-input)
   "Display fancy splash screens when Emacs starts."
-  (setq fancy-splash-help-echo (startup-echo-area-message))
   (if hide-on-input
       (let ((old-hourglass display-hourglass)
            (fancy-splash-outer-buffer (current-buffer))
@@ -1358,18 +1373,17 @@ mouse."
        (save-selected-window
          (select-frame frame)
          (switch-to-buffer "GNU Emacs")
-         (setq tab-width 20)
          (setq splash-buffer (current-buffer))
          (catch 'stop-splashing
            (unwind-protect
-               (let ((map (make-sparse-keymap)))
+               (let ((map (make-sparse-keymap))
+                     (cursor-type nil))
                  (use-local-map map)
                  (define-key map [switch-frame] 'ignore)
                  (define-key map [t] 'fancy-splash-default-action)
                  (define-key map [mouse-movement] 'ignore)
                  (define-key map [mode-line t] 'ignore)
-                 (setq cursor-type nil
-                       display-hourglass nil
+                 (setq display-hourglass nil
                        minor-mode-map-alist nil
                        emulation-mode-map-alists nil
                        buffer-undo-list t
@@ -1380,6 +1394,7 @@ mouse."
                        timer (run-with-timer 0 fancy-splash-delay
                                              #'fancy-splash-screens-1
                                              splash-buffer))
+                 (message "%s" (startup-echo-area-message))
                  (recursive-edit))
              (cancel-timer timer)
              (setq display-hourglass old-hourglass
@@ -1390,7 +1405,7 @@ mouse."
     (if (or (window-minibuffer-p)
            (window-dedicated-p (selected-window)))
        (pop-to-buffer (current-buffer))
-      (switch-to-buffer "GNU Emacs"))
+      (switch-to-buffer "*About GNU Emacs*"))
     (setq buffer-read-only nil)
     (erase-buffer)
     (if pure-space-overflow
@@ -1400,7 +1415,11 @@ Warning Warning!!!  Pure space overflow    !!!Warning Warning
     (let (fancy-splash-outer-buffer)
       (fancy-splash-head)
       (dolist (text fancy-splash-text)
-       (apply #'fancy-splash-insert text))
+       (apply #'fancy-splash-insert text)
+       (insert "\n"))
+      (skip-chars-backward "\n")
+      (delete-region (point) (point-max))
+      (insert "\n")
       (fancy-splash-tail)
       (set-buffer-modified-p nil)
       (setq buffer-read-only t)
@@ -1577,7 +1596,7 @@ Type \\[describe-distribution] for information on getting the latest version."))
                                        auto-save-list-file-prefix)))
                 t)
                (insert "\n\nIf an Emacs session crashed recently, "
-                       "type M-x recover-session RET\nto recover"
+                       "type Meta-x recover-session RET\nto recover"
                        " the files you were editing."))
 
           ;; Display the input that we set up in the buffer.
@@ -1602,7 +1621,9 @@ Type \\[describe-distribution] for information on getting the latest version."))
             (error (pop-to-buffer (current-buffer))))))
       ;; Unwind ... ensure splash buffer is killed
       (if hide-on-input
-         (kill-buffer "GNU Emacs")))))
+         (kill-buffer "GNU Emacs")
+       (switch-to-buffer "GNU Emacs")
+       (rename-buffer "*About GNU Emacs*" t)))))
 
 
 (defun startup-echo-area-message ()
@@ -1621,8 +1642,9 @@ Type \\[describe-distribution] for information on getting the latest version."))
 (defun display-splash-screen (&optional hide-on-input)
   "Display splash screen according to display.
 Fancy splash screens are used on graphic displays,
-normal otherwise."
-  (interactive)
+normal otherwise.
+With a prefix argument, any user input hides the splash screen."
+  (interactive "P")
   (if (use-fancy-splash-screens-p)
       (fancy-splash-screens hide-on-input)
     (normal-splash-screen hide-on-input)))
@@ -1871,7 +1893,12 @@ normal otherwise."
                          (setq line 0)
                          (unless (< column 1)
                            (move-to-column (1- column)))
-                         (setq column 0))))))))
+                         (setq column 0))))))
+         ;; In unusual circumstances, the execution of Lisp code due
+         ;; to command-line options can cause the last visible frame
+         ;; to be deleted.  In this case, kill emacs to avoid an
+         ;; abort later.
+         (unless (frame-live-p (selected-frame)) (kill-emacs nil))))
 
       ;; If 3 or more files visited, and not all visible,
       ;; show user what they all are.  But leave the last one current.