X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fstartup.el;h=2fcc7ae964d65e8123e7a34f5d2d0372327b23da;hb=a870577e6be49312e64df70aad42a2160b22e013;hp=734e0b4d093e826c1c9f31773c44fb0f893c9abe;hpb=dd8f4c0e5ff27909836e7478df6b17d816a0db28;p=chise%2Fxemacs-chise.git diff --git a/lisp/startup.el b/lisp/startup.el index 734e0b4..2fcc7ae 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -136,7 +136,7 @@ Otherwise, XEmacs will offer migration to the init directory.") ;; #### called `site-run-file' in FSFmacs -(defvar site-start-file (purecopy "site-start") +(defvar site-start-file "site-start" "File containing site-wide run-time initializations. This file is loaded at run-time before `.emacs'. It contains inits that need to be in place for the entire site, but @@ -159,18 +159,17 @@ is less convenient.") ;;We do that if this regexp matches the locale name ;;specified by the LC_ALL, LC_CTYPE and LANG environment variables.") -(defvar mail-host-address nil - "*Name of this machine, for purposes of naming users.") +(defcustom mail-host-address nil + "*Name of this machine, for purposes of naming users." + :type 'string + :group 'mail) -(defvar user-mail-address nil +(defcustom user-mail-address nil "*Full mailing address of this user. This is initialized based on `mail-host-address', -after your init file is read, in case it sets `mail-host-address'.") - -(defvar auto-save-list-file-prefix "~/.saves-" - "Prefix for generating auto-save-list-file-name. -Emacs's pid and the system name will be appended to -this prefix to create a unique file name.") +after your init file is read, in case it sets `mail-host-address'." + :type 'string + :group 'mail) (defvar init-file-debug nil) @@ -186,23 +185,22 @@ after, and will not be true at any time before.") (defvar command-switch-alist - (purecopy - '(("-help" . command-line-do-help) - ("-version". command-line-do-version) - ("-V" . command-line-do-version) - ("-funcall". command-line-do-funcall) - ("-f" . command-line-do-funcall) - ("-e" . command-line-do-funcall-1) - ("-eval" . command-line-do-eval) - ("-load" . command-line-do-load) - ("-l" . command-line-do-load) - ("-insert" . command-line-do-insert) - ("-i" . command-line-do-insert) - ("-kill" . command-line-do-kill) - ;; Options like +35 are handled specially. - ;; Window-system, site, or package-specific code might add to this. - ;; X11 handles its options by letting Xt remove args from this list. - )) + '(("-help" . command-line-do-help) + ("-version". command-line-do-version) + ("-V" . command-line-do-version) + ("-funcall". command-line-do-funcall) + ("-f" . command-line-do-funcall) + ("-e" . command-line-do-funcall-1) + ("-eval" . command-line-do-eval) + ("-load" . command-line-do-load) + ("-l" . command-line-do-load) + ("-insert" . command-line-do-insert) + ("-i" . command-line-do-insert) + ("-kill" . command-line-do-kill) + ;; Options like +35 are handled specially. + ;; Window-system, site, or package-specific code might add to this. + ;; X11 handles its options by letting Xt remove args from this list. + ) "Alist of command-line switches. Elements look like (SWITCH-STRING . HANDLER-FUNCTION). HANDLER-FUNCTION receives switch name as sole arg; @@ -229,6 +227,9 @@ command line options plus the following: In addition, the") "The")) (princ " following options are accepted: + -sd Show dump ID. Ignored when configured without --pdump. + -nd Don't load the dump file. Roughly like old temacs. + Ignored when configured without --pdump. -t Use TTY instead of the terminal for input and output. This implies the -nw option. -nw Inhibit the use of any window-system-specific @@ -244,7 +245,7 @@ In addition, the") -vanilla Equivalent to -q -no-site-file -no-early-packages. -q Same as -no-init-file. -user-init-file Use as init file. - -user-init-directory use as init directory. + -user-init-directory Use as init directory. -user Load user's init file instead of your own. Equivalent to -user-init-file ~/.emacs -user-init-directory ~/.xemacs/ @@ -445,12 +446,13 @@ Type ^H^H^H (Control-h Control-h Control-h) to get more help options.\n") (setq default-directory (abbreviate-file-name default-directory)) ;; Specify the file for recording all the auto save files of ;; this session. This is used by recover-session. - (setq auto-save-list-file-name - (expand-file-name - (format "%s%d-%s" - auto-save-list-file-prefix - (emacs-pid) - (system-name)))) + (if auto-save-list-file-prefix + (setq auto-save-list-file-name + (expand-file-name + (format "%s%d-%s" + auto-save-list-file-prefix + (emacs-pid) + (system-name))))) (run-hooks 'emacs-startup-hook) (and term-setup-hook (run-hooks 'term-setup-hook)) @@ -667,7 +669,7 @@ If this is nil, no message will be displayed.") (catch 'found (dolist (file user-init-file-base-list) (let ((expanded (expand-file-name file init-directory))) - (when (file-exists-p expanded) + (when (file-readable-p expanded) (throw 'found expanded))))))) (defun find-user-home-directory-init-file (&optional home-directory) @@ -676,7 +678,7 @@ If this is nil, no message will be displayed.") (catch 'found (dolist (file user-home-init-file-base-list) (let ((expanded (expand-file-name file home-directory))) - (when (file-exists-p expanded) + (when (file-readable-p expanded) (throw 'found expanded)))) nil))) @@ -691,7 +693,8 @@ If this is nil, no message will be displayed.") "Ask user if she wants to migrate the init file(s) to new location." (if (and (not load-home-init-file) (not (find-user-init-directory-init-file user-init-directory)) - (file-exists-p user-init-file)) + (stringp user-init-file) + (file-readable-p user-init-file)) (if (with-output-to-temp-buffer (help-buffer-name nil) (progn (princ "XEmacs recommends that the initialization code in @@ -735,13 +738,18 @@ perform the migration at any time with M-x migrate-user-init-file.") (defun load-user-init-file () "This function actually reads the init file." - (if (or user-init-file - (setq user-init-file (find-user-init-file user-init-directory))) + (if (not user-init-file) + (setq user-init-file + (find-user-init-file user-init-directory))) + (if (and user-init-file + (file-readable-p user-init-file)) (load user-init-file t t t)) (if (not custom-file) (setq custom-file (make-custom-file-name user-init-file))) - (if (and (not (string= custom-file user-init-file)) - (file-exists-p custom-file)) + (if (and custom-file + (or (not user-init-file) + (not (string= custom-file user-init-file))) + (file-readable-p custom-file)) (load custom-file t t t)) (unless inhibit-default-init (let ((inhibit-startup-message nil))