# HG changeset patch # User Richard M. Stallman # Date 1008527271 0 # Node ID 4dd93ea3bc4f8a6ddb92ecd063a89850c68cf97d # Parent 8d6ee910d76c71100c002243a8f0e4a5b9e47393 (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. diff -r 8d6ee910d76c -r 4dd93ea3bc4f lisp/startup.el --- a/lisp/startup.el Sun Dec 16 18:12:19 2001 +0000 +++ b/lisp/startup.el Sun Dec 16 18:27:51 2001 +0000 @@ -1089,7 +1089,7 @@ (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 @@ (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 @@ (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 @@ (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. - ;; 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. - (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. + ;; 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) - ;; 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)) - ;; 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)) - ;; 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) - ;; 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) + ;; 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*") + (= 0 (buffer-size))) + (insert initial-scratch-message) + (set-buffer-modified-p nil)) - (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 @@ (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.