(command-line-1): Display startup screen even if there are command line args.
authorRichard M. Stallman <rms@gnu.org>
Sun, 16 Dec 2001 18:29:53 +0000 (18:29 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 16 Dec 2001 18:29:53 +0000 (18:29 +0000)
Add a note about how to go to editing your files.
(fancy-splash-head): Add a note about how to go to your files.
(fancy-splash-outer-buffer): New variable.
(fancy-splash-screens): Bind variable fancy-splash-outer-buffer.

lisp/ChangeLog
lisp/startup.el

index 1957ddd..8172b60 100644 (file)
@@ -1,5 +1,12 @@
 2001-12-16  Richard M. Stallman  <rms@gnu.org>
 
+       * startup.el (command-line-1): Display startup screen
+       even if there are command line args.
+       Add a note about how to go to editing your files. 
+       (fancy-splash-head): Add a note about how to go to your files.
+       (fancy-splash-outer-buffer): New variable.
+       (fancy-splash-screens): Bind variable fancy-splash-outer-buffer.
+
        * subr.el (with-temp-message): At the end, always discard
        the temp message, even by clearing the echo area.
 
index e62665b..f9b2c26 100644 (file)
@@ -1089,7 +1089,7 @@ Values less than 60 seconds are ignored."
 (defvar fancy-current-text nil)
 (defvar fancy-splash-help-echo nil)
 (defvar fancy-splash-stop-time nil)
-
+(defvar fancy-splash-outer-buffer nil)
 
 (defun fancy-splash-insert (&rest args)
   "Insert text into the current buffer, with faces.
@@ -1152,7 +1152,11 @@ where FACE is a valid face specification, as it can be used with
     (fancy-splash-insert
      :face '(variable-pitch :foreground "red")
      "GNU Emacs is one component of the GNU operating system."))
-  (insert "\n"))
+  (insert "\n")
+  (unless (equal (buffer-name fancy-splash-outer-buffer) "*scratch*")
+    (fancy-splash-insert :face 'variable-pitch
+                        (substitute-command-keys
+                         "Type \\[recenter] to begin editing your file.\n"))))
 
 
 (defun fancy-splash-tail ()
@@ -1213,12 +1217,14 @@ where FACE is a valid face specification, as it can be used with
 (defun fancy-splash-screens ()
   "Display fancy splash screens when Emacs starts."
   (setq fancy-splash-help-echo (startup-echo-area-message))
-  (switch-to-buffer "GNU Emacs")
   (setq tab-width 20)
   (let ((old-hourglass display-hourglass)
-       (splash-buffer (current-buffer))
+       (fancy-splash-outer-buffer (current-buffer))
+       splash-buffer
        (old-minor-mode-map-alist minor-mode-map-alist)
        timer)
+    (switch-to-buffer "GNU Emacs")
+    (setq splash-buffer (current-buffer))
     (catch 'stop-splashing
       (unwind-protect
          (let ((map (make-sparse-keymap)))
@@ -1494,57 +1500,56 @@ where FACE is a valid face specification, as it can be used with
             (not noninteractive)
             (not inhibit-startup-buffer-menu)
             (or (get-buffer-window first-file-buffer)
-                (list-buffers))))
+                (list-buffers)))))
+
+  ;; Maybe display a startup screen.
+  (when (and (not inhibit-startup-message) (not noninteractive)
+            ;; Don't display startup screen if init file
+            ;; has started some sort of server.
+            (not (and (fboundp 'process-list)
+                      (process-list))))
+    ;; Display a startup screen, after some preparations.
+
+    ;; If there are no switches to process, we might as well
+    ;; run this hook now, and there may be some need to do it
+    ;; before doing any output.
+    (and term-setup-hook
+        (run-hooks 'term-setup-hook))
+    ;; Don't let the hook be run twice.
+    (setq term-setup-hook nil)
+
+    ;; It's important to notice the user settings before we
+    ;; display the startup message; otherwise, the settings
+    ;; won't take effect until the user gives the first
+    ;; keystroke, and that's distracting.
+    (when (fboundp 'frame-notice-user-settings)
+      (frame-notice-user-settings))
+
+    ;; If there are no switches to process, we might as well
+    ;; run this hook now, and there may be some need to do it
+    ;; before doing any output.
+    (when window-setup-hook
+      (run-hooks 'window-setup-hook)
+      ;; Don't let the hook be run twice.
+      (setq window-setup-hook nil))
+
+    ;; Do this now to avoid an annoying delay if the user
+    ;; clicks the menu bar during the sit-for.
+    (when (display-popup-menus-p)
+      (precompute-menubar-bindings))
+    (setq menubar-bindings-done t)
 
-    ;; No command args: maybe display a startup screen.
-    (when (and (not inhibit-startup-message) (not noninteractive)
-              ;; Don't display startup screen if init file
-              ;; has selected another buffer.
+    ;; If *scratch* is selected and it is empty, insert an
+    ;; initial message saying not to create a file there.
+    (when (and initial-scratch-message
               (string= (buffer-name) "*scratch*")
-              ;; Don't display startup screen if init file
-              ;; has started some sort of server.
-              (not (and (fboundp 'process-list)
-                        (process-list)))
-              ;; Don't display startup screen if init file
-              ;; has inserted some text in *scratch*.
               (= 0 (buffer-size)))
-      ;; Display a startup screen, after some preparations.
+      (insert initial-scratch-message)
+      (set-buffer-modified-p nil))
 
-      ;; If there are no switches to process, we might as well
-      ;; run this hook now, and there may be some need to do it
-      ;; before doing any output.
-      (and term-setup-hook
-          (run-hooks 'term-setup-hook))
-      ;; Don't let the hook be run twice.
-      (setq term-setup-hook nil)
-
-      ;; It's important to notice the user settings before we
-      ;; display the startup message; otherwise, the settings
-      ;; won't take effect until the user gives the first
-      ;; keystroke, and that's distracting.
-      (when (fboundp 'frame-notice-user-settings)
-       (frame-notice-user-settings))
-
-      ;; If there are no switches to process, we might as well
-      ;; run this hook now, and there may be some need to do it
-      ;; before doing any output.
-      (when window-setup-hook
-       (run-hooks 'window-setup-hook)
-       ;; Don't let the hook be run twice.
-       (setq window-setup-hook nil))
-
-      ;; Do this now to avoid an annoying delay if the user
-      ;; clicks the menu bar during the sit-for.
-      (when (display-popup-menus-p)
-       (precompute-menubar-bindings))
-      (setq menubar-bindings-done t)
-
-      (when initial-scratch-message
-       (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.
+    ;; If user typed input during all that work,
+    ;; abort the startup screen.  Otherwise, display it now.
+    (let ((buffer (current-buffer)))
       (when (not (input-pending-p))
        (if (and (display-graphic-p)
                 (use-fancy-splash-screens-p))
@@ -1562,6 +1567,10 @@ where FACE is a valid face specification, as it can be used with
                  (insert ", one component of a Linux-based GNU system."))
              (insert "\n")
 
+             (unless (equal (buffer-name buffer) "*scratch*")
+               (insert (substitute-command-keys
+                        "\nType \\[recenter] to begin editing your file.\n")))
+
              (if (display-mouse-p)
                  ;; The user can use the mouse to activate menus
                  ;; so give help in terms of menu items.