Mercurial > hg > xemacs-beta
comparison lisp/startup.el @ 398:74fd4e045ea6 r21-2-29
Import from CVS: tag r21-2-29
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:13:30 +0200 |
parents | 6719134a07c2 |
children | 2f8bb876ab1d |
comparison
equal
deleted
inserted
replaced
397:f4aeb21a5bad | 398:74fd4e045ea6 |
---|---|
28 | 28 |
29 ;;; Commentary: | 29 ;;; Commentary: |
30 | 30 |
31 ;; This file is dumped with XEmacs. | 31 ;; This file is dumped with XEmacs. |
32 | 32 |
33 ;; -batch, -t, and -nw are processed by main() in emacs.c and are | 33 ;; -batch, -t, and -nw are processed by main() in emacs.c and are |
34 ;; never seen by lisp code. | 34 ;; never seen by lisp code. |
35 | 35 |
36 ;; -version and -help are special-cased as well: they imply -batch, | 36 ;; -version and -help are special-cased as well: they imply -batch, |
37 ;; but are left on the list for lisp code to process. | 37 ;; but are left on the list for lisp code to process. |
38 | 38 |
102 "Major mode command symbol to use for the initial *scratch* buffer.") | 102 "Major mode command symbol to use for the initial *scratch* buffer.") |
103 | 103 |
104 (defvar emacs-roots nil | 104 (defvar emacs-roots nil |
105 "List of plausible roots of the XEmacs hierarchy.") | 105 "List of plausible roots of the XEmacs hierarchy.") |
106 | 106 |
107 (defvar init-file-user nil | 107 (defvar user-init-directory-base ".xemacs" |
108 "Identity of user whose `.emacs' file is or was read. | 108 "Base of directory where user-installed init files may go.") |
109 The value is nil if no init file is being used; otherwise, it may be either | 109 |
110 the null string, meaning that the init file was taken from the user that | 110 (defvar user-init-file-base-list (append |
111 originally logged in, or it may be a string containing a user's name. | 111 '(".emacs.elc" ".emacs.el" ".emacs") |
112 | 112 (and (eq system-type 'windows-nt) |
113 In either of the latter cases, `(concat \"~\" init-file-user \"/\")' | 113 '("_emacs.elc" "_emacs.el" "_emacs"))) |
114 evaluates to the name of the directory in which the `.emacs' file was | 114 "List of allowed init files. The first one found takes precedence.") |
115 searched for. | 115 |
116 | 116 (defvar user-init-directory |
117 Setting `init-file-user' does not prevent Emacs from loading | 117 (file-name-as-directory |
118 `site-start.el'. The only way to do that is to use `--no-site-file'.") | 118 (paths-construct-path (list "~" user-init-directory-base))) |
119 "Directory where user-installed init files may go.") | |
120 | |
121 (defvar load-user-init-file-p t | |
122 "Non-nil if XEmacs should load the user's init file.") | |
119 | 123 |
120 ;; #### called `site-run-file' in FSFmacs | 124 ;; #### called `site-run-file' in FSFmacs |
121 | 125 |
122 (defvar site-start-file (purecopy "site-start") | 126 (defvar site-start-file (purecopy "site-start") |
123 "File containing site-wide run-time initializations. | 127 "File containing site-wide run-time initializations. |
198 "Print the XEmacs usage message and exit." | 202 "Print the XEmacs usage message and exit." |
199 (let ((standard-output 'external-debugging-output)) | 203 (let ((standard-output 'external-debugging-output)) |
200 (princ (concat "\n" (emacs-version) "\n\n")) | 204 (princ (concat "\n" (emacs-version) "\n\n")) |
201 (princ | 205 (princ |
202 (if (featurep 'x) | 206 (if (featurep 'x) |
203 (concat (emacs-name) | 207 (concat "When creating a window on an X display, " |
204 " accepts all standard X Toolkit command line options.\n" | 208 (emacs-name) |
205 "In addition, the") | 209 " accepts all standard X Toolkit |
210 command line options plus the following: | |
211 -iconname <title> Use title as the icon name. | |
212 -mc <color> Use color as the mouse color. | |
213 -cr <color> Use color as the text-cursor foregound color. | |
214 -private Install a private colormap. | |
215 | |
216 In addition, the") | |
206 "The")) | 217 "The")) |
207 (princ " following options are accepted: | 218 (princ " following options are accepted: |
208 | |
209 -t <device> Use TTY <device> instead of the terminal for input | 219 -t <device> Use TTY <device> instead of the terminal for input |
210 and output. This implies the -nw option. | 220 and output. This implies the -nw option. |
211 -nw Inhibit the use of any window-system-specific | 221 -nw Inhibit the use of any window-system-specific |
212 display code: use the current tty. | 222 display code: use the current tty. |
213 -batch Execute noninteractively (messages go to stderr). | 223 -batch Execute noninteractively (messages go to stderr). |
218 -no-early-packages Do not process early packages. | 228 -no-early-packages Do not process early packages. |
219 -no-autoloads Do not load global symbol files (auto-autoloads) at | 229 -no-autoloads Do not load global symbol files (auto-autoloads) at |
220 startup. Also implies `-vanilla'. | 230 startup. Also implies `-vanilla'. |
221 -vanilla Equivalent to -q -no-site-file -no-early-packages. | 231 -vanilla Equivalent to -q -no-site-file -no-early-packages. |
222 -q Same as -no-init-file. | 232 -q Same as -no-init-file. |
233 -user-init-file <file> Use <file> as init file. | |
234 -user-init-directory <directory> use <directory> as init directory. | |
223 -user <user> Load user's init file instead of your own. | 235 -user <user> Load user's init file instead of your own. |
236 Equivalent to -user-init-file ~<user>/.emacs | |
237 -user-init-directory ~<user>/.xemacs/ | |
224 -u <user> Same as -user.\n") | 238 -u <user> Same as -user.\n") |
225 (let ((l command-switch-alist) | 239 (let ((l command-switch-alist) |
226 (insert (lambda (&rest x) | 240 (insert (lambda (&rest x) |
227 (princ " ") | 241 (princ " ") |
228 (let ((len 2)) | 242 (let ((len 2)) |
380 (and (getenv "EMACSDEBUGPATHS") | 394 (and (getenv "EMACSDEBUGPATHS") |
381 t)))) | 395 t)))) |
382 | 396 |
383 (setq emacs-roots (paths-find-emacs-roots invocation-directory | 397 (setq emacs-roots (paths-find-emacs-roots invocation-directory |
384 invocation-name)) | 398 invocation-name)) |
385 | 399 |
386 (if debug-paths | 400 (if debug-paths |
387 (princ (format "emacs-roots:\n%S\n" emacs-roots) | 401 (princ (format "emacs-roots:\n%S\n" emacs-roots) |
388 'external-debugging-output)) | 402 'external-debugging-output)) |
389 | 403 |
390 (if (null emacs-roots) | 404 (if (null emacs-roots) |
391 (startup-find-roots-warning) | 405 (startup-find-roots-warning) |
392 (startup-setup-paths emacs-roots | 406 (startup-setup-paths emacs-roots |
407 user-init-directory | |
393 inhibit-early-packages | 408 inhibit-early-packages |
394 inhibit-site-lisp | 409 inhibit-site-lisp |
395 debug-paths)) | 410 debug-paths)) |
396 (startup-setup-paths-warning)) | 411 (startup-setup-paths-warning)) |
397 | 412 |
398 (if (and (not inhibit-autoloads) | 413 (if (and (not inhibit-autoloads) |
399 lisp-directory) | 414 lisp-directory) |
400 (load (expand-file-name (file-name-sans-extension autoload-file-name) | 415 (load (expand-file-name (file-name-sans-extension autoload-file-name) |
401 lisp-directory) nil t)) | 416 lisp-directory) nil t)) |
402 | 417 |
403 (if (not inhibit-autoloads) | 418 (if (not inhibit-autoloads) |
404 (progn | 419 (progn |
405 (if (not inhibit-early-packages) | 420 (if (not inhibit-early-packages) |
406 (packages-load-package-auto-autoloads early-package-load-path)) | 421 (packages-load-package-auto-autoloads early-package-load-path)) |
407 (packages-load-package-auto-autoloads late-package-load-path) | 422 (packages-load-package-auto-autoloads late-package-load-path) |
479 ;; (and (not (equal string "")) string)) | 494 ;; (and (not (equal string "")) string)) |
480 ;; (let ((string (getenv "LANG"))) | 495 ;; (let ((string (getenv "LANG"))) |
481 ;; (and (not (equal string "")) string))))) | 496 ;; (and (not (equal string "")) string))))) |
482 ;; (and ctype | 497 ;; (and ctype |
483 ;; (string-match iso-8859-1-locale-regexp ctype))) | 498 ;; (string-match iso-8859-1-locale-regexp ctype))) |
484 ;; (progn | 499 ;; (progn |
485 ;; (standard-display-european t) | 500 ;; (standard-display-european t) |
486 ;; (require 'iso-syntax))) | 501 ;; (require 'iso-syntax))) |
487 | 502 |
488 ;; Figure out which user's init file to load, | 503 (setq load-user-init-file-p (not (noninteractive))) |
489 ;; either from the environment or from the options. | |
490 (setq init-file-user (if (noninteractive) nil (user-login-name))) | |
491 ;; If user has not done su, use current $HOME to find .emacs. | |
492 (and init-file-user (string= init-file-user (user-real-login-name)) | |
493 (setq init-file-user "")) | |
494 | 504 |
495 ;; Allow (at least) these arguments anywhere in the command line | 505 ;; Allow (at least) these arguments anywhere in the command line |
496 (let ((new-args nil) | 506 (let ((new-args nil) |
497 (arg nil)) | 507 (arg nil)) |
498 (while args | 508 (while args |
499 (setq arg (pop args)) | 509 (setq arg (pop args)) |
500 (cond | 510 (cond |
501 ((or (string= arg "-q") | 511 ((or (string= arg "-q") |
502 (string= arg "-no-init-file")) | 512 (string= arg "-no-init-file")) |
503 (setq init-file-user nil)) | 513 (setq load-user-init-file-p nil)) |
504 ((string= arg "-no-site-file") | 514 ((string= arg "-no-site-file") |
505 (setq site-start-file nil)) | 515 (setq site-start-file nil)) |
506 ((or (string= arg "-no-early-packages") | 516 ((or (string= arg "-no-early-packages") |
507 (string= arg "--no-early-packages")) | 517 (string= arg "--no-early-packages")) |
508 (setq inhibit-early-packages t)) | 518 (setq inhibit-early-packages t)) |
509 ((or (string= arg "-vanilla") | 519 ((or (string= arg "-vanilla") |
510 (string= arg "--vanilla") | 520 (string= arg "--vanilla") |
511 ;; Some work on this one already done in emacs.c. | 521 ;; Some work on this one already done in emacs.c. |
512 (string= arg "-no-autoloads") | 522 (string= arg "-no-autoloads") |
513 (string= arg "--no-autoloads")) | 523 (string= arg "--no-autoloads")) |
514 (setq init-file-user nil | 524 (setq load-user-init-file-p nil |
515 site-start-file nil)) | 525 site-start-file nil)) |
526 ((string= arg "-user-init-file") | |
527 (setq user-init-file (pop args))) | |
528 ((string= arg "-user-init-directory") | |
529 (setq user-init-directory (file-name-as-directory (pop args)))) | |
516 ((or (string= arg "-u") | 530 ((or (string= arg "-u") |
517 (string= arg "-user")) | 531 (string= arg "-user")) |
518 (setq init-file-user (pop args))) | 532 (let* ((user (pop args)) |
533 (home-user (concat "~" user))) | |
534 (setq user-init-file (find-user-init-file home-user) | |
535 user-init-directory (file-name-as-directory | |
536 (paths-construct-path | |
537 (list home-user user-init-directory-base)))))) | |
519 ((string= arg "-debug-init") | 538 ((string= arg "-debug-init") |
520 (setq init-file-debug t)) | 539 (setq init-file-debug t)) |
521 ((string= arg "-unmapped") | 540 ((string= arg "-unmapped") |
522 (setq initial-frame-unmapped-p t)) | 541 (setq initial-frame-unmapped-p t)) |
523 ((or (string= arg "-debug-paths") | 542 ((or (string= arg "-debug-paths") |
525 t) | 544 t) |
526 ((or (string= arg "--") (string= arg "-")) | 545 ((or (string= arg "--") (string= arg "-")) |
527 (while args | 546 (while args |
528 (push (pop args) new-args))) | 547 (push (pop args) new-args))) |
529 (t (push arg new-args)))) | 548 (t (push arg new-args)))) |
530 | 549 |
550 (setq init-file-user (and load-user-init-file-p "")) | |
551 | |
531 (nreverse new-args))) | 552 (nreverse new-args))) |
532 | 553 |
533 (defconst initial-scratch-message "\ | 554 (defconst initial-scratch-message "\ |
534 ;; This buffer is for notes you don't want to save, and for Lisp evaluation. | 555 ;; This buffer is for notes you don't want to save, and for Lisp evaluation. |
535 ;; If you want to create a file, first visit that file with C-x C-f, | 556 ;; If you want to create a file, first visit that file with C-x C-f, |
566 | 587 |
567 ;; When not in batch mode, this creates the first visible frame, | 588 ;; When not in batch mode, this creates the first visible frame, |
568 ;; and deletes the stdio device. | 589 ;; and deletes the stdio device. |
569 (frame-initialize)) | 590 (frame-initialize)) |
570 | 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 | |
571 ;; | 597 ;; |
572 ;; We have normality, I repeat, we have normality. Anything you still | 598 ;; We have normality, I repeat, we have normality. Anything you still |
573 ;; 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 |
574 ;; to kill XEmacs for it.) | 600 ;; to kill XEmacs for it.) |
575 ;; | 601 ;; |
576 | 602 |
577 ;;; Load init files. | 603 ;;; Load init files. |
578 (load-init-file) | 604 (load-init-file) |
579 | 605 |
580 (with-current-buffer (get-buffer "*scratch*") | 606 (with-current-buffer (get-buffer "*scratch*") |
581 (erase-buffer) | 607 (erase-buffer) |
582 ;; (insert initial-scratch-message) | 608 ;; (insert initial-scratch-message) |
583 (set-buffer-modified-p nil) | 609 (set-buffer-modified-p nil) |
584 (when (eq major-mode 'fundamental-mode) | 610 (when (eq major-mode 'fundamental-mode) |
599 ;; until after the splash screen. | 625 ;; until after the splash screen. |
600 (setq inhibit-warning-display nil) | 626 (setq inhibit-warning-display nil) |
601 ;; If -batch, terminate after processing the command options. | 627 ;; If -batch, terminate after processing the command options. |
602 (when (noninteractive) (kill-emacs t)))) | 628 (when (noninteractive) (kill-emacs t)))) |
603 | 629 |
604 (defun load-terminal-library () | 630 (defun load-terminal-library () |
605 (when term-file-prefix | 631 (when term-file-prefix |
606 (let ((term (getenv "TERM")) | 632 (let ((term (getenv "TERM")) |
607 hyphend) | 633 hyphend) |
608 (while (and term | 634 (while (and term |
609 (not (load (concat term-file-prefix term) t t))) | 635 (not (load (concat term-file-prefix term) t t))) |
610 ;; Strip off last hyphen and what follows, then try again | 636 ;; Strip off last hyphen and what follows, then try again |
611 (if (setq hyphend (string-match "[-_][^-_]+\\'" term)) | 637 (if (setq hyphend (string-match "[-_][^-_]+\\'" term)) |
612 (setq term (substring term 0 hyphend)) | 638 (setq term (substring term 0 hyphend)) |
613 (setq term nil)))))) | 639 (setq term nil)))))) |
614 | 640 |
615 (defconst user-init-directory "/.xemacs/" | 641 (defun find-user-init-file (&optional directory) |
616 "Directory where user-installed packages may go.") | 642 "Determine the user's init file." |
617 (define-obsolete-variable-alias | 643 (unless directory |
618 'emacs-user-extension-dir | 644 (setq directory "~")) |
619 'user-init-directory) | 645 (dolist (file user-init-file-base-list) |
620 | 646 (let ((expanded (paths-construct-path (list directory file)))) |
621 (defun load-user-init-file (init-file-user) | 647 (when (file-exists-p expanded) |
648 (return expanded))))) | |
649 | |
650 (defun load-user-init-file () | |
622 "This function actually reads the init file, .emacs." | 651 "This function actually reads the init file, .emacs." |
623 (when init-file-user | 652 (if (not user-init-file) |
624 ;; purge references to init.el and options.el | 653 (setq user-init-file (find-user-init-file))) |
625 ;; convert these to use paths-construct-path for eventual migration to init.el | 654 (load user-init-file t t t) |
626 ;; needs to be converted when idiom for constructing "~user" paths is created | 655 (unless inhibit-default-init |
627 ; (setq user-init-file | 656 (let ((inhibit-startup-message nil)) |
628 ; (paths-construct-path (list (concat "~" init-file-user) | 657 ;; Users are supposed to be told their rights. |
629 ; user-init-directory | 658 ;; (Plus how to get help and how to undo.) |
630 ; "init.el"))) | 659 ;; Don't you dare turn this off for anyone except yourself. |
631 ; (unless (file-exists-p (expand-file-name user-init-file)) | 660 (load "default" t t)))) |
632 (setq user-init-file | |
633 (paths-construct-path (list (concat "~" init-file-user) | |
634 (cond | |
635 ((eq system-type 'ms-dos) "_emacs") | |
636 (t ".emacs"))))) | |
637 ; ) | |
638 (load user-init-file t t t) | |
639 ;; This should not be loaded since custom stuff currently goes into .emacs | |
640 ; (let ((default-custom-file | |
641 ; (paths-construct-path (list (concat "~" init-file-user) | |
642 ; user-init-directory | |
643 ; "options.el"))) | |
644 ; (when (string= custom-file default-custom-file) | |
645 ; (load default-custom-file t t))) | |
646 (unless inhibit-default-init | |
647 (let ((inhibit-startup-message nil)) | |
648 ;; Users are supposed to be told their rights. | |
649 ;; (Plus how to get help and how to undo.) | |
650 ;; Don't you dare turn this off for anyone except yourself. | |
651 (load "default" t t))))) | |
652 | 661 |
653 ;;; Load user's init file and default ones. | 662 ;;; Load user's init file and default ones. |
654 (defun load-init-file () | 663 (defun load-init-file () |
655 (run-hooks 'before-init-hook) | 664 (run-hooks 'before-init-hook) |
656 | 665 |
667 (let (debug-on-error-from-init-file | 676 (let (debug-on-error-from-init-file |
668 debug-on-error-should-be-set | 677 debug-on-error-should-be-set |
669 (debug-on-error-initial | 678 (debug-on-error-initial |
670 (if (eq init-file-debug t) 'startup init-file-debug))) | 679 (if (eq init-file-debug t) 'startup init-file-debug))) |
671 (let ((debug-on-error debug-on-error-initial)) | 680 (let ((debug-on-error debug-on-error-initial)) |
672 (if init-file-debug | 681 (if (and load-user-init-file-p init-file-debug) |
673 ;; Do this without a condition-case if the user wants to debug. | 682 ;; Do this without a condition-case if the user wants to debug. |
674 (load-user-init-file init-file-user) | 683 (load-user-init-file) |
675 (condition-case error | 684 (condition-case error |
676 (progn | 685 (progn |
677 (load-user-init-file init-file-user) | 686 (if load-user-init-file-p |
687 (load-user-init-file)) | |
678 (setq init-file-had-error nil)) | 688 (setq init-file-had-error nil)) |
679 (error | 689 (error |
680 (message "Error in init file: %s" (error-message-string error)) | 690 (message "Error in init file: %s" (error-message-string error)) |
681 (display-warning 'initialization | 691 (display-warning 'initialization |
682 (format "\ | 692 (format "\ |
786 ;; This is worthless; the `unixoid' way is "./file". -jwz | 796 ;; This is worthless; the `unixoid' way is "./file". -jwz |
787 ((or (string= arg "-") (string= arg "--")) | 797 ((or (string= arg "-") (string= arg "--")) |
788 (setq end-of-options t)) | 798 (setq end-of-options t)) |
789 (t | 799 (t |
790 (setq file-p t))) | 800 (setq file-p t))) |
791 | 801 |
792 (when file-p | 802 (when file-p |
793 (setq file-p nil) | 803 (setq file-p nil) |
794 (incf file-count) | 804 (incf file-count) |
795 (setq arg (expand-file-name arg dir)) | 805 (setq arg (expand-file-name arg dir)) |
796 (cond | 806 (cond |
824 (let ((map e) | 834 (let ((map e) |
825 (overriding-local-map (indirect-function e))) | 835 (overriding-local-map (indirect-function e))) |
826 (setq e (read-key-sequence | 836 (setq e (read-key-sequence |
827 (let ((p (keymap-prompt map t))) | 837 (let ((p (keymap-prompt map t))) |
828 (cond ((symbolp map) | 838 (cond ((symbolp map) |
829 (if p | 839 (if p |
830 (format "%s %s " map p) | 840 (format "%s %s " map p) |
831 (format "%s " map))) | 841 (format "%s " map))) |
832 (p) | 842 (p) |
833 (t | 843 (t |
834 (prin1-to-string map)))))) | 844 (prin1-to-string map)))))) |
903 (error "WTF!?")))) | 913 (error "WTF!?")))) |
904 | 914 |
905 (defun startup-center-spaces (glyph) | 915 (defun startup-center-spaces (glyph) |
906 ;; Return the number of spaces to insert in order to center | 916 ;; Return the number of spaces to insert in order to center |
907 ;; the given glyph (may be a string or a pixmap). | 917 ;; the given glyph (may be a string or a pixmap). |
908 ;; Assume spaces are as wide as avg-pixwidth. | 918 ;; Assume spaces are as wide as avg-pixwidth. |
909 ;; Won't be quite right for proportional fonts, but it's the best we can do. | 919 ;; Won't be quite right for proportional fonts, but it's the best we can do. |
910 ;; Maybe the new redisplay will export something a glyph-width function. | 920 ;; Maybe the new redisplay will export something a glyph-width function. |
911 ;;; #### Yes, there is a glyph-width function but it isn't quite what | 921 ;;; #### Yes, there is a glyph-width function but it isn't quite what |
912 ;;; #### this was expecting. Or is it? | 922 ;;; #### this was expecting. Or is it? |
913 ;; (An alternate way to get avg-pixwidth would be to use x-font-properties | 923 ;; (An alternate way to get avg-pixwidth would be to use x-font-properties |
914 ;; and calculate RESOLUTION_X * AVERAGE_WIDTH / 722.7, but it's no better.) | 924 ;; and calculate RESOLUTION_X * AVERAGE_WIDTH / 722.7, but it's no better.) |
915 | 925 |
916 ;; This function is used in about.el too. | 926 ;; This function is used in about.el too. |
917 (let* ((avg-pixwidth (round (/ (frame-pixel-width) (frame-width)))) | 927 (let* ((avg-pixwidth (round (/ (frame-pixel-width) (frame-width)))) |
918 (fill-area-width (* avg-pixwidth (- fill-column left-margin))) | 928 (fill-area-width (* avg-pixwidth (- fill-column left-margin))) |
919 (glyph-pixwidth (cond ((stringp glyph) | 929 (glyph-pixwidth (cond ((stringp glyph) |
920 (* avg-pixwidth (length glyph))) | 930 (* avg-pixwidth (length glyph))) |
921 ;; #### the pixmap option should be removed | 931 ;; #### the pixmap option should be removed |
922 ;;((pixmapp glyph) | 932 ;;((pixmapp glyph) |
923 ;; (pixmap-width glyph)) | 933 ;; (pixmap-width glyph)) |
924 ((glyphp glyph) | 934 ((glyphp glyph) |
934 "Please visit the XEmacs website at http://www.xemacs.org !\n\n" | 944 "Please visit the XEmacs website at http://www.xemacs.org !\n\n" |
935 ,@(if (featurep 'sparcworks) | 945 ,@(if (featurep 'sparcworks) |
936 `( "\ | 946 `( "\ |
937 Sun provides support for the WorkShop/XEmacs integration package only. | 947 Sun provides support for the WorkShop/XEmacs integration package only. |
938 All other XEmacs packages are provided to you \"AS IS\".\n" | 948 All other XEmacs packages are provided to you \"AS IS\".\n" |
939 ,@(let ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES") | 949 ,@(let ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES") |
940 (getenv "LANG")))) | 950 (getenv "LANG")))) |
941 (if (and | 951 (if (and |
942 (not (featurep 'mule)) ;; Already got mule? | 952 (not (featurep 'mule)) ;; Already got mule? |
943 ;; No Mule support on tty's yet | 953 ;; No Mule support on tty's yet |
944 (not (eq 'tty (console-type))) | 954 (not (eq 'tty (console-type))) |
945 lang ;; Non-English locale? | 955 lang ;; Non-English locale? |
946 (not (string= lang "C")) | 956 (not (string= lang "C")) |
947 (not (string-match "^en" lang)) | 957 (not (string-match "^en" lang)) |
948 ;; Comes with Sun WorkShop | 958 ;; Comes with Sun WorkShop |
949 (locate-file "xemacs-mule" exec-path)) | 959 (locate-file "xemacs-mule" exec-path)) |
951 This version of XEmacs has been built with support for Latin-1 languages only. | 961 This version of XEmacs has been built with support for Latin-1 languages only. |
952 To handle other languages you need to run a Multi-lingual (`Mule') version of | 962 To handle other languages you need to run a Multi-lingual (`Mule') version of |
953 XEmacs, by either running the command `xemacs-mule', or by using the X resource | 963 XEmacs, by either running the command `xemacs-mule', or by using the X resource |
954 `ESERVE*defaultXEmacsPath: xemacs-mule' when starting XEmacs from Sun WorkShop. | 964 `ESERVE*defaultXEmacsPath: xemacs-mule' when starting XEmacs from Sun WorkShop. |
955 \n"))))) | 965 \n"))))) |
956 ((key describe-no-warranty) | 966 ((key describe-no-warranty) |
957 ": "(face (red bold) "XEmacs comes with ABSOLUTELY NO WARRANTY\n")) | 967 ": "(face (red bold) "XEmacs comes with ABSOLUTELY NO WARRANTY\n")) |
958 ((key describe-copying) | 968 ((key describe-copying) |
959 ": conditions to give out copies of XEmacs\n") | 969 ": conditions to give out copies of XEmacs\n") |
960 ((key describe-distribution) | 970 ((key describe-distribution) |
961 ": how to get the latest version\n") | 971 ": how to get the latest version\n") |
962 "\n--\n" | 972 "\n--\n" |
963 (face italic "\ | 973 (face italic "\ |
964 Copyright (C) 1985-1998 Free Software Foundation, Inc. | 974 Copyright (C) 1985-1999 Free Software Foundation, Inc. |
965 Copyright (C) 1990-1994 Lucid, Inc. | 975 Copyright (C) 1990-1994 Lucid, Inc. |
966 Copyright (C) 1993-1997 Sun Microsystems, Inc. All Rights Reserved. | 976 Copyright (C) 1993-1997 Sun Microsystems, Inc. All Rights Reserved. |
967 Copyright (C) 1994-1996 Board of Trustees, University of Illinois | 977 Copyright (C) 1994-1996 Board of Trustees, University of Illinois |
968 Copyright (C) 1995-1996 Ben Wing\n")) | 978 Copyright (C) 1995-1996 Ben Wing\n")) |
969 | 979 |
970 ((face (blue bold underline) "\nInformation, on-line help:\n\n") | 980 ((face (blue bold underline) "\nInformation, on-line help:\n\n") |
971 "XEmacs comes with plenty of documentation...\n\n" | 981 "XEmacs comes with plenty of documentation...\n\n" |
972 ,@(if (string-match "beta" emacs-version) | 982 ,@(if (string-match "beta" emacs-version) |
973 `((key describe-beta) | 983 `((key describe-beta) |
974 ": " (face (red bold) | 984 ": " (face (red bold) |
975 "This is an Experimental version of XEmacs.\n")) | 985 "This is an Experimental version of XEmacs.\n")) |
976 `( "\n")) | 986 `( "\n")) |
977 ((key xemacs-local-faq) | 987 ((key xemacs-local-faq) |
978 ": read the XEmacs FAQ (a " (face underline "capital") " F!)\n") | 988 ": read the XEmacs FAQ (a " (face underline "capital") " F!)\n") |
982 ((key help-command) | 992 ((key help-command) |
983 ": get help on using XEmacs (also available through the " | 993 ": get help on using XEmacs (also available through the " |
984 (face bold "Help") " menu)\n") | 994 (face bold "Help") " menu)\n") |
985 ((key info) ": read the on-line documentation\n\n") | 995 ((key info) ": read the on-line documentation\n\n") |
986 ((key describe-project) ": read about the GNU project\n") | 996 ((key describe-project) ": read about the GNU project\n") |
987 ((key about-xemacs) ": see who's developping XEmacs\n")) | 997 ((key about-xemacs) ": see who's developing XEmacs\n")) |
988 | 998 |
989 ((face (blue bold underline) "\nUseful stuff:\n\n") | 999 ((face (blue bold underline) "\nUseful stuff:\n\n") |
990 "Things that you should know rather quickly...\n\n" | 1000 "Things that you should know rather quickly...\n\n" |
991 ((key find-file) ": visit a file\n") | 1001 ((key find-file) ": visit a file\n") |
992 ((key save-buffer) ": save changes\n") | 1002 ((key save-buffer) ": save changes\n") |
997 ;; I really hate global variables, oh well. | 1007 ;; I really hate global variables, oh well. |
998 ;(defvar xemacs-startup-logo-function nil | 1008 ;(defvar xemacs-startup-logo-function nil |
999 ; "If non-nil, function called to provide the startup logo. | 1009 ; "If non-nil, function called to provide the startup logo. |
1000 ;This function should return an initialized glyph if it is used.") | 1010 ;This function should return an initialized glyph if it is used.") |
1001 | 1011 |
1002 ;; This will hopefully go away when gettext is functionnal. | 1012 ;; This will hopefully go away when gettext is functional. |
1003 (defconst splash-frame-static-body | 1013 (defconst splash-frame-static-body |
1004 `(,(emacs-version) "\n\n" | 1014 `(,(emacs-version) "\n\n" |
1005 (face italic "`C-' means the control key,`M-' means the meta key\n\n"))) | 1015 (face italic "`C-' means the control key,`M-' means the meta key\n\n"))) |
1006 | 1016 |
1007 | 1017 |
1018 (if (= indice (- (length elements) 1)) | 1028 (if (= indice (- (length elements) 1)) |
1019 0 | 1029 0 |
1020 (1+ indice ))) | 1030 (1+ indice ))) |
1021 ))) | 1031 ))) |
1022 | 1032 |
1023 ;; ### This function now returns the (possibly nil) timeout circulating the | 1033 ;; #### This function now returns the (possibly nil) timeout circulating the |
1024 ;; splash-frame elements | 1034 ;; splash-frame elements |
1025 (defun display-splash-frame () | 1035 (defun display-splash-frame () |
1026 (let ((logo xemacs-logo) | 1036 (let ((logo xemacs-logo) |
1027 (buffer-read-only nil) | 1037 (buffer-read-only nil) |
1028 (cramped-p (eq 'tty (console-type)))) | 1038 (cramped-p (eq 'tty (console-type)))) |
1067 (or invocation-directory (setq invocation-directory default-directory)) | 1077 (or invocation-directory (setq invocation-directory default-directory)) |
1068 (setq invocation-directory | 1078 (setq invocation-directory |
1069 ;; don't let /tmp_mnt/... get into the load-path or exec-path. | 1079 ;; don't let /tmp_mnt/... get into the load-path or exec-path. |
1070 (abbreviate-file-name invocation-directory))) | 1080 (abbreviate-file-name invocation-directory))) |
1071 | 1081 |
1072 (defun startup-setup-paths (roots &optional | 1082 (defun startup-setup-paths (roots user-init-directory |
1083 &optional | |
1073 inhibit-early-packages inhibit-site-lisp | 1084 inhibit-early-packages inhibit-site-lisp |
1074 debug-paths) | 1085 debug-paths) |
1075 "Setup all the various paths. | 1086 "Setup all the various paths. |
1076 ROOTS is a list of plausible roots of the XEmacs directory hierarchy. | 1087 ROOTS is a list of plausible roots of the XEmacs directory hierarchy. |
1077 If INHIBIT-PACKAGES is non-NIL, don't do packages. | 1088 If INHIBIT-PACKAGES is non-NIL, don't do packages. |
1082 (apply #'(lambda (early late last) | 1093 (apply #'(lambda (early late last) |
1083 (setq early-packages (and (not inhibit-early-packages) | 1094 (setq early-packages (and (not inhibit-early-packages) |
1084 early)) | 1095 early)) |
1085 (setq late-packages late) | 1096 (setq late-packages late) |
1086 (setq last-packages last)) | 1097 (setq last-packages last)) |
1087 (packages-find-packages roots)) | 1098 (packages-find-packages |
1099 roots | |
1100 (packages-compute-package-locations user-init-directory))) | |
1088 | 1101 |
1089 (setq early-package-load-path (packages-find-package-load-path early-packages)) | 1102 (setq early-package-load-path (packages-find-package-load-path early-packages)) |
1090 (setq late-package-load-path (packages-find-package-load-path late-packages)) | 1103 (setq late-package-load-path (packages-find-package-load-path late-packages)) |
1091 (setq last-package-load-path (packages-find-package-load-path last-packages)) | 1104 (setq last-package-load-path (packages-find-package-load-path last-packages)) |
1092 | 1105 |
1126 | 1139 |
1127 (setq Info-directory-list | 1140 (setq Info-directory-list |
1128 (paths-construct-info-path roots | 1141 (paths-construct-info-path roots |
1129 early-packages late-packages last-packages)) | 1142 early-packages late-packages last-packages)) |
1130 | 1143 |
1131 | 1144 |
1132 (if debug-paths | 1145 (if debug-paths |
1133 (princ (format "Info-directory-list:\n%S\n" Info-directory-list) | 1146 (princ (format "Info-directory-list:\n%S\n" Info-directory-list) |
1134 'external-debugging-output)) | 1147 'external-debugging-output)) |
1135 | 1148 |
1136 (if (boundp 'lock-directory) | 1149 (if (boundp 'lock-directory) |
1137 (progn | 1150 (progn |
1138 (setq lock-directory (paths-find-lock-directory roots)) | 1151 (setq lock-directory (paths-find-lock-directory roots)) |
1139 (setq superlock-file (paths-find-superlock-file lock-directory)) | 1152 (setq superlock-file (paths-find-superlock-file lock-directory)) |
1140 | 1153 |
1141 (if debug-paths | 1154 (if debug-paths |
1142 (progn | 1155 (progn |
1143 (princ (format "lock-directory:\n%S\n" lock-directory) | 1156 (princ (format "lock-directory:\n%S\n" lock-directory) |
1144 'external-debugging-output) | 1157 'external-debugging-output) |
1145 (princ (format "superlock-file:\n%S\n" superlock-file) | 1158 (princ (format "superlock-file:\n%S\n" superlock-file) |
1156 early-packages late-packages last-packages)) | 1169 early-packages late-packages last-packages)) |
1157 | 1170 |
1158 (if debug-paths | 1171 (if debug-paths |
1159 (princ (format "exec-path:\n%S\n" exec-path) | 1172 (princ (format "exec-path:\n%S\n" exec-path) |
1160 'external-debugging-output)) | 1173 'external-debugging-output)) |
1161 | 1174 |
1162 (setq doc-directory (paths-find-doc-directory roots)) | 1175 (setq doc-directory (paths-find-doc-directory roots)) |
1163 | 1176 |
1164 (if debug-paths | 1177 (if debug-paths |
1165 (princ (format "doc-directory:\n%S\n" doc-directory) | 1178 (princ (format "doc-directory:\n%S\n" doc-directory) |
1166 'external-debugging-output)) | 1179 'external-debugging-output)) |