From fe00df4eb9788d4d46b7949ca64b281d13269853 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 26 Apr 2025 09:24:09 +0200 Subject: [PATCH] ; Simplify 'inhibit-startup-echo-area-message'. --- doc/lispref/os.texi | 18 ++--------------- lisp/startup.el | 48 +++------------------------------------------ 2 files changed, 5 insertions(+), 61 deletions(-) diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 21f92706a4c..c5a1b84a803 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -303,22 +303,8 @@ If its value is @code{t}, Emacs displays the @file{*scratch*} buffer. @end defopt @defopt inhibit-startup-echo-area-message -This variable controls the display of the startup echo area message. -You can suppress the startup echo area message by adding text with this -form to your init file: - -@example -(setq inhibit-startup-echo-area-message - "@var{your-login-name}") -@end example - -Emacs explicitly checks for an expression as shown above in your init -file; your login name must appear in the expression as a Lisp string -constant. You can also use the Customize interface. Other methods of -setting @code{inhibit-startup-echo-area-message} to the same value do -not inhibit the startup message. This way, you can easily inhibit the -message for yourself if you wish, but thoughtless copying of your init -file will not inhibit the message for someone else. +This variable controls the display of the startup echo area message, set +it to non-@code{nil} to suppress the startup echo area message. @end defopt @defopt initial-scratch-message diff --git a/lisp/startup.el b/lisp/startup.el index 86443339ce5..d1f6a0c17ac 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -78,26 +78,8 @@ once you are familiar with the contents of the startup screen." ;; they will do so with knowledge of why the Emacs developers think ;; this is a bad idea. (defcustom inhibit-startup-echo-area-message nil - "Non-nil inhibits the initial startup echo area message. - -The startup message is in the echo area as it provides information -about GNU Emacs and the GNU system in general, which we want all -users to see. As this is the least intrusive startup message, -this variable gets specialized treatment to prevent the message -from being disabled site-wide by systems administrators, while -still allowing individual users to do so. - -Setting this variable takes effect only if you do it with the -customization buffer or if your init file contains a line of this -form: - (setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\") -If your init file is byte-compiled, use the following form -instead: - (eval \\='(setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\")) -Thus, someone else using a copy of your init file will see the -startup message unless he personally acts to inhibit it." - :type '(choice (const :tag "Don't inhibit") - (string :tag "Enter your user name, to inhibit"))) + "Whether to inhibit the initial startup echo area message." + :type 'boolean) (defcustom inhibit-default-init nil "Non-nil inhibits loading the `default' library." @@ -2390,31 +2372,7 @@ Type \\[describe-distribution] for information on ")) (defun display-startup-echo-area-message () (let ((resize-mini-windows t)) - (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. - (condition-case nil - (with-temp-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)))) + (or noninteractive inhibit-startup-echo-area-message (message "%s" (startup-echo-area-message))))) (defun display-startup-screen (&optional concise) -- 2.39.5