changeset 69785:d30038c6c061

(normal-splash-screen): Only set mode-line-format in the splash buffer, so as not to interfere when debugging the code. Ignore errors when switching buffer.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 03 Apr 2006 22:16:05 +0000
parents 2a84440a03fb
children 734f4a4c96e2
files lisp/ChangeLog lisp/startup.el
diffstat 2 files changed, 98 insertions(+), 85 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Apr 03 21:34:02 2006 +0000
+++ b/lisp/ChangeLog	Mon Apr 03 22:16:05 2006 +0000
@@ -1,3 +1,9 @@
+2006-04-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* startup.el (normal-splash-screen): Only set mode-line-format in the
+	splash buffer, so as not to interfere when debugging the code.
+	Ignore errors when switching buffer.
+
 2006-04-03  Romain Francoise  <romain@orebokech.com>
 
 	* dired.el (dired-dnd-protocol-alist): Fix typo.
@@ -110,8 +116,7 @@
 
 2006-03-27  Carsten Dominik  <dominik@science.uva.nl>
 
-	* textmodes/org.el (org-get-level-face): Fix bug with level
-	counting.
+	* textmodes/org.el (org-get-level-face): Fix bug with level counting.
 
 2006-03-26  Andreas Schwab  <schwab@suse.de>
 
@@ -6421,7 +6426,7 @@
 
 2005-11-24  Carsten Dominik  <dominik@science.uva.nl>
 
