changeset 5109:062da10a4a6b

(command-line): Set init-file-had-error to t or nil. (command-line-1): Inhibit startup message if init-file-had-error.
author Richard M. Stallman <rms@gnu.org>
date Mon, 22 Nov 1993 06:35:37 +0000
parents 8c482171bb10
children c002b7320691
files lisp/startup.el
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/startup.el	Mon Nov 22 06:34:22 1993 +0000
+++ b/lisp/startup.el	Mon Nov 22 06:35:37 1993 +0000
@@ -129,6 +129,8 @@
 
 (defvar init-file-debug nil)
 
+(defvar init-file-had-error nil)
+
 (defun normal-top-level ()
   (if command-line-processed
       (message "Back to top level.")
@@ -271,11 +273,14 @@
 	;; Do this without a condition-case if the user wants to debug.
 	(funcall inner)
       (condition-case error
-	  (funcall inner)
+	  (progn
+	    (funcall inner)
+	    (setq init-file-had-error nil))
 	(error (message "Error in init file: %s%s%s"
 			(get (car error) 'error-message)
 			(if (cdr error) ": ")
-			(mapconcat 'prin1-to-string (cdr error) ", "))))))
+			(mapconcat 'prin1-to-string (cdr error) ", "))
+	       (setq init-file-had-error t)))))
 
   (run-hooks 'after-init-hook)
 
@@ -304,7 +309,7 @@
   (if noninteractive (kill-emacs t)))
 
 (defun command-line-1 (command-line-args-left)
-  (or noninteractive (input-pending-p)
+  (or noninteractive (input-pending-p) init-file-had-error
       (message (if (eq (key-binding "\C-h\C-p") 'describe-project)
 		   "For information about the GNU Project and its goals, type C-h C-p."
 		 (substitute-command-keys