From 1ed14cfd6db155ac2a49e129a9245928c1654d48 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 15 Sep 1994 02:35:45 +0000 Subject: [PATCH] (command-line): If we can't load x-win.el, terminate. --- lisp/startup.el | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/lisp/startup.el b/lisp/startup.el index a31aa73f7d4..5b5594e4a61 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -246,13 +246,28 @@ specified by the LC_ALL, LC_CTYPE and LANG environment variables.") ;;! (setq split-window-keep-point (> baud-rate 2400)) ;; Read window system's init file if using a window system. - (if (and window-system (not noninteractive)) - (load (concat term-file-prefix - (symbol-name window-system) - "-win") - ;; Every window system should have a startup file; - ;; barf if we can't find it. - nil t)) + (condition-case error + (if (and window-system (not noninteractive)) + (load (concat term-file-prefix + (symbol-name window-system) + "-win") + ;; Every window system should have a startup file; + ;; barf if we can't find it. + nil t)) + ;; If we can't read it, print the error message and exit. + (error + (if (eq (car error) 'error) + (message "%s" (apply 'concat (cdr error))) + (if (memq 'file-error (get (car error) 'error-conditions)) + (message "%s: %s" + (nth 1 error) + (mapconcat '(lambda (obj) (prin1-to-string obj t)) + (cdr (cdr error)) ", ")) + (message "%s: %s" + (get (car error) 'error-message) + (mapconcat '(lambda (obj) (prin1-to-string obj t)) + (cdr error) ", ")))) + (kill-emacs))) (let ((done nil) (args (cdr command-line-args))) -- 2.39.5