Mercurial > hg > xemacs-beta
comparison lisp/startup.el @ 290:c9fe270a4101 r21-0b43
Import from CVS: tag r21-0b43
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:36:47 +0200 |
parents | e11d67e05968 |
children | 4b85ae5eabfb |
comparison
equal
deleted
inserted
replaced
289:6e6992ccc4b6 | 290:c9fe270a4101 |
---|---|
76 XEmacs loads the user's initialization file.") | 76 XEmacs loads the user's initialization file.") |
77 | 77 |
78 (defvar after-init-hook nil | 78 (defvar after-init-hook nil |
79 "*Functions to call after loading the init file (`.emacs'). | 79 "*Functions to call after loading the init file (`.emacs'). |
80 The call is not protected by a condition-case, so you can set `debug-on-error' | 80 The call is not protected by a condition-case, so you can set `debug-on-error' |
81 in `init.el', and put all the actual code on `after-init-hook'.") | 81 in `.emacs', and put all the actual code on `after-init-hook'.") |
82 | 82 |
83 (defvar term-setup-hook nil | 83 (defvar term-setup-hook nil |
84 "*Functions to be called after loading terminal-specific Lisp code. | 84 "*Functions to be called after loading terminal-specific Lisp code. |
85 See `run-hooks'. This variable exists for users to set, so as to | 85 See `run-hooks'. This variable exists for users to set, so as to |
86 override the definitions made by the terminal-specific file. XEmacs | 86 override the definitions made by the terminal-specific file. XEmacs |
108 The value is nil if no init file is being used; otherwise, it may be either | 108 The value is nil if no init file is being used; otherwise, it may be either |
109 the null string, meaning that the init file was taken from the user that | 109 the null string, meaning that the init file was taken from the user that |
110 originally logged in, or it may be a string containing a user's name. | 110 originally logged in, or it may be a string containing a user's name. |
111 | 111 |
112 In either of the latter cases, `(concat \"~\" init-file-user \"/\")' | 112 In either of the latter cases, `(concat \"~\" init-file-user \"/\")' |
113 evaluates to the name of the directory where the `init.el' file was | 113 evaluates to the name of the directory in which the `.emacs' file was |
114 looked for. | 114 searched for. |
115 | 115 |
116 Setting `init-file-user' does not prevent Emacs from loading | 116 Setting `init-file-user' does not prevent Emacs from loading |
117 `site-start.el'. The only way to do that is to use `--no-site-file'.") | 117 `site-start.el'. The only way to do that is to use `--no-site-file'.") |
118 | 118 |
119 ;; #### called `site-run-file' in FSFmacs | 119 ;; #### called `site-run-file' in FSFmacs |
611 (if (setq hyphend (string-match "[-_][^-_]+\\'" term)) | 611 (if (setq hyphend (string-match "[-_][^-_]+\\'" term)) |
612 (setq term (substring term 0 hyphend)) | 612 (setq term (substring term 0 hyphend)) |
613 (setq term nil)))))) | 613 (setq term nil)))))) |
614 | 614 |
615 (defconst user-init-directory "/.xemacs/" | 615 (defconst user-init-directory "/.xemacs/" |
616 "Directory where user initialization and user-installed packages may go.") | 616 "Directory where user-installed packages may go.") |
617 (define-obsolete-variable-alias | 617 (define-obsolete-variable-alias |
618 'emacs-user-extension-dir | 618 'emacs-user-extension-dir |
619 'user-init-directory) | 619 'user-init-directory) |
620 | 620 |
621 (defun load-user-init-file (init-file-user) | 621 (defun load-user-init-file (init-file-user) |
622 "This function actually reads the init files. | 622 "This function actually reads the init file, .emacs." |
623 First try .xemacs/init, then try .emacs, but only load one of the two." | |
624 (when init-file-user | 623 (when init-file-user |
624 ;; purge references to init.el and options.el | |
625 ;; convert these to use paths-construct-path for eventual migration to init.el | |
626 ;; needs to be converted when idiom for constructing "~user" paths is created | |
627 ; (setq user-init-file | |
628 ; (paths-construct-path (list (concat "~" init-file-user) | |
629 ; user-init-directory | |
630 ; "init.el"))) | |
631 ; (unless (file-exists-p (expand-file-name user-init-file)) | |
625 (setq user-init-file | 632 (setq user-init-file |
626 (cond | 633 (paths-construct-path (list (concat "~" init-file-user) |
627 ((eq system-type 'ms-dos) | 634 (cond |
628 (concat "~" init-file-user user-init-directory "init.el")) | 635 ((eq system-type 'ms-dos) "_emacs") |
629 (t | 636 (t ".emacs"))))) |
630 (concat "~" init-file-user user-init-directory "init.el")))) | 637 ; ) |
631 (unless (file-exists-p (expand-file-name user-init-file)) | |
632 (setq user-init-file | |
633 (cond | |
634 ((eq system-type 'ms-dos) | |
635 (concat "~" init-file-user "/_emacs")) | |
636 (t | |
637 (concat "~" init-file-user "/.emacs"))))) | |
638 (load user-init-file t t t) | 638 (load user-init-file t t t) |
639 (let ((default-custom-file (concat "~" | 639 ;; This should not be loaded since custom stuff currently goes into .emacs |
640 init-file-user | 640 ; (let ((default-custom-file |
641 user-init-directory | 641 ; (paths-construct-path (list (concat "~" init-file-user) |
642 "options.el"))) | 642 ; user-init-directory |
643 (when (string= custom-file default-custom-file) | 643 ; "options.el"))) |
644 (load default-custom-file t t))) | 644 ; (when (string= custom-file default-custom-file) |
645 ; (load default-custom-file t t))) | |
645 (unless inhibit-default-init | 646 (unless inhibit-default-init |
646 (let ((inhibit-startup-message nil)) | 647 (let ((inhibit-startup-message nil)) |
647 ;; Users are supposed to be told their rights. | 648 ;; Users are supposed to be told their rights. |
648 ;; (Plus how to get help and how to undo.) | 649 ;; (Plus how to get help and how to undo.) |
649 ;; Don't you dare turn this off for anyone except yourself. | 650 ;; Don't you dare turn this off for anyone except yourself. |
976 "which you can use to read online documentation.\n" | 977 "which you can use to read online documentation.\n" |
977 (face (bold red) ( "\ | 978 (face (bold red) ( "\ |
978 For tips and answers to frequently asked questions, see the XEmacs FAQ. | 979 For tips and answers to frequently asked questions, see the XEmacs FAQ. |
979 \(It's on the Help menu, or type " (key xemacs-local-faq) " [a capital F!].\)")))) | 980 \(It's on the Help menu, or type " (key xemacs-local-faq) " [a capital F!].\)")))) |
980 | 981 |
982 (defvar xemacs-startup-logo-function nil | |
983 "If non-nil, function called to provide the startup logo. | |
984 This function should return an initialized glyph if it is used.") | |
985 | |
981 (defun startup-splash-frame () | 986 (defun startup-splash-frame () |
982 (let ((p (point)) | 987 (let ((p (point)) |
983 (logo (cond ((featurep 'infodock) | 988 (logo (cond (xemacs-startup-logo-function |
984 (make-glyph (locate-data-file "altrasoft-slogo.xpm"))) | 989 (funcall xemacs-startup-logo-function)) |
985 (t xemacs-logo))) | 990 (t xemacs-logo))) |
986 (cramped-p (eq 'tty (console-type)))) | 991 (cramped-p (eq 'tty (console-type)))) |
987 (unless cramped-p (insert "\n")) | 992 (unless cramped-p (insert "\n")) |
988 (indent-to (startup-center-spaces logo)) | 993 (indent-to (startup-center-spaces logo)) |
989 (set-extent-begin-glyph (make-extent (point) (point)) logo) | 994 (set-extent-begin-glyph (make-extent (point) (point)) logo) |