comparison lisp/startup.el @ 440:8de8e3f6228a r21-2-28

Import from CVS: tag r21-2-28
author cvs
date Mon, 13 Aug 2007 11:33:38 +0200
parents 84b14dcb0985
children abe6d1db359e
comparison
equal deleted inserted replaced
439:357dd071b03c 440:8de8e3f6228a
105 "List of plausible roots of the XEmacs hierarchy.") 105 "List of plausible roots of the XEmacs hierarchy.")
106 106
107 (defvar user-init-directory-base ".xemacs" 107 (defvar user-init-directory-base ".xemacs"
108 "Base of directory where user-installed init files may go.") 108 "Base of directory where user-installed init files may go.")
109 109
110 (defvar user-init-file-base (cond 110 (defvar user-init-file-base-list (append
111 ((eq system-type 'ms-dos) "_emacs") 111 '(".emacs.elc" ".emacs.el" ".emacs")
112 (t ".emacs")) 112 (and (eq system-type 'windows-nt)
113 "Base of init file.") 113 '("_emacs.elc" "_emacs.el" "_emacs")))
114 "List of allowed init files. The first one found takes precedence.")
114 115
115 (defvar user-init-directory 116 (defvar user-init-directory
116 (file-name-as-directory 117 (file-name-as-directory
117 (paths-construct-path (list "~" user-init-directory-base))) 118 (paths-construct-path (list "~" user-init-directory-base)))
118 "Directory where user-installed init files may go.") 119 "Directory where user-installed init files may go.")
528 (setq user-init-directory (file-name-as-directory (pop args)))) 529 (setq user-init-directory (file-name-as-directory (pop args))))
529 ((or (string= arg "-u") 530 ((or (string= arg "-u")
530 (string= arg "-user")) 531 (string= arg "-user"))
531 (let* ((user (pop args)) 532 (let* ((user (pop args))
532 (home-user (concat "~" user))) 533 (home-user (concat "~" user)))
533 (setq user-init-file 534 (setq user-init-file (find-user-init-file home-user)
534 (paths-construct-path (list home-user user-init-file-base))) 535 user-init-directory (file-name-as-directory
535 (setq user-init-directory 536 (paths-construct-path
536 (file-name-as-directory 537 (list home-user user-init-directory-base))))))
537 (paths-construct-path (list home-user user-init-directory-base))))))
538 ((string= arg "-debug-init") 538 ((string= arg "-debug-init")
539 (setq init-file-debug t)) 539 (setq init-file-debug t))
540 ((string= arg "-unmapped") 540 ((string= arg "-unmapped")
541 (setq initial-frame-unmapped-p t)) 541 (setq initial-frame-unmapped-p t))
542 ((or (string= arg "-debug-paths") 542 ((or (string= arg "-debug-paths")
587 587
588 ;; When not in batch mode, this creates the first visible frame, 588 ;; When not in batch mode, this creates the first visible frame,
589 ;; and deletes the stdio device. 589 ;; and deletes the stdio device.
590 (frame-initialize)) 590 (frame-initialize))
591 591
592 ;; Reinitialize faces if necessary. This function changes face if
593 ;; it is created during auto-autoloads loading. Otherwise, it
594 ;; does nothing.
595 (startup-initialize-custom-faces)
596
592 ;; 597 ;;
593 ;; We have normality, I repeat, we have normality. Anything you still 598 ;; We have normality, I repeat, we have normality. Anything you still
594 ;; can't cope with is therefore your own problem. (And we don't need 599 ;; can't cope with is therefore your own problem. (And we don't need
595 ;; to kill XEmacs for it.) 600 ;; to kill XEmacs for it.)
596 ;; 601 ;;
631 ;; Strip off last hyphen and what follows, then try again 636 ;; Strip off last hyphen and what follows, then try again
632 (if (setq hyphend (string-match "[-_][^-_]+\\'" term)) 637 (if (setq hyphend (string-match "[-_][^-_]+\\'" term))
633 (setq term (substring term 0 hyphend)) 638 (setq term (substring term 0 hyphend))
634 (setq term nil)))))) 639 (setq term nil))))))
635 640
641 (defun find-user-init-file (&optional directory)
642 "Determine the user's init file."
643 (unless directory
644 (setq directory "~"))
645 (dolist (file user-init-file-base-list)
646 (let ((expanded (paths-construct-path (list directory file))))
647 (when (file-exists-p expanded)
648 (return expanded)))))
649
636 (defun load-user-init-file () 650 (defun load-user-init-file ()
637 "This function actually reads the init file, .emacs." 651 "This function actually reads the init file, .emacs."
638 (if (not user-init-file) 652 (if (not user-init-file)
639 (setq user-init-file 653 (setq user-init-file (find-user-init-file)))
640 (paths-construct-path (list "~" user-init-file-base))))
641 (load user-init-file t t t) 654 (load user-init-file t t t)
642 (unless inhibit-default-init 655 (unless inhibit-default-init
643 (let ((inhibit-startup-message nil)) 656 (let ((inhibit-startup-message nil))
644 ;; Users are supposed to be told their rights. 657 ;; Users are supposed to be told their rights.
645 ;; (Plus how to get help and how to undo.) 658 ;; (Plus how to get help and how to undo.)
1015 (if (= indice (- (length elements) 1)) 1028 (if (= indice (- (length elements) 1))
1016 0 1029 0
1017 (1+ indice ))) 1030 (1+ indice )))
1018 ))) 1031 )))
1019 1032
1020 ;; ### This function now returns the (possibly nil) timeout circulating the 1033 ;; #### This function now returns the (possibly nil) timeout circulating the
1021 ;; splash-frame elements 1034 ;; splash-frame elements
1022 (defun display-splash-frame () 1035 (defun display-splash-frame ()
1023 (let ((logo xemacs-logo) 1036 (let ((logo xemacs-logo)
1024 (buffer-read-only nil) 1037 (buffer-read-only nil)
1025 (cramped-p (eq 'tty (console-type)))) 1038 (cramped-p (eq 'tty (console-type))))