-	* textmodes/org.el (org-export-plain-list-max-depth): Renamed from
+	* textmodes/org.el (org-export-plain-list-max-depth): Rename from
 	`org-export-local-list-max-depth'.  Change default value to 3.
 	(org-auto-renumber-ordered-lists)
 	(org-plain-list-ordered-item-terminator): New options.
--- a/lisp/startup.el	Mon Apr 03 21:34:02 2006 +0000
+++ b/lisp/startup.el	Mon Apr 03 22:16:05 2006 +0000
@@ -1399,31 +1399,31 @@
   (let ((prev-buffer (current-buffer)))
     (unwind-protect
 	(with-current-buffer (get-buffer-create "GNU Emacs")
-	  (let ((tab-width 8)
-		(mode-line-format (propertize "---- %b %-"
-					      'face '(:weight bold))))
+	  (set (make-local-variable 'tab-width) 8)
+          (set (make-local-variable 'mode-line-format)
+               (propertize "---- %b %-" 'face '(:weight bold)))
 
-	    (if pure-space-overflow
-		(insert "Warning Warning  Pure space overflow   Warning Warning\n"))
+          (if pure-space-overflow
+              (insert "Warning Warning  Pure space overflow   Warning Warning\n"))
 
-	    ;; The convention for this piece of code is that
-	    ;; each piece of output starts with one or two newlines
-	    ;; and does not end with any newlines.
-	    (insert "Welcome to GNU Emacs")
-	    (insert
-	     (if (eq system-type 'gnu/linux)
-		 ", one component of the GNU/Linux operating system.\n"
-	       ", a part of the GNU operating system.\n"))
+          ;; The convention for this piece of code is that
+          ;; each piece of output starts with one or two newlines
+          ;; and does not end with any newlines.
+          (insert "Welcome to GNU Emacs")
+          (insert
+           (if (eq system-type 'gnu/linux)
+               ", one component of the GNU/Linux operating system.\n"
+             ", a part of the GNU operating system.\n"))
 
-	    (unless (equal (buffer-name prev-buffer) "*scratch*")
-	      (insert (substitute-command-keys
-		       "\nType \\[recenter] to begin editing your file.\n")))
+          (unless (equal (buffer-name prev-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.
-		(progn
-		  (insert "\
+          (if (display-mouse-p)
+              ;; The user can use the mouse to activate menus
+              ;; so give help in terms of menu items.
+              (progn
+                (insert "\
 You can do basic editing with the menu bar and scroll bar using the mouse.
 
 Useful File menu items:
@@ -1439,101 +1439,109 @@
 Getting New Versions	How to obtain the latest version of Emacs
 More Manuals / Ordering Manuals    How to order printed manuals from the FSF
 ")
-		  (insert "\n\n" (emacs-version)
-			  "
+                (insert "\n\n" (emacs-version)
+                        "
 Copyright (C) 2006 Free Software Foundation, Inc."))
 
-	      ;; No mouse menus, so give help using kbd commands.
+            ;; No mouse menus, so give help using kbd commands.
 
-	      ;; If keys have their default meanings,
-	      ;; use precomputed string to save lots of time.
-	      (if (and (eq (key-binding "\C-h") 'help-command)
-		       (eq (key-binding "\C-xu") 'advertised-undo)
-		       (eq (key-binding "\C-x\C-c") 'save-buffers-kill-emacs)
-		       (eq (key-binding "\C-ht") 'help-with-tutorial)
-		       (eq (key-binding "\C-hi") 'info)
-		       (eq (key-binding "\C-hr") 'info-emacs-manual)
-		       (eq (key-binding "\C-h\C-n") 'view-emacs-news))
-		  (insert "
+            ;; If keys have their default meanings,
+            ;; use precomputed string to save lots of time.
+            (if (and (eq (key-binding "\C-h") 'help-command)
+                     (eq (key-binding "\C-xu") 'advertised-undo)
+                     (eq (key-binding "\C-x\C-c") 'save-buffers-kill-emacs)
+                     (eq (key-binding "\C-ht") 'help-with-tutorial)
+                     (eq (key-binding "\C-hi") 'info)
+                     (eq (key-binding "\C-hr") 'info-emacs-manual)
+                     (eq (key-binding "\C-h\C-n") 'view-emacs-news))
+                (insert "
 Get help	   C-h  (Hold down CTRL and press h)
 Emacs manual	   C-h r
 Emacs tutorial	   C-h t           Undo changes     C-x u
 Buy manuals        C-h C-m         Exit Emacs	    C-x C-c
 Browse manuals     C-h i")
 
-		(insert (substitute-command-keys
-			 (format "\n
+              (insert (substitute-command-keys
+                       (format "\n
 Get help	   %s
 Emacs manual	   \\[info-emacs-manual]
 Emacs tutorial	   \\[help-with-tutorial]\tUndo changes\t\\[advertised-undo]
 Buy manuals        \\[view-order-manuals]\tExit Emacs\t\\[save-buffers-kill-emacs]
 Browse manuals     \\[info]"
-				 (let ((where (where-is-internal
-					       'help-command nil t)))
-				   (if where
-				       (key-description where)
-				     "M-x help"))))))
+                               (let ((where (where-is-internal
+                                             'help-command nil t)))
+                                 (if where
+                                     (key-description where)
+                                   "M-x help"))))))
 
-	      ;; Say how to use the menu bar with the keyboard.
-	      (if (and (eq (key-binding "\M-`") 'tmm-menubar)
-		       (eq (key-binding [f10]) 'tmm-menubar))
-		  (insert "
+            ;; Say how to use the menu bar with the keyboard.
+            (if (and (eq (key-binding "\M-`") 'tmm-menubar)
+                     (eq (key-binding [f10]) 'tmm-menubar))
+                (insert "
 Activate menubar   F10  or  ESC `  or   M-`")
-		(insert (substitute-command-keys "
+              (insert (substitute-command-keys "
 Activate menubar     \\[tmm-menubar]")))
 
-	      ;; Many users seem to have problems with these.
-	      (insert "
+            ;; Many users seem to have problems with these.
+            (insert "
 \(`C-' means use the CTRL key.  `M-' means use the Meta (or Alt) key.
 If you have no Meta key, you may instead type ESC followed by the character.)")
 
-	      (insert "\n\n" (emacs-version)
-		      "
+            (insert "\n\n" (emacs-version)
+                    "
 Copyright (C) 2006 Free Software Foundation, Inc.")
 
-	      (if (and (eq (key-binding "\C-h\C-c") 'describe-copying)
-		       (eq (key-binding "\C-h\C-d") 'describe-distribution)
-		       (eq (key-binding "\C-h\C-w") 'describe-no-warranty))
-		  (insert
-		   "\n
+            (if (and (eq (key-binding "\C-h\C-c") 'describe-copying)
+                     (eq (key-binding "\C-h\C-d") 'describe-distribution)
+                     (eq (key-binding "\C-h\C-w") 'describe-no-warranty))
+                (insert
+                 "\n
 GNU Emacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details.
 Emacs is Free Software--Free as in Freedom--so you can redistribute copies
 of Emacs and modify it; type C-h C-c to see the conditions.
 Type C-h C-d for information on getting the latest version.")
-		(insert (substitute-command-keys
-			 "\n
+              (insert (substitute-command-keys
+                       "\n
 GNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for full details.
 Emacs is Free Software--Free as in Freedom--so you can redistribute copies
 of Emacs and modify it; type \\[describe-copying] to see the conditions.
 Type \\[describe-distribution] for information on getting the latest version."))))
 
-	    ;; The rest of the startup screen is the same on all
-	    ;; kinds of terminals.
+          ;; The rest of the startup screen is the same on all
+          ;; kinds of terminals.
 
-	    ;; Give information on recovering, if there was a crash.
-	    (and auto-save-list-file-prefix
-		 ;; Don't signal an error if the
-		 ;; directory for auto-save-list files
-		 ;; does not yet exist.
-		 (file-directory-p (file-name-directory
-				    auto-save-list-file-prefix))
-		 (directory-files
-		  (file-name-directory auto-save-list-file-prefix)
-		  nil
-		  (concat "\\`"
-			  (regexp-quote (file-name-nondirectory
-					 auto-save-list-file-prefix)))
-		  t)
-		 (insert "\n\nIf an Emacs session crashed recently, "
-			 "type M-x recover-session RET\nto recover"
-			 " the files you were editing."))
+          ;; Give information on recovering, if there was a crash.
+          (and auto-save-list-file-prefix
+               ;; Don't signal an error if the
+               ;; directory for auto-save-list files
+               ;; does not yet exist.
+               (file-directory-p (file-name-directory
+                                  auto-save-list-file-prefix))
+               (directory-files
+                (file-name-directory auto-save-list-file-prefix)
+                nil
+                (concat "\\`"
+                        (regexp-quote (file-name-nondirectory
+                                       auto-save-list-file-prefix)))
+                t)
+               (insert "\n\nIf an Emacs session crashed recently, "
+                       "type M-x recover-session RET\nto recover"
+                       " the files you were editing."))
 
-	    ;; Display the input that we set up in the buffer.
-	    (set-buffer-modified-p nil)
-	    (goto-char (point-min))
-	    (save-window-excursion
-	      (switch-to-buffer (current-buffer))
-	      (sit-for 120))))
+          ;; Display the input that we set up in the buffer.
+          (set-buffer-modified-p nil)
+          (goto-char (point-min))
+          (save-window-excursion
+            (condition-case nil
+                (switch-to-buffer (current-buffer))
+              ;; In case we're in a dedicated or minibuffer-only window.
+              (error
+               ;; 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.
+               ;; (pop-to-buffer (current-buffer))
+               ))
+            (sit-for 120)))
       ;; Unwind ... ensure splash buffer is killed
       (kill-buffer "GNU Emacs"))))