- (unwind-protect
- (progn
- ;; The convention for this piece of code is that
- ;; each piece of output starts with one or two newlines
- ;; and does not end with any newlines.
- (insert (emacs-version)
- "
-Copyright (C) 1996 Free Software Foundation, Inc.")
- ;; If keys have their default meanings,
- ;; use precomputed string to save lots of time.
- (if (and (eq (key-binding "\C-h") 'help-command)
- (eq (key-binding "\C-xu") 'advertised-undo)
- (eq (key-binding "\C-x\C-c") 'save-buffers-kill-emacs)
- (eq (key-binding "\C-ht") 'help-with-tutorial)
- (eq (key-binding "\C-hi") 'info))
- (insert "\n
-Type C-x C-c to exit Emacs.
-Type C-h for help; C-x u to undo changes.
-Type C-h t for a tutorial on using Emacs.
-Type C-h i to enter Info, which you can use to read GNU documentation.")
- (insert (substitute-command-keys
- (format "\n
-Type \\[save-buffers-kill-emacs] to exit Emacs.
-Type %s for help; \\[advertised-undo] to undo changes.
-Type \\[help-with-tutorial] for a tutorial on using Emacs.
-Type \\[info] to enter Info, which you can use to read GNU documentation."
- (let ((where (where-is-internal
- 'help-command nil t)))
- (if where
- (key-description where)
- "M-x help"))))))
- ;; Many users seem to have problems with these.
- (insert "
-(`C-' means use the CTRL key. `M-' means use the Meta (or Alt) key.
+ (when (= (buffer-size) 0)
+ (let ((buffer-undo-list t))
+ (unwind-protect
+ (when (not (input-pending-p))
+ (goto-char (point-max))
+ ;; The convention for this piece of code is that
+ ;; each piece of output starts with one or two newlines
+ ;; and does not end with any newlines.
+ (insert "Welcome to GNU Emacs")
+ (if (eq system-type 'gnu/linux)
+ (insert ", one component of a Linux-based GNU system."))
+ (insert "\n")
+ (if (assq 'display (frame-parameters))
+ (progn
+ (insert "\
+The menu bar and scroll bar are sufficient for basic editing with the mouse.
+
+Useful Files menu items:
+Exit Emacs (or type Control-x followed by Control-c)
+Recover Session recover files you were editing before a crash
+
+Important Help menu items:
+Emacs Tutorial Learn-by-doing tutorial for using Emacs efficiently.
+\(Non)Warranty GNU Emacs comes with ABSOLUTELY NO WARRANTY
+Copying Conditions Conditions for redistributing and changing Emacs.
+Getting New Versions How to obtain the latest version of Emacs.
+")
+ (insert "\n\n" (emacs-version)
+ "
+Copyright (C) 1999 Free Software Foundation, Inc."))
+ ;; If keys have their default meanings,
+ ;; use precomputed string to save lots of time.
+ (if (and (eq (key-binding "\C-h") 'help-command)
+ (eq (key-binding "\C-xu") 'advertised-undo)
+ (eq (key-binding "\C-x\C-c") 'save-buffers-kill-emacs)
+ (eq (key-binding "\C-ht") 'help-with-tutorial)
+ (eq (key-binding "\C-hi") 'info)
+ (eq (key-binding "\C-h\C-n") 'view-emacs-news))
+ (insert "
+Get help C-h (Hold down CTRL and press h)
+Undo changes C-x u Exit Emacs C-x C-c
+Get a tutorial C-h t Use Info to read docs C-h i")
+ (insert (substitute-command-keys
+ (format "\n
+Get help %s
+Undo changes \\[advertised-undo]
+Exit Emacs \\[save-buffers-kill-emacs]
+Get a tutorial \\[help-with-tutorial]
+Use Info to read docs \\[info]"
+ (let ((where (where-is-internal
+ 'help-command nil t)))
+ (if where
+ (key-description where)
+ "M-x help"))))))
+ ;; Say how to use the menu bar
+ ;; if that is not with the mouse.
+ (if (and (eq (key-binding "\M-`") 'tmm-menubar)
+ (eq (key-binding [f10]) 'tmm-menubar))
+ (insert "
+Activate menubar F10 or ESC ` or M-`")
+ (insert (substitute-command-keys "
+Activate menubar \\[tmm-menubar]")))
+
+ ;; Windows and MSDOS (currently) do not count as
+ ;; window systems, but do have mouse support.
+ (if window-system
+ (insert "
+Mode-specific menu C-mouse-3 (third button, with CTRL)"))
+ ;; Many users seem to have problems with these.
+ (insert "
+\(`C-' means use the CTRL key. `M-' means use the Meta (or Alt) key.