comparison lisp/startup.el @ 438:84b14dcb0985 r21-2-27

Import from CVS: tag r21-2-27
author cvs
date Mon, 13 Aug 2007 11:32:25 +0200
parents 3ecd8885ac67
children 8de8e3f6228a
comparison
equal deleted inserted replaced
437:e2a4e8b94b82 438:84b14dcb0985
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
393 (and (getenv "EMACSDEBUGPATHS") 393 (and (getenv "EMACSDEBUGPATHS")
394 t)))) 394 t))))
395 395
396 (setq emacs-roots (paths-find-emacs-roots invocation-directory 396 (setq emacs-roots (paths-find-emacs-roots invocation-directory
397 invocation-name)) 397 invocation-name))
398 398
399 (if debug-paths 399 (if debug-paths
400 (princ (format "emacs-roots:\n%S\n" emacs-roots) 400 (princ (format "emacs-roots:\n%S\n" emacs-roots)
401 'external-debugging-output)) 401 'external-debugging-output))
402 402
403 (if (null emacs-roots) 403 (if (null emacs-roots)
404 (startup-find-roots-warning) 404 (startup-find-roots-warning)
405 (startup-setup-paths emacs-roots 405 (startup-setup-paths emacs-roots
406 user-init-directory 406 user-init-directory
407 inhibit-early-packages 407 inhibit-early-packages
411 411
412 (if (and (not inhibit-autoloads) 412 (if (and (not inhibit-autoloads)
413 lisp-directory) 413 lisp-directory)
414 (load (expand-file-name (file-name-sans-extension autoload-file-name) 414 (load (expand-file-name (file-name-sans-extension autoload-file-name)
415 lisp-directory) nil t)) 415 lisp-directory) nil t))
416 416
417 (if (not inhibit-autoloads) 417 (if (not inhibit-autoloads)
418 (progn 418 (progn
419 (if (not inhibit-early-packages) 419 (if (not inhibit-early-packages)
420 (packages-load-package-auto-autoloads early-package-load-path)) 420 (packages-load-package-auto-autoloads early-package-load-path))
421 (packages-load-package-auto-autoloads late-package-load-path) 421 (packages-load-package-auto-autoloads late-package-load-path)
493 ;; (and (not (equal string "")) string)) 493 ;; (and (not (equal string "")) string))
494 ;; (let ((string (getenv "LANG"))) 494 ;; (let ((string (getenv "LANG")))
495 ;; (and (not (equal string "")) string))))) 495 ;; (and (not (equal string "")) string)))))
496 ;; (and ctype 496 ;; (and ctype
497 ;; (string-match iso-8859-1-locale-regexp ctype))) 497 ;; (string-match iso-8859-1-locale-regexp ctype)))
498 ;; (progn 498 ;; (progn
499 ;; (standard-display-european t) 499 ;; (standard-display-european t)
500 ;; (require 'iso-syntax))) 500 ;; (require 'iso-syntax)))
501 501
502 (setq load-user-init-file-p (not (noninteractive))) 502 (setq load-user-init-file-p (not (noninteractive)))
503 503
595 ;; to kill XEmacs for it.) 595 ;; to kill XEmacs for it.)
596 ;; 596 ;;
597 597
598 ;;; Load init files. 598 ;;; Load init files.
599 (load-init-file) 599 (load-init-file)
600 600
601 (with-current-buffer (get-buffer "*scratch*") 601 (with-current-buffer (get-buffer "*scratch*")
602 (erase-buffer) 602 (erase-buffer)
603 ;; (insert initial-scratch-message) 603 ;; (insert initial-scratch-message)
604 (set-buffer-modified-p nil) 604 (set-buffer-modified-p nil)
605 (when (eq major-mode 'fundamental-mode) 605 (when (eq major-mode 'fundamental-mode)
620 ;; until after the splash screen. 620 ;; until after the splash screen.
621 (setq inhibit-warning-display nil) 621 (setq inhibit-warning-display nil)
622 ;; If -batch, terminate after processing the command options. 622 ;; If -batch, terminate after processing the command options.
623 (when (noninteractive) (kill-emacs t)))) 623 (when (noninteractive) (kill-emacs t))))
624 624
625 (defun load-terminal-library () 625 (defun load-terminal-library ()
626 (when term-file-prefix 626 (when term-file-prefix
627 (let ((term (getenv "TERM")) 627 (let ((term (getenv "TERM"))
628 hyphend) 628 hyphend)
629 (while (and term 629 (while (and term
630 (not (load (concat term-file-prefix term) t t))) 630 (not (load (concat term-file-prefix term) t t)))
783 ;; This is worthless; the `unixoid' way is "./file". -jwz 783 ;; This is worthless; the `unixoid' way is "./file". -jwz
784 ((or (string= arg "-") (string= arg "--")) 784 ((or (string= arg "-") (string= arg "--"))
785 (setq end-of-options t)) 785 (setq end-of-options t))
786 (t 786 (t
787 (setq file-p t))) 787 (setq file-p t)))
788 788
789 (when file-p 789 (when file-p
790 (setq file-p nil) 790 (setq file-p nil)
791 (incf file-count) 791 (incf file-count)
792 (setq arg (expand-file-name arg dir)) 792 (setq arg (expand-file-name arg dir))
793 (cond 793 (cond
821 (let ((map e) 821 (let ((map e)
822 (overriding-local-map (indirect-function e))) 822 (overriding-local-map (indirect-function e)))
823 (setq e (read-key-sequence 823 (setq e (read-key-sequence
824 (let ((p (keymap-prompt map t))) 824 (let ((p (keymap-prompt map t)))
825 (cond ((symbolp map) 825 (cond ((symbolp map)
826 (if p 826 (if p
827 (format "%s %s " map p) 827 (format "%s %s " map p)
828 (format "%s " map))) 828 (format "%s " map)))
829 (p) 829 (p)
830 (t 830 (t
831 (prin1-to-string map)))))) 831 (prin1-to-string map))))))
900 (error "WTF!?")))) 900 (error "WTF!?"))))
901 901
902 (defun startup-center-spaces (glyph) 902 (defun startup-center-spaces (glyph)
903 ;; Return the number of spaces to insert in order to center 903 ;; Return the number of spaces to insert in order to center
904 ;; the given glyph (may be a string or a pixmap). 904 ;; the given glyph (may be a string or a pixmap).
905 ;; Assume spaces are as wide as avg-pixwidth. 905 ;; Assume spaces are as wide as avg-pixwidth.
906 ;; Won't be quite right for proportional fonts, but it's the best we can do. 906 ;; Won't be quite right for proportional fonts, but it's the best we can do.
907 ;; Maybe the new redisplay will export something a glyph-width function. 907 ;; Maybe the new redisplay will export something a glyph-width function.
908 ;;; #### Yes, there is a glyph-width function but it isn't quite what 908 ;;; #### Yes, there is a glyph-width function but it isn't quite what
909 ;;; #### this was expecting. Or is it? 909 ;;; #### this was expecting. Or is it?
910 ;; (An alternate way to get avg-pixwidth would be to use x-font-properties 910 ;; (An alternate way to get avg-pixwidth would be to use x-font-properties
911 ;; and calculate RESOLUTION_X * AVERAGE_WIDTH / 722.7, but it's no better.) 911 ;; and calculate RESOLUTION_X * AVERAGE_WIDTH / 722.7, but it's no better.)
912 912
913 ;; This function is used in about.el too. 913 ;; This function is used in about.el too.
914 (let* ((avg-pixwidth (round (/ (frame-pixel-width) (frame-width)))) 914 (let* ((avg-pixwidth (round (/ (frame-pixel-width) (frame-width))))
915 (fill-area-width (* avg-pixwidth (- fill-column left-margin))) 915 (fill-area-width (* avg-pixwidth (- fill-column left-margin)))
916 (glyph-pixwidth (cond ((stringp glyph) 916 (glyph-pixwidth (cond ((stringp glyph)
917 (* avg-pixwidth (length glyph))) 917 (* avg-pixwidth (length glyph)))
918 ;; #### the pixmap option should be removed 918 ;; #### the pixmap option should be removed
919 ;;((pixmapp glyph) 919 ;;((pixmapp glyph)
920 ;; (pixmap-width glyph)) 920 ;; (pixmap-width glyph))
921 ((glyphp glyph) 921 ((glyphp glyph)
931 "Please visit the XEmacs website at http://www.xemacs.org !\n\n" 931 "Please visit the XEmacs website at http://www.xemacs.org !\n\n"
932 ,@(if (featurep 'sparcworks) 932 ,@(if (featurep 'sparcworks)
933 `( "\ 933 `( "\
934 Sun provides support for the WorkShop/XEmacs integration package only. 934 Sun provides support for the WorkShop/XEmacs integration package only.
935 All other XEmacs packages are provided to you \"AS IS\".\n" 935 All other XEmacs packages are provided to you \"AS IS\".\n"
936 ,@(let ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES") 936 ,@(let ((lang (or (getenv "LC_ALL") (getenv "LC_MESSAGES")
937 (getenv "LANG")))) 937 (getenv "LANG"))))
938 (if (and 938 (if (and
939 (not (featurep 'mule)) ;; Already got mule? 939 (not (featurep 'mule)) ;; Already got mule?
940 ;; No Mule support on tty's yet 940 ;; No Mule support on tty's yet
941 (not (eq 'tty (console-type))) 941 (not (eq 'tty (console-type)))
942 lang ;; Non-English locale? 942 lang ;; Non-English locale?
943 (not (string= lang "C")) 943 (not (string= lang "C"))
944 (not (string-match "^en" lang)) 944 (not (string-match "^en" lang))
945 ;; Comes with Sun WorkShop 945 ;; Comes with Sun WorkShop
946 (locate-file "xemacs-mule" exec-path)) 946 (locate-file "xemacs-mule" exec-path))
948 This version of XEmacs has been built with support for Latin-1 languages only. 948 This version of XEmacs has been built with support for Latin-1 languages only.
949 To handle other languages you need to run a Multi-lingual (`Mule') version of 949 To handle other languages you need to run a Multi-lingual (`Mule') version of
950 XEmacs, by either running the command `xemacs-mule', or by using the X resource 950 XEmacs, by either running the command `xemacs-mule', or by using the X resource
951 `ESERVE*defaultXEmacsPath: xemacs-mule' when starting XEmacs from Sun WorkShop. 951 `ESERVE*defaultXEmacsPath: xemacs-mule' when starting XEmacs from Sun WorkShop.
952 \n"))))) 952 \n")))))
953 ((key describe-no-warranty) 953 ((key describe-no-warranty)
954 ": "(face (red bold) "XEmacs comes with ABSOLUTELY NO WARRANTY\n")) 954 ": "(face (red bold) "XEmacs comes with ABSOLUTELY NO WARRANTY\n"))
955 ((key describe-copying) 955 ((key describe-copying)
956 ": conditions to give out copies of XEmacs\n") 956 ": conditions to give out copies of XEmacs\n")
957 ((key describe-distribution) 957 ((key describe-distribution)
958 ": how to get the latest version\n") 958 ": how to get the latest version\n")
961 Copyright (C) 1985-1999 Free Software Foundation, Inc. 961 Copyright (C) 1985-1999 Free Software Foundation, Inc.
962 Copyright (C) 1990-1994 Lucid, Inc. 962 Copyright (C) 1990-1994 Lucid, Inc.
963 Copyright (C) 1993-1997 Sun Microsystems, Inc. All Rights Reserved. 963 Copyright (C) 1993-1997 Sun Microsystems, Inc. All Rights Reserved.
964 Copyright (C) 1994-1996 Board of Trustees, University of Illinois 964 Copyright (C) 1994-1996 Board of Trustees, University of Illinois
965 Copyright (C) 1995-1996 Ben Wing\n")) 965 Copyright (C) 1995-1996 Ben Wing\n"))
966 966
967 ((face (blue bold underline) "\nInformation, on-line help:\n\n") 967 ((face (blue bold underline) "\nInformation, on-line help:\n\n")
968 "XEmacs comes with plenty of documentation...\n\n" 968 "XEmacs comes with plenty of documentation...\n\n"
969 ,@(if (string-match "beta" emacs-version) 969 ,@(if (string-match "beta" emacs-version)
970 `((key describe-beta) 970 `((key describe-beta)
971 ": " (face (red bold) 971 ": " (face (red bold)
972 "This is an Experimental version of XEmacs.\n")) 972 "This is an Experimental version of XEmacs.\n"))
973 `( "\n")) 973 `( "\n"))
974 ((key xemacs-local-faq) 974 ((key xemacs-local-faq)
975 ": read the XEmacs FAQ (a " (face underline "capital") " F!)\n") 975 ": read the XEmacs FAQ (a " (face underline "capital") " F!)\n")
994 ;; I really hate global variables, oh well. 994 ;; I really hate global variables, oh well.
995 ;(defvar xemacs-startup-logo-function nil 995 ;(defvar xemacs-startup-logo-function nil
996 ; "If non-nil, function called to provide the startup logo. 996 ; "If non-nil, function called to provide the startup logo.
997 ;This function should return an initialized glyph if it is used.") 997 ;This function should return an initialized glyph if it is used.")
998 998
999 ;; This will hopefully go away when gettext is functionnal. 999 ;; This will hopefully go away when gettext is functional.
1000 (defconst splash-frame-static-body 1000 (defconst splash-frame-static-body
1001 `(,(emacs-version) "\n\n" 1001 `(,(emacs-version) "\n\n"
1002 (face italic "`C-' means the control key,`M-' means the meta key\n\n"))) 1002 (face italic "`C-' means the control key,`M-' means the meta key\n\n")))
1003 1003
1004 1004
1126 1126
1127 (setq Info-directory-list 1127 (setq Info-directory-list
1128 (paths-construct-info-path roots 1128 (paths-construct-info-path roots
1129 early-packages late-packages last-packages)) 1129 early-packages late-packages last-packages))
1130 1130
1131 1131
1132 (if debug-paths 1132 (if debug-paths
1133 (princ (format "Info-directory-list:\n%S\n" Info-directory-list) 1133 (princ (format "Info-directory-list:\n%S\n" Info-directory-list)
1134 'external-debugging-output)) 1134 'external-debugging-output))
1135 1135
1136 (if (boundp 'lock-directory) 1136 (if (boundp 'lock-directory)
1137 (progn 1137 (progn
1138 (setq lock-directory (paths-find-lock-directory roots)) 1138 (setq lock-directory (paths-find-lock-directory roots))
1139 (setq superlock-file (paths-find-superlock-file lock-directory)) 1139 (setq superlock-file (paths-find-superlock-file lock-directory))
1140 1140
1141 (if debug-paths 1141 (if debug-paths
1142 (progn 1142 (progn
1143 (princ (format "lock-directory:\n%S\n" lock-directory) 1143 (princ (format "lock-directory:\n%S\n" lock-directory)
1144 'external-debugging-output) 1144 'external-debugging-output)
1145 (princ (format "superlock-file:\n%S\n" superlock-file) 1145 (princ (format "superlock-file:\n%S\n" superlock-file)
1156 early-packages late-packages last-packages)) 1156 early-packages late-packages last-packages))
1157 1157
1158 (if debug-paths 1158 (if debug-paths
1159 (princ (format "exec-path:\n%S\n" exec-path) 1159 (princ (format "exec-path:\n%S\n" exec-path)
1160 'external-debugging-output)) 1160 'external-debugging-output))
1161 1161
1162 (setq doc-directory (paths-find-doc-directory roots)) 1162 (setq doc-directory (paths-find-doc-directory roots))
1163 1163
1164 (if debug-paths 1164 (if debug-paths
1165 (princ (format "doc-directory:\n%S\n" doc-directory) 1165 (princ (format "doc-directory:\n%S\n" doc-directory)
1166 'external-debugging-output)) 1166 'external-debugging-output))