(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.
(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 ()
(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)))
(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))
(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.