aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1997-06-23 00:29:59 +0000
committerRichard M. Stallman1997-06-23 00:29:59 +0000
commitf862008d65479e3ebdce6e9eea3ccb682b78b1d1 (patch)
treeed6c354a9eb573c5a11e2cf9be5d17279b090c9e /lisp
parent1c57117e754657836c62597b60b1269161d525a2 (diff)
downloademacs-f862008d65479e3ebdce6e9eea3ccb682b78b1d1.tar.gz
emacs-f862008d65479e3ebdce6e9eea3ccb682b78b1d1.zip
(command-line-1): Don't display startup message
if the buffer-is nonempty. Don't make undo entries for it.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/startup.el135
1 files changed, 69 insertions, 66 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index bb5806a754b..f0e853ac448 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -735,100 +735,103 @@ from being initialized."
735 (if (memq window-system '(x w32)) 735 (if (memq window-system '(x w32))
736 (precompute-menubar-bindings)) 736 (precompute-menubar-bindings))
737 (setq menubar-bindings-done t) 737 (setq menubar-bindings-done t)
738 (unwind-protect 738 (when (= (buffer-size) 0)
739 (progn 739 (let ((buffer-undo-list t))
740 ;; The convention for this piece of code is that 740 (unwind-protect
741 ;; each piece of output starts with one or two newlines 741 (progn
742 ;; and does not end with any newlines. 742 (goto-char (point-max))
743 (insert "Welcome to GNU Emacs") 743 ;; The convention for this piece of code is that
744 (if (eq system-type 'gnu/linux) 744 ;; each piece of output starts with one or two newlines
745 (insert ", one component of a Linux-based GNU system.")) 745 ;; and does not end with any newlines.
746 (insert "\n") 746 (insert "Welcome to GNU Emacs")
747 ;; If keys have their default meanings, 747 (if (eq system-type 'gnu/linux)
748 ;; use precomputed string to save lots of time. 748 (insert ", one component of a Linux-based GNU system."))
749 (if (and (eq (key-binding "\C-h") 'help-command) 749 (insert "\n")
750 (eq (key-binding "\C-xu") 'advertised-undo) 750 ;; If keys have their default meanings,
751 (eq (key-binding "\C-x\C-c") 'save-buffers-kill-emacs) 751 ;; use precomputed string to save lots of time.
752 (eq (key-binding "\C-ht") 'help-with-tutorial) 752 (if (and (eq (key-binding "\C-h") 'help-command)
753 (eq (key-binding "\C-hi") 'info) 753 (eq (key-binding "\C-xu") 'advertised-undo)
754 (eq (key-binding "\C-h\C-n") 'view-emacs-news)) 754 (eq (key-binding "\C-x\C-c") 'save-buffers-kill-emacs)
755 (insert " 755 (eq (key-binding "\C-ht") 'help-with-tutorial)
756 (eq (key-binding "\C-hi") 'info)
757 (eq (key-binding "\C-h\C-n") 'view-emacs-news))
758 (insert "
756Get help C-h (Hold down CTRL and press h) 759Get help C-h (Hold down CTRL and press h)
757Undo changes C-x u Exit Emacs C-x C-c 760Undo changes C-x u Exit Emacs C-x C-c
758Get a tutorial C-h t Use Info to read docs C-h i") 761Get a tutorial C-h t Use Info to read docs C-h i")
759 (insert (substitute-command-keys 762 (insert (substitute-command-keys
760 (format "\n 763 (format "\n
761Get help %s 764Get help %s
762Undo changes \\[advertised-undo] 765Undo changes \\[advertised-undo]
763Exit Emacs \\[save-buffers-kill-emacs] 766Exit Emacs \\[save-buffers-kill-emacs]
764Get a tutorial \\[help-with-tutorial] 767Get a tutorial \\[help-with-tutorial]
765Use Info to read docs \\[info]" 768Use Info to read docs \\[info]"
766 (let ((where (where-is-internal 769 (let ((where (where-is-internal
767 'help-command nil t))) 770 'help-command nil t)))
768 (if where 771 (if where
769 (key-description where) 772 (key-description where)
770 "M-x help")))))) 773 "M-x help"))))))
771 ;; Say how to use the menu bar 774 ;; Say how to use the menu bar
772 ;; if that is not with the mouse. 775 ;; if that is not with the mouse.
773 (if (not (assq 'display (frame-parameters))) 776 (if (not (assq 'display (frame-parameters)))
774 (if (and (eq (key-binding "\M-`") 'tmm-menubar) 777 (if (and (eq (key-binding "\M-`") 'tmm-menubar)
775 (eq (key-binding [f10]) 'tmm-menubar)) 778 (eq (key-binding [f10]) 'tmm-menubar))
776 (insert " 779 (insert "
777Activate menubar F10 or ESC ` or M-`") 780Activate menubar F10 or ESC ` or M-`")
778 (insert (substitute-command-keys " 781 (insert (substitute-command-keys "
779Activate menubar \\[tmm-menubar]")))) 782Activate menubar \\[tmm-menubar]"))))
780 783
781 ;; Windows and MSDOS (currently) do not count as 784 ;; Windows and MSDOS (currently) do not count as
782 ;; window systems, but do have mouse support. 785 ;; window systems, but do have mouse support.
783 (if window-system 786 (if window-system
784 (insert " 787 (insert "
785Mode-specific menu C-mouse-3 (third button, with CTRL)")) 788Mode-specific menu C-mouse-3 (third button, with CTRL)"))
786 ;; Many users seem to have problems with these. 789 ;; Many users seem to have problems with these.
787 (insert " 790 (insert "
788\(`C-' means use the CTRL key. `M-' means use the Meta (or Alt) key. 791\(`C-' means use the CTRL key. `M-' means use the Meta (or Alt) key.
789If you have no Meta key, you may instead type ESC followed by the character.)") 792If you have no Meta key, you may instead type ESC followed by the character.)")
790 (and auto-save-list-file-prefix 793 (and auto-save-list-file-prefix
791 (directory-files 794 (directory-files
792 (file-name-directory auto-save-list-file-prefix) 795 (file-name-directory auto-save-list-file-prefix)
793 nil 796 nil
794 (concat "\\`" 797 (concat "\\`"
795 (regexp-quote (file-name-nondirectory 798 (regexp-quote (file-name-nondirectory
796 auto-save-list-file-prefix))) 799 auto-save-list-file-prefix)))
797 t) 800 t)
798 (insert "\n\nIf an Emacs session crashed recently, " 801 (insert "\n\nIf an Emacs session crashed recently, "
799 "type M-x recover-session RET\nto recover" 802 "type M-x recover-session RET\nto recover"
800 " the files you were editing.")) 803 " the files you were editing."))
801 804
802 (insert "\n\n" (emacs-version) 805 (insert "\n\n" (emacs-version)
803 " 806 "
804Copyright (C) 1996 Free Software Foundation, Inc.") 807Copyright (C) 1996 Free Software Foundation, Inc.")
805 (if (and (eq (key-binding "\C-h\C-c") 'describe-copying) 808 (if (and (eq (key-binding "\C-h\C-c") 'describe-copying)
806 (eq (key-binding "\C-h\C-d") 'describe-distribution) 809 (eq (key-binding "\C-h\C-d") 'describe-distribution)
807 (eq (key-binding "\C-h\C-w") 'describe-no-warranty)) 810 (eq (key-binding "\C-h\C-w") 'describe-no-warranty))
808 (insert 811 (insert
809 "\n 812 "\n
810GNU Emacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details. 813GNU Emacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details.
811You may give out copies of Emacs; type C-h C-c to see the conditions. 814You may give out copies of Emacs; type C-h C-c to see the conditions.
812Type C-h C-d for information on getting the latest version.") 815Type C-h C-d for information on getting the latest version.")
813 (insert (substitute-command-keys 816 (insert (substitute-command-keys
814 "\n 817 "\n
815GNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for full details. 818GNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for full details.
816You may give out copies of Emacs; type \\[describe-copying] to see the conditions. 819You may give out copies of Emacs; type \\[describe-copying] to see the conditions.
817Type \\[describe-distribution] for information on getting the latest version."))) 820Type \\[describe-distribution] for information on getting the latest version.")))
818 (goto-char (point-min)) 821 (goto-char (point-min))
819 822
820 (set-buffer-modified-p nil) 823 (set-buffer-modified-p nil)
821 (sit-for 120)) 824 (sit-for 120))
822 (with-current-buffer (get-buffer "*scratch*") 825 (with-current-buffer (get-buffer "*scratch*")
823 (erase-buffer) 826 (erase-buffer)
824 (insert "\ 827 (insert "\
825If you want to create a file, don't type the text in this buffer. 828If you want to create a file, don't type the text in this buffer.
826This buffer is for notes you don't want to save, and for Lisp evaluation. 829This buffer is for notes you don't want to save, and for Lisp evaluation.
827If you want to create a file, first visit that file with C-x C-f, 830If you want to create a file, first visit that file with C-x C-f,
828then enter the text in that file's own buffer. 831then enter the text in that file's own buffer.
829 832
830") 833")
831 (set-buffer-modified-p nil))))) 834 (set-buffer-modified-p nil)))))))
832 ;; Delay 2 seconds after the init file error message 835 ;; Delay 2 seconds after the init file error message
833 ;; was displayed, so user can read it. 836 ;; was displayed, so user can read it.
834 (if init-file-had-error 837 (if init-file-had-error