emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/startup.el,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/startup.el,v
Date: Wed, 23 Aug 2006 16:19:12 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      06/08/23 16:19:11

Index: startup.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/startup.el,v
retrieving revision 1.410
retrieving revision 1.411
diff -u -b -r1.410 -r1.411
--- startup.el  22 Jul 2006 10:37:12 -0000      1.410
+++ startup.el  23 Aug 2006 16:19:11 -0000      1.411
@@ -1265,11 +1265,16 @@
        "GNU Emacs is one component of the GNU/Linux operating system."
      "GNU Emacs is one component of the GNU operating system."))
   (insert "\n")
-  (unless (equal (buffer-name fancy-splash-outer-buffer) "*scratch*")
-    (fancy-splash-insert :face 'variable-pitch
+  (if fancy-splash-outer-buffer
+      (fancy-splash-insert
+       :face 'variable-pitch
                         (substitute-command-keys
-                         "Type \\[recenter] to begin editing your file.\n"))))
-
+       (concat
+        "Type \\[recenter] 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."
@@ -1339,9 +1344,10 @@
   (throw 'exit nil))
 
 
-(defun fancy-splash-screens ()
+(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))
        splash-buffer
@@ -1379,7 +1385,24 @@
          (setq display-hourglass old-hourglass
                minor-mode-map-alist old-minor-mode-map-alist
                emulation-mode-map-alists old-emulation-mode-map-alists)
-         (kill-buffer splash-buffer))))))
+             (kill-buffer splash-buffer)))))
+    ;; If hide-on-input is non-nil, don't hide the buffer on input.
+    (if (or (window-minibuffer-p)
+           (window-dedicated-p (selected-window)))
+       (pop-to-buffer (current-buffer))
+      (switch-to-buffer "GNU Emacs"))
+    (erase-buffer)
+    (if pure-space-overflow
+       (insert "\
+Warning Warning!!!  Pure space overflow    !!!Warning Warning
+\(See the node Pure Storage in the Lisp manual for details.)\n"))
+    (let (fancy-splash-outer-buffer)
+      (fancy-splash-head)
+      (dolist (text fancy-splash-text)
+       (apply #'fancy-splash-insert text))
+      (fancy-splash-tail)
+      (set-buffer-modified-p nil)
+      (goto-char (point-min)))))
 
 (defun fancy-splash-frame ()
   "Return the frame to use for the fancy splash screen.
@@ -1410,14 +1433,16 @@
          (> window-height (+ image-height 19)))))))
 
 
-(defun normal-splash-screen ()
+(defun normal-splash-screen (&optional hide-on-input)
   "Display splash screen when Emacs starts."
   (let ((prev-buffer (current-buffer)))
     (unwind-protect
        (with-current-buffer (get-buffer-create "GNU Emacs")
+         (erase-buffer)
          (set (make-local-variable 'tab-width) 8)
+         (if hide-on-input
           (set (make-local-variable 'mode-line-format)
-               (propertize "---- %b %-" 'face 'mode-line-buffer-id))
+                  (propertize "---- %b %-" 'face 'mode-line-buffer-id)))
 
           (if pure-space-overflow
               (insert "\
@@ -1433,9 +1458,13 @@
                ", one component of the GNU/Linux operating system.\n"
              ", a part of the GNU operating system.\n"))
 
-          (unless (equal (buffer-name prev-buffer) "*scratch*")
+         (if hide-on-input
             (insert (substitute-command-keys
-                     "\nType \\[recenter] to begin editing your file.\n")))
+                      (concat
+                       "\nType \\[recenter] to begin editing"
+                       (if (equal (buffer-name prev-buffer) "*scratch*")
+                           ".\n"
+                         " your file.\n")))))
 
           (if (display-mouse-p)
               ;; The user can use the mouse to activate menus
@@ -1551,15 +1580,18 @@
           (goto-char (point-min))
           (if (or (window-minibuffer-p)
                   (window-dedicated-p (selected-window)))
-              ;; There's no point is using pop-to-buffer since creating
-              ;; a new frame will generate enough events that the
-              ;; subsequent `sit-for' will immediately return anyway.
-              nil ;; (pop-to-buffer (current-buffer))
+             ;; If hide-on-input is nil, creating a new frame will
+             ;; generate enough events that the subsequent `sit-for'
+             ;; will immediately return anyway.
+             (pop-to-buffer (current-buffer))
+           (if hide-on-input
             (save-window-excursion
               (switch-to-buffer (current-buffer))
-              (sit-for 120))))
+                 (sit-for 120))
+             (switch-to-buffer (current-buffer)))))
       ;; Unwind ... ensure splash buffer is killed
-      (kill-buffer "GNU Emacs"))))
+      (if hide-on-input
+         (kill-buffer "GNU Emacs")))))
 
 
 (defun startup-echo-area-message ()
@@ -1575,14 +1607,14 @@
     (message "%s" (startup-echo-area-message))))
 
 
-(defun display-splash-screen ()
+(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)
   (if (use-fancy-splash-screens-p)
-      (fancy-splash-screens)
-    (normal-splash-screen)))
+      (fancy-splash-screens hide-on-input)
+    (normal-splash-screen hide-on-input)))
 
 
 (defun command-line-1 (command-line-args-left)
@@ -1885,7 +1917,7 @@
     ;; If user typed input during all that work,
     ;; abort the startup screen.  Otherwise, display it now.
     (unless (input-pending-p)
-      (display-splash-screen))))
+      (display-splash-screen t))))
 
 
 (defun command-line-normalize-file-name (file)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]