diff options
author | Richard M. Stallman <rms@gnu.org> | 2005-10-28 15:43:15 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2005-10-28 15:43:15 +0000 |
commit | ce98f555a733c1b949369c0f98844178660a76c2 (patch) | |
tree | c06b657113c6c508080af6895ceb6d04ea053195 /lisp/startup.el | |
parent | a312f21413fa647cb448aeec17bf11e8de76767f (diff) | |
download | emacs-ce98f555a733c1b949369c0f98844178660a76c2.tar.gz |
(command-line): Call before-init-hook earlier.
Warn about some bad characters in -u user name.
Diffstat (limited to 'lisp/startup.el')
-rw-r--r-- | lisp/startup.el | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 28a29fd6a2e..a9535eed881 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -731,6 +731,8 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." (and command-line-args (setcdr command-line-args args))) + (run-hooks 'before-init-hook) + ;; Under X Window, this creates the X frame and deletes the terminal frame. (when (fboundp 'frame-initialize) (frame-initialize)) @@ -788,8 +790,6 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." (old-font-list-limit font-list-limit) (old-face-ignored-fonts face-ignored-fonts)) - (run-hooks 'before-init-hook) - ;; Run the site-start library if it exists. The point of this file is ;; that it is run before .emacs. There is no point in doing this after ;; .emacs; that is useless. @@ -801,12 +801,18 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." (setq inhibit-startup-message nil) ;; Warn for invalid user name. - (and init-file-user - (not (file-directory-p (expand-file-name (concat "~" init-file-user)))) - (display-warning 'initialization - (format "User %s has no home directory" - init-file-user) - :error)) + (when init-file-user + (if (string-match "[~/:\n]" init-file-user) + (display-warning 'initialization + (format "Invalid user name %s" + init-file-user) + :error) + (if (file-directory-p (expand-file-name (concat "~" init-file-user))) + nil + (display-warning 'initialization + (format "User %s has no home directory" + init-file-user) + :error)))) ;; Load that user's init file, or the default one, or none. (let (debug-on-error-from-init-file |