;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with XEmacs; see the file COPYING. If not, write to the
+;; along with XEmacs; see the file COPYING. If not, write to the
;; Free Software Foundation, 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
(defvar user-init-directory-base ".xemacs"
"Base of directory where user-installed init files may go.")
-(defvar user-init-file-base (cond
- ((eq system-type 'ms-dos) "_emacs")
- (t ".emacs"))
- "Base of init file.")
+(defvar user-init-file-base-list (append
+ '(".emacs.elc" ".emacs.el" ".emacs")
+ (and (eq system-type 'windows-nt)
+ '("_emacs.elc" "_emacs.el" "_emacs")))
+ "List of allowed init files. The first one found takes precedence.")
(defvar user-init-directory
(file-name-as-directory
(princ "\n\n" stream)))
(when (not suppress-early-error-handler-backtrace)
(backtrace stream t)))
+ (if (fboundp 'mswindows-message-box)
+ (mswindows-message-box "Initialization error"))
(kill-emacs -1))
-(defvar lock-directory)
-(defvar superlock-file)
-
(defun normal-top-level ()
(if command-line-processed
(message "Back to top level.")
(string= arg "-user"))
(let* ((user (pop args))
(home-user (concat "~" user)))
- (setq user-init-file
- (paths-construct-path (list home-user user-init-file-base)))
- (setq user-init-directory
- (file-name-as-directory
- (paths-construct-path (list home-user user-init-directory-base))))))
+ (setq user-init-file (find-user-init-file home-user)
+ user-init-directory (file-name-as-directory
+ (paths-construct-path
+ (list home-user user-init-directory-base))))))
((string= arg "-debug-init")
(setq init-file-debug t))
((string= arg "-unmapped")
;; and deletes the stdio device.
(frame-initialize))
+ ;; Reinitialize faces if necessary. This function changes face if
+ ;; it is created during auto-autoloads loading. Otherwise, it
+ ;; does nothing.
+ (startup-initialize-custom-faces)
+
;;
;; We have normality, I repeat, we have normality. Anything you still
;; can't cope with is therefore your own problem. (And we don't need
(setq term (substring term 0 hyphend))
(setq term nil))))))
+(defun find-user-init-file (&optional directory)
+ "Determine the user's init file."
+ (unless directory
+ (setq directory "~"))
+ (dolist (file user-init-file-base-list)
+ (let ((expanded (paths-construct-path (list directory file))))
+ (when (file-exists-p expanded)
+ (return expanded)))))
+
(defun load-user-init-file ()
"This function actually reads the init file, .emacs."
- (if (not user-init-file)
- (setq user-init-file
- (paths-construct-path (list "~" user-init-file-base))))
- (load user-init-file t t t)
+ (if (or user-init-file
+ (setq user-init-file (find-user-init-file)))
+ (load user-init-file t t t))
(unless inhibit-default-init
(let ((inhibit-startup-message nil))
;; Users are supposed to be told their rights.
(file-count 0)
(line nil)
(end-of-options nil)
- first-file-buffer file-p arg tem)
+ file-p arg tem)
(while command-line-args-left
(setq arg (pop command-line-args-left))
(cond
(incf file-count)
(setq arg (expand-file-name arg dir))
(cond
- ((= file-count 1) (setq first-file-buffer
- (progn (find-file arg) (current-buffer))))
+ ((= file-count 1)
+ (find-file arg))
(noninteractive (find-file arg))
(t (find-file-other-window arg)))
(when line
(1+ indice )))
)))
-;; ### This function now returns the (possibly nil) timeout circulating the
+;; #### This function now returns the (possibly nil) timeout circulating the
;; splash-frame elements
(defun display-splash-frame ()
(let ((logo xemacs-logo)
(princ (format "Info-directory-list:\n%S\n" Info-directory-list)
'external-debugging-output))
- (if (boundp 'lock-directory)
- (progn
- (setq lock-directory (paths-find-lock-directory roots))
- (setq superlock-file (paths-find-superlock-file lock-directory))
-
- (if debug-paths
- (progn
- (princ (format "lock-directory:\n%S\n" lock-directory)
- 'external-debugging-output)
- (princ (format "superlock-file:\n%S\n" superlock-file)
- 'external-debugging-output)))))
-
(setq exec-directory (paths-find-exec-directory roots))
(if debug-paths
(princ (buffer-string) 'external-debugging-output)))
(defun startup-setup-paths-warning ()
- (let ((lock (if (boundp 'lock-directory) lock-directory 't))
- (warnings '()))
- (if (and (stringp lock) (null (file-directory-p lock)))
- (setq lock nil))
+ (let ((warnings '()))
(cond
((null (and lisp-directory exec-directory data-directory doc-directory
- load-path
- lock))
+ load-path))
(save-excursion
(set-buffer (get-buffer-create " *warning-tmp*"))
(erase-buffer)
(buffer-disable-undo (current-buffer))
(if (null lisp-directory) (push "lisp-directory" warnings))
- (if (null lock) (push "lock-directory" warnings))
(if (null exec-directory) (push "exec-directory" warnings))
(if (null data-directory) (push "data-directory" warnings))
(if (null doc-directory) (push "doc-directory" warnings))