;;; startup.el --- process Emacs shell arguments
-;; Copyright (C) 1985, 86, 92, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 86, 92, 94, 95, 96, 97, 98, 99, 2000
+;; Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: internal
(setq normal-top-level-add-subdirs-inode-list
(cons attrs normal-top-level-add-subdirs-inode-list))
(while contents
- (unless (member (car contents) '("." ".." "RCS" "CVS"))
+ ;; The lower-case variants of RCS and CVS are for DOS/Windows.
+ (unless (member (car contents) '("." ".." "RCS" "CVS" "rcs" "cvs"))
(when (and (string-match "\\`[[:alnum:]]" (car contents))
;; Avoid doing a `stat' when it isn't necessary
;; because that can cause trouble when an NFS server
(string= vc "simple"))
(setq version-control 'never))))
- (set-locale-environment nil)
-
;;! This has been commented out; I currently find the behavior when
;;! split-window-keep-point is nil disturbing, but if I can get used
;;! to it, then it would be better to eliminate the option.
(not noninteractive))
(setq command-line-args (tty-handle-args command-line-args)))
+ (set-locale-environment nil)
+
(let ((done nil)
(args (cdr command-line-args)))
(setq-default blink-cursor t)
(blink-cursor-mode 1))
+ (when (and (not noninteractive)
+ ;; DOS/Windows systems have a PC-type keyboard which has both
+ ;; <delete> and <backspace> keys.
+ (or (memq system-type '(ms-dos windows-nt))
+ (memq window-system '(x))))
+ (setq-default delete-key-deletes-forward
+ (or (not (fboundp 'x-backspace-delete-keys-p))
+ (x-backspace-delete-keys-p)))
+ (delete-key-deletes-forward-mode 1))
+
(when (and (not noninteractive)
(display-graphic-p)
(fboundp 'x-show-tip))
;; into user-init-file.
(setq user-init-file t)
(load user-init-file-1 t t)
+
;; If we did not find the user's init file,
;; set user-init-file conclusively to nil;
;; don't let it be set from default.el.
(if (eq user-init-file t)
(setq user-init-file nil))
+
;; If we loaded a compiled file, set
;; `user-init-file' to the source version if that
;; exists.
(when (and user-init-file
(equal (file-name-extension user-init-file)
- "elc")
- (file-exists-p user-init-file-1))
- (when (file-newer-than-file-p
- user-init-file-1 user-init-file)
- (message "Warning: %s is newer than %s"
- user-init-file-1 user-init-file)
- (sit-for 1))
- (setq user-init-file user-init-file-1))
+ "elc"))
+ (let* ((source (file-name-sans-extension user-init-file))
+ (alt (concat source ".el")))
+ (setq source (cond ((file-exists-p alt) alt)
+ ((file-exists-p source) source)
+ (t nil)))
+ (when source
+ (when (file-newer-than-file-p source user-init-file)
+ (message "Warning: %s is newer than %s"
+ source user-init-file)
+ (sit-for 1))
+ (setq user-init-file source))))
+
(or inhibit-default-init
(let ((inhibit-startup-message nil))
;; Users are supposed to be told their rights.
"You can do basic editing with the menu bar and scroll bar \
using the mouse.\n\n"
:face (variable-pitch :weight bold)
- "Useful Files menu items:\n"
+ "Useful File menu items:\n"
:face variable-pitch "\
Exit Emacs\t(or type Control-x followed by Control-c)
Recover Session\trecover files you were editing before a crash
(kill-buffer splash-buffer)))))
+(defun use-fancy-splash-screens-p ()
+ "Return t if fancy splash screens should be used."
+ (when (or (and (display-color-p)
+ (image-type-available-p 'xpm))
+ (image-type-available-p 'pbm))
+ (let* ((img (create-image (or fancy-splash-image
+ (if (and (display-color-p)
+ (image-type-available-p 'xpm))
+ "splash.xpm" "splash.pbm"))))
+ (image-height (and img (cdr (image-size img))))
+ (window-height (1- (window-height (selected-window)))))
+ (> window-height (+ image-height 14)))))
+
+
(defun startup-echo-area-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."
(if (assq 'display (frame-parameters))
- (if (or (and (display-color-p)
- (image-type-available-p 'xpm))
- (image-type-available-p 'pbm))
+ (if (use-fancy-splash-screens-p)
(progn
(setq wait-for-input nil)
(fancy-splash-screens))
(insert "\
You can do basic editing with the menu bar and scroll bar using the mouse.
-Useful Files menu items:
+Useful File menu items:
Exit Emacs (or type Control-x followed by Control-c)
Recover Session recover files you were editing before a crash