From: Karoly Lorentey Date: Tue, 21 Mar 2006 22:32:30 +0000 (+0000) Subject: Let the Emacs server recognize `inhibit-startup-echo-area-message'. (Reported by... X-Git-Url: https://git.hcoop.net/bpt/emacs.git/commitdiff_plain/f1be5774242454844bf21fbf32e0f6541e2add34 Let the Emacs server recognize `inhibit-startup-echo-area-message'. (Reported by Han Boetes.) * lisp/startup.el (display-startup-echo-area-message): Handle `inhibit-startup-echo-area-message' here. (command-line-1): Moved from here. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-533 --- diff --git a/lisp/startup.el b/lisp/startup.el index a3bf7e9f0e..1e7032efe4 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1549,7 +1549,45 @@ Type \\[describe-distribution] for information on getting the latest version.")) (defun display-startup-echo-area-message () (let ((resize-mini-windows t)) - (message "%s" (startup-echo-area-message)))) + (or noninteractive ;(input-pending-p) init-file-had-error + ;; t if the init file says to inhibit the echo area startup message. + (and inhibit-startup-echo-area-message + user-init-file + (or (and (get 'inhibit-startup-echo-area-message 'saved-value) + (equal inhibit-startup-echo-area-message + (if (equal init-file-user "") + (user-login-name) + init-file-user))) + ;; Wasn't set with custom; see if .emacs has a setq. + (let ((buffer (get-buffer-create " *temp*"))) + (prog1 + (condition-case nil + (save-excursion + (set-buffer buffer) + (insert-file-contents user-init-file) + (re-search-forward + (concat + "([ \t\n]*setq[ \t\n]+" + "inhibit-startup-echo-area-message[ \t\n]+" + (regexp-quote + (prin1-to-string + (if (equal init-file-user "") + (user-login-name) + init-file-user))) + "[ \t\n]*)") + nil t)) + (error nil)) + (kill-buffer buffer))))) + ;; display-splash-screen at the end of command-line-1 calls + ;; use-fancy-splash-screens-p. This can cause image.el to be + ;; loaded, putting "Loading image... done" in the echo area. + ;; This hides startup-echo-area-message. So + ;; use-fancy-splash-screens-p is called here simply to get the + ;; loading of image.el (if needed) out of the way before + ;; display-startup-echo-area-message runs. + (progn + (use-fancy-splash-screens-p) + (message "%s" (startup-echo-area-message)))))) (defun display-splash-screen () @@ -1564,45 +1602,7 @@ normal otherwise." (normal-splash-screen)))) (defun command-line-1 (command-line-args-left) - (or noninteractive (input-pending-p) init-file-had-error - ;; t if the init file says to inhibit the echo area startup message. - (and inhibit-startup-echo-area-message - user-init-file - (or (and (get 'inhibit-startup-echo-area-message 'saved-value) - (equal inhibit-startup-echo-area-message - (if (equal init-file-user "") - (user-login-name) - init-file-user))) - ;; Wasn't set with custom; see if .emacs has a setq. - (let ((buffer (get-buffer-create " *temp*"))) - (prog1 - (condition-case nil - (save-excursion - (set-buffer buffer) - (insert-file-contents user-init-file) - (re-search-forward - (concat - "([ \t\n]*setq[ \t\n]+" - "inhibit-startup-echo-area-message[ \t\n]+" - (regexp-quote - (prin1-to-string - (if (equal init-file-user "") - (user-login-name) - init-file-user))) - "[ \t\n]*)") - nil t)) - (error nil)) - (kill-buffer buffer))))) - ;; display-splash-screen at the end of command-line-1 calls - ;; use-fancy-splash-screens-p. This can cause image.el to be - ;; loaded, putting "Loading image... done" in the echo area. - ;; This hides startup-echo-area-message. So - ;; use-fancy-splash-screens-p is called here simply to get the - ;; loading of image.el (if needed) out of the way before - ;; display-startup-echo-area-message runs. - (progn - (use-fancy-splash-screens-p) - (display-startup-echo-area-message))) + (display-startup-echo-area-message) ;; Delay 2 seconds after an init file error message ;; was displayed, so user can read it.