summaryrefslogtreecommitdiff
path: root/lisp/startup.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/startup.el')
-rw-r--r--lisp/startup.el81
1 files changed, 48 insertions, 33 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index b96503603c2..59bcabf4a9e 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -784,6 +784,7 @@ opening the first frame (e.g. open a connection to an X server).")
(custom-reevaluate-setting 'mouse-wheel-up-event)
(custom-reevaluate-setting 'file-name-shadow-mode)
(custom-reevaluate-setting 'send-mail-function)
+ (custom-reevaluate-setting 'focus-follows-mouse)
(normal-erase-is-backspace-setup-frame)
@@ -1097,10 +1098,7 @@ regardless of the value of this variable."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar fancy-splash-text
- '((:face variable-pitch
- "You can do basic editing with the menu bar and scroll bar \
-using the mouse.\n\n"
- :face (variable-pitch :weight bold)
+ '((:face (variable-pitch :weight bold)
"Important Help menu items:\n"
:face variable-pitch
(lambda ()
@@ -1124,8 +1122,8 @@ using the mouse.\n\n"
"\n")))
:face variable-pitch "\
Emacs FAQ\tFrequently asked questions and answers
-Read the Emacs Manual\tView the Emacs manual using Info
-\(Non)Warranty\tGNU Emacs comes with "
+View Emacs Manual\tView the Emacs manual using Info
+Absence of Warranty\tGNU Emacs comes with "
:face (variable-pitch :slant oblique)
"ABSOLUTELY NO WARRANTY\n"
:face variable-pitch
@@ -1133,18 +1131,16 @@ Read the Emacs Manual\tView the Emacs manual using Info
Copying Conditions\tConditions for redistributing and changing Emacs
Getting New Versions\tHow to obtain the latest version of Emacs
More Manuals / Ordering Manuals Buying printed manuals from the FSF\n")
- (:face variable-pitch
- "You can do basic editing with the menu bar and scroll bar \
-using the mouse.\n\n"
- :face (variable-pitch :weight bold)
- "Useful File menu items:\n"
- :face variable-pitch "\
-Exit Emacs\t(Or type Control-x followed by Control-c)
+ (:face (variable-pitch :weight bold)
+ "Useful File menu items:\n"
+ :face variable-pitch "\
+Exit Emacs\t\t(Or type Control-x followed by Control-c)
Recover Crashed Session\tRecover files you were editing before a crash
+
"
))
"A list of texts to show in the middle part of splash screens.
@@ -1249,6 +1245,10 @@ where FACE is a valid face specification, as it can be used with
"GNU Emacs is one component of the GNU/Linux operating system."
"GNU Emacs is one component of the GNU operating system."))
(insert "\n")
+ (fancy-splash-insert
+ :face 'variable-pitch
+ "You can do basic editing with the menu bar and scroll bar \
+using the mouse.\n\n")
(if fancy-splash-outer-buffer
(fancy-splash-insert
:face 'variable-pitch
@@ -1285,7 +1285,7 @@ where FACE is a valid face specification, as it can be used with
t)
(fancy-splash-insert :face '(variable-pitch :foreground "red")
"\n\nIf an Emacs session crashed recently, "
- "type M-x recover-session RET\nto recover"
+ "type Meta-x recover-session RET\nto recover"
" the files you were editing."))))
(defun fancy-splash-screens-1 (buffer)
@@ -1340,7 +1340,6 @@ mouse."
(defun fancy-splash-screens (&optional hide-on-input)
"Display fancy splash screens when Emacs starts."
- (setq fancy-splash-help-echo (startup-echo-area-message))
(if hide-on-input
(let ((old-hourglass display-hourglass)
(fancy-splash-outer-buffer (current-buffer))
@@ -1352,11 +1351,11 @@ mouse."
(save-selected-window
(select-frame frame)
(switch-to-buffer "GNU Emacs")
- (setq tab-width 20)
(setq splash-buffer (current-buffer))
(catch 'stop-splashing
(unwind-protect
(let* ((map (make-sparse-keymap))
+ (cursor-type nil)
(overriding-local-map map)
;; Catch if our frame is deleted; the delete-frame
;; event is unreliable and is handled by
@@ -1367,8 +1366,7 @@ mouse."
(define-key map [mouse-movement] 'ignore)
(define-key map [mode-line t] 'ignore)
(define-key map [select-window] 'ignore)
- (setq cursor-type nil
- display-hourglass nil
+ (setq display-hourglass nil
minor-mode-map-alist nil
emulation-mode-map-alists nil
buffer-undo-list t
@@ -1379,6 +1377,7 @@ mouse."
timer (run-with-timer 0 fancy-splash-delay
#'fancy-splash-screens-1
splash-buffer))
+ (message "%s" (startup-echo-area-message))
(recursive-edit))
(cancel-timer timer)
(setq display-hourglass old-hourglass
@@ -1388,11 +1387,12 @@ mouse."
(when (frame-live-p frame)
(select-frame frame)
(switch-to-buffer fancy-splash-outer-buffer))))))
- ;; If hide-on-input is non-nil, don't hide the buffer on input.
+ ;; If hide-on-input is nil, don't hide the buffer on input.
(if (or (window-minibuffer-p)
(window-dedicated-p (selected-window)))
(pop-to-buffer (current-buffer))
- (switch-to-buffer "GNU Emacs"))
+ (switch-to-buffer "*About GNU Emacs*"))
+ (setq buffer-read-only nil)
(erase-buffer)
(if pure-space-overflow
(insert "\
@@ -1401,9 +1401,16 @@ Warning Warning!!! Pure space overflow !!!Warning Warning
(let (fancy-splash-outer-buffer)
(fancy-splash-head)
(dolist (text fancy-splash-text)
- (apply #'fancy-splash-insert text))
+ (apply #'fancy-splash-insert text)
+ (insert "\n"))
+ (skip-chars-backward "\n")
+ (delete-region (point) (point-max))
+ (insert "\n")
(fancy-splash-tail)
(set-buffer-modified-p nil)
+ (setq buffer-read-only t)
+ (if (and view-read-only (not view-mode))
+ (view-mode-enter nil 'kill-buffer))
(goto-char (point-min)))))
@@ -1441,6 +1448,7 @@ we put it on this frame."
(let ((prev-buffer (current-buffer)))
(unwind-protect
(with-current-buffer (get-buffer-create "GNU Emacs")
+ (setq buffer-read-only nil)
(erase-buffer)
(set (make-local-variable 'tab-width) 8)
(if hide-on-input
@@ -1575,26 +1583,32 @@ Type \\[describe-distribution] for information on getting the latest version."))
auto-save-list-file-prefix)))
t)
(insert "\n\nIf an Emacs session crashed recently, "
- "type M-x recover-session RET\nto recover"
+ "type Meta-x recover-session RET\nto recover"
" the files you were editing."))
;; Display the input that we set up in the buffer.
(set-buffer-modified-p nil)
+ (setq buffer-read-only t)
+ (if (and view-read-only (not view-mode))
+ (view-mode-enter nil 'kill-buffer))
(goto-char (point-min))
- (if (or (window-minibuffer-p)
- (window-dedicated-p (selected-window)))
- ;; If hide-on-input is nil, creating a new frame will
- ;; generate enough events that the subsequent `sit-for'
- ;; will immediately return anyway.
- (pop-to-buffer (current-buffer))
- (if hide-on-input
+ (if hide-on-input
+ (if (or (window-minibuffer-p)
+ (window-dedicated-p (selected-window)))
+ ;; If hide-on-input is nil, creating a new frame will
+ ;; generate enough events that the subsequent `sit-for'
+ ;; will immediately return anyway.
+ nil ;; (pop-to-buffer (current-buffer))
(save-window-excursion
(switch-to-buffer (current-buffer))
(sit-for 120))
- (switch-to-buffer (current-buffer)))))
+ (condition-case nil
+ (switch-to-buffer (current-buffer))))))
;; Unwind ... ensure splash buffer is killed
(if hide-on-input
- (kill-buffer "GNU Emacs")))))
+ (kill-buffer "GNU Emacs")
+ (switch-to-buffer "GNU Emacs")
+ (rename-buffer "*About GNU Emacs*" t)))))
(defun startup-echo-area-message ()
@@ -1651,8 +1665,9 @@ Type \\[describe-distribution] for information on getting the latest version."))
(defun display-splash-screen (&optional hide-on-input)
"Display splash screen according to display.
Fancy splash screens are used on graphic displays,
-normal otherwise."
- (interactive)
+normal otherwise.
+With a prefix argument, any user input hides the splash screen."
+ (interactive "P")
;; Prevent recursive calls from server-process-filter.
(if (not (get-buffer "GNU Emacs"))
(if (use-fancy-splash-screens-p)