]> code.delx.au - gnu-emacs/blobdiff - lisp/startup.el
Merge from emacs--rel--22
[gnu-emacs] / lisp / startup.el
index e2a80088a3e09cff0c195e44c88808b01e874d1a..91902d105ace0278b7896b0f70256dda2d166075 100644 (file)
 
 (defcustom inhibit-splash-screen nil
   "Non-nil inhibits the startup screen.
-It also inhibits display of the initial message in the *scratch* buffer.
+It also inhibits display of the initial message in the `*scratch*' buffer.
 
-This is for use in your personal init file, once you are familiar
-with the contents of the startup screen."
+This is for use in your personal init file (but NOT site-start.el), once
+you are familiar with the contents of the startup screen."
   :type 'boolean
   :group 'initialization)
 
@@ -195,7 +195,7 @@ Emacs runs this hook after processing the command line arguments and loading
 the user's init file.")
 
 (defcustom initial-major-mode 'lisp-interaction-mode
-  "Major mode command symbol to use for the initial *scratch* buffer."
+  "Major mode command symbol to use for the initial `*scratch*' buffer."
   :type 'function
   :group 'initialization)
 
@@ -510,7 +510,7 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
 ;; Handle the X-like command-line arguments "-fg", "-bg", "-name", etc.
 (defun tty-handle-args (args)
   (let (rest)
-    (message "%s" args)
+    (message "%S" args)
     (while (and args
                (not (equal (car args) "--")))
       (let* ((argi (pop args))
@@ -645,22 +645,28 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
 
   (set-locale-environment nil)
 
-  ;; Convert preloaded file names to absolute.
-  (let ((lisp-dir
-        (file-truename
-         (file-name-directory
-          (locate-file "simple" load-path
-                       (get-load-suffixes))))))
-
-    (setq load-history
-         (mapcar (lambda (elt)
-                   (if (and (stringp (car elt))
-                            (not (file-name-absolute-p (car elt))))
-                       (cons (concat lisp-dir
-                                     (car elt))
-                             (cdr elt))
-                     elt))
-                 load-history)))
+  ;; Convert preloaded file names in load-history to absolute.
+  (let ((simple-file-name
+        ;; Look for simple.el or simple.elc and use their directory
+        ;; as the place where all Lisp files live.
+        (locate-file "simple" load-path (get-load-suffixes)))
+       lisp-dir)
+    ;; Don't abort if simple.el cannot be found, but print a warning.
+    (if (null simple-file-name)
+       (progn
+         (princ "Warning: Could not find simple.el nor simple.elc"
+                'external-debugging-output)
+         (terpri 'external-debugging-output))
+      (setq lisp-dir (file-truename (file-name-directory simple-file-name)))
+      (setq load-history
+           (mapcar (lambda (elt)
+                     (if (and (stringp (car elt))
+                              (not (file-name-absolute-p (car elt))))
+                         (cons (concat lisp-dir
+                                       (car elt))
+                               (cdr elt))
+                       elt))
+                   load-history))))
 
   ;; Convert the arguments to Emacs internal representation.
   (let ((args (cdr command-line-args)))
@@ -949,7 +955,11 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
              (deactivate-mark)))
 
        ;; If the user has a file of abbrevs, read it.
-       (if (file-exists-p abbrev-file-name)
+        ;; FIXME: after the 22.0 release this should be changed so
+       ;; that it does not read the abbrev file when -batch is used
+       ;; on the command line.
+       (when (and (file-exists-p abbrev-file-name)
+                  (file-readable-p abbrev-file-name))
            (quietly-read-abbrev-file abbrev-file-name))
 
        ;; If the abbrevs came entirely from the init file or the
@@ -1132,28 +1142,33 @@ regardless of the value of this variable."
                ;; If there is a specific tutorial for the current language
                ;; environment and it is not English, append its title.
                (concat
-                "Emacs Tutorial\tLearn how to use Emacs efficiently"
+                "Emacs Tutorial\t\tLearn how to use Emacs efficiently"
                 (if (string= en tut)
                     ""
                   (concat " (" title ")"))
                 "\n")))
            :face variable-pitch "\
-Emacs FAQ\tFrequently asked questions and answers
-View Emacs Manual\tView the Emacs manual using Info
+Emacs FAQ\t\tFrequently asked questions and answers
+View Emacs Manual\t\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
           "\
-Copying Conditions\tConditions for redistributing and changing Emacs
+Copying Conditions\t\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 :weight bold)
-        "To quit a partially entered command, type "
+  (:face variable-pitch
+        "\nTo quit a partially entered command, type "
         :face default
         "Control-g"
         :face variable-pitch
-        "."
+        ".
+
+Emacs Guided Tour\t\tSee http://www.gnu.org/software/emacs/tour/
+
+"
+        :face (variable-pitch :weight bold)
         "Useful File menu items:\n"
         :face variable-pitch
         "Exit Emacs\t\t(Or type "
@@ -1165,13 +1180,7 @@ More Manuals / Ordering Manuals       Buying printed manuals from the FSF\n")
         "Control-c"
         :face variable-pitch
         ")
-Recover Crashed Session\tRecover files you were editing before a crash
-
-
-
-
-
-"
+Recover Crashed Session\tRecover files you were editing before a crash\n"
           ))
   "A list of texts to show in the middle part of splash screens.
 Each element in the list should be a list of strings or pairs
@@ -1285,8 +1294,7 @@ using the mouse.\n\n")
      :face 'variable-pitch
      "Type "
      :face 'default
-     (substitute-command-keys
-      "\\[recenter]")
+     "Control-l"
      :face 'variable-pitch
      " to begin editing"
      (if (equal (buffer-name fancy-splash-outer-buffer)
@@ -1303,7 +1311,7 @@ using the mouse.\n\n")
                         (emacs-version)
                         "\n"
                         :face '(variable-pitch :height 0.5)
-                        "Copyright (C) 2007 Free Software Foundation, Inc.")
+                        emacs-copyright)
     (and auto-save-list-file-prefix
         ;; Don't signal an error if the
         ;; directory for auto-save-list files
@@ -1388,6 +1396,7 @@ the user caused an input event that is bound in `special-event-map'"
        (save-selected-window
          (select-frame frame)
          (switch-to-buffer " GNU Emacs")
+         (make-local-variable 'cursor-type)
          (setq splash-buffer (current-buffer))
          (catch 'stop-splashing
            (unwind-protect
@@ -1984,13 +1993,13 @@ With a prefix argument, any user input hides the splash screen."
     (with-no-warnings
      (setq menubar-bindings-done t))
 
-    ;; If *scratch* is selected and it is empty, insert an
-    ;; initial message saying not to create a file there.
-    (when (and initial-scratch-message
-              (equal (buffer-name) "*scratch*")
-              (= 0 (buffer-size)))
-      (insert initial-scratch-message)
-      (set-buffer-modified-p nil))
+    ;; If *scratch* exists and is empty, insert initial-scratch-message.
+    (and initial-scratch-message
+         (get-buffer "*scratch*")
+         (with-current-buffer "*scratch*"
+           (when (zerop (buffer-size))
+             (insert initial-scratch-message)
+             (set-buffer-modified-p nil))))
 
     ;; If user typed input during all that work,
     ;; abort the startup screen.  Otherwise, display it now.