;;; startup.el --- process Emacs shell arguments
;; Copyright (C) 1985, 1986, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-;; 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+;; 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: internal
:group 'internal)
(defcustom inhibit-splash-screen nil
- "*Non-nil inhibits the startup screen.
+ "Non-nil inhibits the startup screen.
+It also inhibits display of the initial message in the *scratch* buffer.
+
This is for use in your personal init file, once you are familiar
with the contents of the startup screen."
:type 'boolean
:type 'function
:group 'initialization)
-(defcustom init-file-user nil
+(defvar init-file-user nil
"Identity of user whose `.emacs' file is or was read.
The value is nil if `-q' or `--no-init-file' was specified,
meaning do not load any init file.
-Otherwise, the value may be the null string, meaning use the init file
-for the user that originally logged in, or it may be a
-string containing a user's name meaning use that person's init file.
+Otherwise, the value may be an empty string, meaning
+use the init file for the user who originally logged in,
+or it may be a string containing a user's name meaning
+use that person's init file.
In either of the latter cases, `(concat \"~\" init-file-user \"/\")'
evaluates to the name of the directory where the `.emacs' file was
looked for.
Setting `init-file-user' does not prevent Emacs from loading
-`site-start.el'. The only way to do that is to use `--no-site-file'."
- :type '(choice (const :tag "none" nil) string)
- :group 'initialization)
+`site-start.el'. The only way to do that is to use `--no-site-file'.")
(defcustom site-run-file "site-start"
"File containing site-wide run-time initializations.
(custom-reevaluate-setting 'mouse-wheel-down-event)
(custom-reevaluate-setting 'mouse-wheel-up-event)
(custom-reevaluate-setting 'file-name-shadow-mode)
+ (custom-reevaluate-setting 'send-mail-function)
(normal-erase-is-backspace-setup-frame)
")
"Initial message displayed in *scratch* buffer at startup.
-If this is nil, no message will be displayed."
+If this is nil, no message will be displayed.
+If `inhibit-splash-screen' is non-nil, then no message is displayed,
+regardless of the value of this variable."
:type '(choice (text :tag "Message")
(const :tag "none" nil))
:group 'initialization)
(emacs-version)
"\n"
:face '(variable-pitch :height 0.5)
- "Copyright (C) 2005 Free Software Foundation, Inc.")
+ "Copyright (C) 2006 Free Software Foundation, Inc.")
(and auto-save-list-file-prefix
;; Don't signal an error if the
;; directory for auto-save-list files
(force-mode-line-update)
(setq fancy-current-text (cdr fancy-current-text))))
-
(defun fancy-splash-default-action ()
"Stop displaying the splash screen buffer.
This is an internal function used to turn off the splash screen after
(if (and (memq 'down (event-modifiers last-command-event))
(eq (posn-window (event-start last-command-event))
(selected-window)))
- ;; This is a mouse-down event in the spash screen window.
+ ;; This is a mouse-down event in the splash screen window.
;; Ignore it and consume the corresponding mouse-up event.
(read-event)
(push last-command-event unread-command-events))
(throw 'exit nil))
+(defun fancy-splash-exit ()
+ "Exit the splash screen."
+ (if (get-buffer "GNU Emacs")
+ (throw 'stop-splashing nil)))
+
+(defun fancy-splash-delete-frame (frame)
+ "Exit the splash screen after the frame is deleted."
+ ;; We can not throw from `delete-frame-events', so we set up a timer
+ ;; to exit the recursive edit as soon as Emacs is idle again.
+ (if (frame-live-p frame)
+ (run-at-time 0 nil 'fancy-splash-exit)))
(defun fancy-splash-screens ()
"Display fancy splash screens when Emacs starts."
(setq splash-buffer (current-buffer))
(catch 'stop-splashing
(unwind-protect
- (let ((map (make-sparse-keymap)))
- (use-local-map map)
- (define-key map [switch-frame] 'ignore)
+ (let* ((map (make-sparse-keymap))
+ (overriding-local-map map)
+ ;; Catch if our frame is deleted; the delete-frame
+ ;; event is unreliable and is handled by
+ ;; `special-event-map' anyway.
+ (delete-frame-functions (cons 'fancy-splash-delete-frame
+ delete-frame-functions)))
(define-key map [t] 'fancy-splash-default-action)
(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
minor-mode-map-alist nil
(cancel-timer timer)
(setq display-hourglass old-hourglass
minor-mode-map-alist old-minor-mode-map-alist)
- (kill-buffer splash-buffer))))))
+ (kill-buffer splash-buffer)
+ (when (frame-live-p frame)
+ (select-frame frame)
+ (switch-to-buffer fancy-splash-outer-buffer)))))))
(defun fancy-splash-frame ()
"Return the frame to use for the fancy splash screen.
(let ((prev-buffer (current-buffer)))
(unwind-protect
(with-current-buffer (get-buffer-create "GNU Emacs")
- (let ((tab-width 8)
- (mode-line-format (propertize "---- %b %-"
- 'face '(:weight bold))))
-
+ (setq mode-line-format (propertize "---- %b %-"
+ 'face '(:weight bold)))
+ (let ((tab-width 8))
(if pure-space-overflow
(insert "Warning Warning Pure space overflow Warning Warning\n"))
")
(insert "\n\n" (emacs-version)
"
-Copyright (C) 2005 Free Software Foundation, Inc."))
+Copyright (C) 2006 Free Software Foundation, Inc."))
;; No mouse menus, so give help using kbd commands.
;; 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-display)
+ (eq (key-binding "\C-x\C-c") 'save-buffers-kill-terminal)
(eq (key-binding "\C-ht") 'help-with-tutorial)
(eq (key-binding "\C-hi") 'info)
(eq (key-binding "\C-hr") 'info-emacs-manual)
Get help %s
Emacs manual \\[info-emacs-manual]
Emacs tutorial \\[help-with-tutorial]\tUndo changes\t\\[advertised-undo]
-Buy manuals \\[view-order-manuals]\tExit Emacs\t\\[save-buffers-kill-display]
+Buy manuals \\[view-order-manuals]\tExit Emacs\t\\[save-buffers-kill-terminal]
Browse manuals \\[info]"
(let ((where (where-is-internal
'help-command nil t)))
(insert "\n\n" (emacs-version)
"
-Copyright (C) 2005 Free Software Foundation, Inc.")
+Copyright (C) 2006 Free Software Foundation, Inc.")
(if (and (eq (key-binding "\C-h\C-c") 'describe-copying)
(eq (key-binding "\C-h\C-d") 'describe-distribution)
Fancy splash screens are used on graphic displays,
normal otherwise."
(interactive)
- (if (use-fancy-splash-screens-p)
- (fancy-splash-screens)
- (normal-splash-screen)))
-
+ ;; Prevent recursive calls from server-process-filter.
+ (if (not (get-buffer "GNU Emacs"))
+ (if (use-fancy-splash-screens-p)
+ (fancy-splash-screens)
+ (normal-splash-screen))))
(defun command-line-1 (command-line-args-left)
(or noninteractive (input-pending-p) init-file-had-error
(longopts
(append '(("--funcall") ("--load") ("--insert") ("--kill")
("--directory") ("--eval") ("--execute") ("--no-splash")
- ("--find-file") ("--visit") ("--file"))
+ ("--find-file") ("--visit") ("--file") ("--no-desktop"))
(mapcar (lambda (elt)
(list (concat "-" (car elt))))
command-switch-alist)))
((equal argi "-kill")
(kill-emacs t))
+ ;; This is for when they use --no-desktop with -q, or
+ ;; don't load Desktop in their .emacs. If desktop.el
+ ;; _is_ loaded, it will handle this switch, and we
+ ;; won't see it by the time we get here.
+ ((equal argi "-no-desktop")
+ (message "\"--no-desktop\" ignored because the Desktop package is not loaded"))
+
((string-match "^\\+[0-9]+\\'" argi)
(setq line (string-to-number argi)))