]> git.eshelyaron.com Git - emacs.git/commitdiff
(inhibit-startup-echo-area-message): New variable.
authorRichard M. Stallman <rms@gnu.org>
Sat, 12 Feb 1994 20:01:43 +0000 (20:01 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 12 Feb 1994 20:01:43 +0000 (20:01 +0000)
(command-line-1): Undo prev change.
New test for whether to suppress echo area message.
Update copyright year in displayed message.

lisp/startup.el

index c006ad4fc162480086f8117f9b0c31e5313a17fd..ae34c9db10e8b006e971e3ea8080df16841d41ca 100644 (file)
@@ -1,6 +1,6 @@
 ;;; startup.el --- process Emacs shell arguments
 
-;; Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1992, 1994 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: internal
 (defvar command-line-processed nil "t once command line has been processed")
 
 (defconst inhibit-startup-message nil
-  "*Non-nil inhibits the initial startup messages.
+  "*Non-nil inhibits the initial startup message.
 This is for use in your personal init file, once you are familiar
 with the contents of the startup message.")
 
+(defconst inhibit-startup-echo-area-message nil
+  "*Non-nil inhibits the initial startup echo area message.
+Inhibition takes effect only if your `.emacs' file contains
+a line of the form
+ (setq inhibit-startup-echo-area-message "YOUR-USER-NAME")
+Thus, someone else using a copy of your `.emacs' file will see
+the startup message unless he personally acts to inhibit it.")
+
 (defconst inhibit-default-init nil
   "*Non-nil inhibits loading the `default' library.")
 
@@ -327,8 +335,28 @@ this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.")
 
 (defun command-line-1 (command-line-args-left)
   (or noninteractive (input-pending-p) init-file-had-error
-      (if (eq (key-binding "\C-h\C-p") 'describe-project)
-         (message "For more about the GNU Project, of which GNU Emacs is part, type C-h C-p.")))
+      (and inhibit-startup-echo-area-message
+          (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
+                        "(setq inhibit-startup-echo-area-message[ \t]+"
+                        (prin1-to-string
+                         (if (string= init-file-user "")
+                             (user-login-name)
+                           init-file-user))
+                        "[ \t]*)")
+                       nil t))
+                  (error nil))
+              (kill-buffer buffer))))
+      (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
+                 "For information about the GNU Project and its goals, type \\[describe-project]."))))
   (if (null command-line-args-left)
       (cond ((and (not inhibit-startup-message) (not noninteractive)
                  ;; Don't clobber a non-scratch buffer if init file
@@ -357,7 +385,7 @@ this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.")
                 (progn
                   (insert (emacs-version)
                           "
-Copyright (C) 1993 Free Software Foundation, Inc.\n\n")
+Copyright (C) 1994 Free Software Foundation, Inc.\n\n")
                   ;; If keys have their default meanings,
                   ;; use precomputed string to save lots of time.
                   (if (and (eq (key-binding "\C-h") 'help-command)