Mercurial > emacs
comparison lisp/startup.el @ 49597:e88404e8f2cf
Trailing whitespace deleted.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 04 Feb 2003 12:29:42 +0000 |
parents | 68b29ca63a54 |
children | 99cc7aecbbec d7ddb3e565de |
comparison
equal
deleted
inserted
replaced
49596:b06535145619 | 49597:e88404e8f2cf |
---|---|
364 (defun normal-top-level-add-subdirs-to-load-path () | 364 (defun normal-top-level-add-subdirs-to-load-path () |
365 "Add all subdirectories of current directory to `load-path'. | 365 "Add all subdirectories of current directory to `load-path'. |
366 More precisely, this uses only the subdirectories whose names | 366 More precisely, this uses only the subdirectories whose names |
367 start with letters or digits; it excludes any subdirectory named `RCS' | 367 start with letters or digits; it excludes any subdirectory named `RCS' |
368 or `CVS', and any subdirectory that contains a file named `.nosearch'." | 368 or `CVS', and any subdirectory that contains a file named `.nosearch'." |
369 (let (dirs | 369 (let (dirs |
370 attrs | 370 attrs |
371 (pending (list default-directory))) | 371 (pending (list default-directory))) |
372 ;; This loop does a breadth-first tree walk on DIR's subtree, | 372 ;; This loop does a breadth-first tree walk on DIR's subtree, |
373 ;; putting each subdir into DIRS as its contents are examined. | 373 ;; putting each subdir into DIRS as its contents are examined. |
374 (while pending | 374 (while pending |
483 ;; We are going to access the auto-save | 483 ;; We are going to access the auto-save |
484 ;; directory, so make sure it exists. | 484 ;; directory, so make sure it exists. |
485 (make-directory | 485 (make-directory |
486 (file-name-directory auto-save-list-file-prefix) | 486 (file-name-directory auto-save-list-file-prefix) |
487 t) | 487 t) |
488 (concat | 488 (concat |
489 (make-temp-name | 489 (make-temp-name |
490 (expand-file-name | 490 (expand-file-name |
491 auto-save-list-file-prefix)) | 491 auto-save-list-file-prefix)) |
492 "~")) | 492 "~")) |
493 (t | 493 (t |
878 (run-hooks 'before-init-hook) | 878 (run-hooks 'before-init-hook) |
879 | 879 |
880 ;; Run the site-start library if it exists. The point of this file is | 880 ;; Run the site-start library if it exists. The point of this file is |
881 ;; that it is run before .emacs. There is no point in doing this after | 881 ;; that it is run before .emacs. There is no point in doing this after |
882 ;; .emacs; that is useless. | 882 ;; .emacs; that is useless. |
883 (if site-run-file | 883 (if site-run-file |
884 (load site-run-file t t)) | 884 (load site-run-file t t)) |
885 | 885 |
886 ;; Sites should not disable this. Only individuals should disable | 886 ;; Sites should not disable this. Only individuals should disable |
887 ;; the startup message. | 887 ;; the startup message. |
888 (setq inhibit-startup-message nil) | 888 (setq inhibit-startup-message nil) |
905 (concat "~" init-file-user "/_emacs")) | 905 (concat "~" init-file-user "/_emacs")) |
906 ((eq system-type 'windows-nt) | 906 ((eq system-type 'windows-nt) |
907 (if (directory-files "~" nil "^\\.emacs\\(\\.elc?\\)?$") | 907 (if (directory-files "~" nil "^\\.emacs\\(\\.elc?\\)?$") |
908 "~/.emacs" | 908 "~/.emacs" |
909 "~/_emacs")) | 909 "~/_emacs")) |
910 ((eq system-type 'vax-vms) | 910 ((eq system-type 'vax-vms) |
911 "sys$login:.emacs") | 911 "sys$login:.emacs") |
912 (t | 912 (t |
913 (concat "~" init-file-user "/.emacs"))))) | 913 (concat "~" init-file-user "/.emacs"))))) |
914 ;; This tells `load' to store the file name found | 914 ;; This tells `load' to store the file name found |
915 ;; into user-init-file. | 915 ;; into user-init-file. |
916 (setq user-init-file t) | 916 (setq user-init-file t) |
917 (load user-init-file-1 t t) | 917 (load user-init-file-1 t t) |
918 | 918 |
919 (when (eq user-init-file t) | 919 (when (eq user-init-file t) |
920 ;; If we did not find ~/.emacs, try | 920 ;; If we did not find ~/.emacs, try |
921 ;; ~/.emacs.d/.emacs. | 921 ;; ~/.emacs.d/.emacs. |
922 (let ((otherfile | 922 (let ((otherfile |
923 (expand-file-name | 923 (expand-file-name |
931 ;; If we did not find the user's init file, | 931 ;; If we did not find the user's init file, |
932 ;; set user-init-file conclusively. | 932 ;; set user-init-file conclusively. |
933 ;; Don't let it be set from default.el. | 933 ;; Don't let it be set from default.el. |
934 (when (eq user-init-file t) | 934 (when (eq user-init-file t) |
935 (setq user-init-file user-init-file-1)))) | 935 (setq user-init-file user-init-file-1)))) |
936 | 936 |
937 ;; If we loaded a compiled file, set | 937 ;; If we loaded a compiled file, set |
938 ;; `user-init-file' to the source version if that | 938 ;; `user-init-file' to the source version if that |
939 ;; exists. | 939 ;; exists. |
940 (when (and user-init-file | 940 (when (and user-init-file |
941 (equal (file-name-extension user-init-file) | 941 (equal (file-name-extension user-init-file) |
949 (when (file-newer-than-file-p source user-init-file) | 949 (when (file-newer-than-file-p source user-init-file) |
950 (message "Warning: %s is newer than %s" | 950 (message "Warning: %s is newer than %s" |
951 source user-init-file) | 951 source user-init-file) |
952 (sit-for 1)) | 952 (sit-for 1)) |
953 (setq user-init-file source)))) | 953 (setq user-init-file source)))) |
954 | 954 |
955 (when (and (stringp custom-file) | 955 (when (and (stringp custom-file) |
956 (not (assoc custom-file load-history))) | 956 (not (assoc custom-file load-history))) |
957 ;; If the .emacs file has set `custom-file' but hasn't | 957 ;; If the .emacs file has set `custom-file' but hasn't |
958 ;; loaded the file yet, let's load it. | 958 ;; loaded the file yet, let's load it. |
959 (load custom-file t t)) | 959 (load custom-file t t)) |
960 | 960 |
961 (or inhibit-default-init | 961 (or inhibit-default-init |
962 (let ((inhibit-startup-message nil)) | 962 (let ((inhibit-startup-message nil)) |
963 ;; Users are supposed to be told their rights. | 963 ;; Users are supposed to be told their rights. |
964 ;; (Plus how to get help and how to undo.) | 964 ;; (Plus how to get help and how to undo.) |
965 ;; Don't you dare turn this off for anyone | 965 ;; Don't you dare turn this off for anyone |
1023 (buffer-list)) | 1023 (buffer-list)) |
1024 ;; Also re-set the language environment in case it was | 1024 ;; Also re-set the language environment in case it was |
1025 ;; originally done before unibyte was set and is sensitive to | 1025 ;; originally done before unibyte was set and is sensitive to |
1026 ;; unibyte (display table, terminal coding system &c). | 1026 ;; unibyte (display table, terminal coding system &c). |
1027 (set-language-environment current-language-environment))) | 1027 (set-language-environment current-language-environment))) |
1028 | 1028 |
1029 ;; Do this here in case the init file sets mail-host-address. | 1029 ;; Do this here in case the init file sets mail-host-address. |
1030 (if (equal user-mail-address "") | 1030 (if (equal user-mail-address "") |
1031 (setq user-mail-address (concat (user-login-name) "@" | 1031 (setq user-mail-address (concat (user-login-name) "@" |
1032 (or mail-host-address | 1032 (or mail-host-address |
1033 (system-name))))) | 1033 (system-name))))) |
1037 ;; be realized. | 1037 ;; be realized. |
1038 (unless (and (eq scalable-fonts-allowed old-scalable-fonts-allowed) | 1038 (unless (and (eq scalable-fonts-allowed old-scalable-fonts-allowed) |
1039 (eq font-list-limit old-font-list-limit) | 1039 (eq font-list-limit old-font-list-limit) |
1040 (eq face-ignored-fonts old-face-ignored-fonts)) | 1040 (eq face-ignored-fonts old-face-ignored-fonts)) |
1041 (clear-face-cache))) | 1041 (clear-face-cache))) |
1042 | 1042 |
1043 (run-hooks 'after-init-hook) | 1043 (run-hooks 'after-init-hook) |
1044 | 1044 |
1045 ;; If *scratch* exists and init file didn't change its mode, initialize it. | 1045 ;; If *scratch* exists and init file didn't change its mode, initialize it. |
1046 (if (get-buffer "*scratch*") | 1046 (if (get-buffer "*scratch*") |
1047 (with-current-buffer "*scratch*" | 1047 (with-current-buffer "*scratch*" |
1048 (if (eq major-mode 'fundamental-mode) | 1048 (if (eq major-mode 'fundamental-mode) |
1049 (funcall initial-major-mode)))) | 1049 (funcall initial-major-mode)))) |
1050 | 1050 |
1051 ;; Load library for our terminal type. | 1051 ;; Load library for our terminal type. |
1052 ;; User init file can set term-file-prefix to nil to prevent this. | 1052 ;; User init file can set term-file-prefix to nil to prevent this. |
1053 (and term-file-prefix (not noninteractive) (not window-system) | 1053 (and term-file-prefix (not noninteractive) (not window-system) |
1054 (let ((term (getenv "TERM")) | 1054 (let ((term (getenv "TERM")) |
1055 hyphend) | 1055 hyphend) |
1308 (define-key map [mode-line t] 'ignore) | 1308 (define-key map [mode-line t] 'ignore) |
1309 (setq cursor-type nil | 1309 (setq cursor-type nil |
1310 display-hourglass nil | 1310 display-hourglass nil |
1311 minor-mode-map-alist nil | 1311 minor-mode-map-alist nil |
1312 buffer-undo-list t | 1312 buffer-undo-list t |
1313 mode-line-format (propertize "---- %b %-" | 1313 mode-line-format (propertize "---- %b %-" |
1314 'face '(:weight bold)) | 1314 'face '(:weight bold)) |
1315 fancy-splash-stop-time (+ (float-time) | 1315 fancy-splash-stop-time (+ (float-time) |
1316 (max 60 fancy-splash-max-time)) | 1316 (max 60 fancy-splash-max-time)) |
1317 timer (run-with-timer 0 fancy-splash-delay | 1317 timer (run-with-timer 0 fancy-splash-delay |
1318 #'fancy-splash-screens-1 | 1318 #'fancy-splash-screens-1 |
1355 "Display splash screen when Emacs starts." | 1355 "Display splash screen when Emacs starts." |
1356 (let ((prev-buffer (current-buffer))) | 1356 (let ((prev-buffer (current-buffer))) |
1357 (unwind-protect | 1357 (unwind-protect |
1358 (with-current-buffer (get-buffer-create "GNU Emacs") | 1358 (with-current-buffer (get-buffer-create "GNU Emacs") |
1359 (let ((tab-width 8) | 1359 (let ((tab-width 8) |
1360 (mode-line-format (propertize "---- %b %-" | 1360 (mode-line-format (propertize "---- %b %-" |
1361 'face '(:weight bold)))) | 1361 'face '(:weight bold)))) |
1362 | 1362 |
1363 ;; The convention for this piece of code is that | 1363 ;; The convention for this piece of code is that |
1364 ;; each piece of output starts with one or two newlines | 1364 ;; each piece of output starts with one or two newlines |
1365 ;; and does not end with any newlines. | 1365 ;; and does not end with any newlines. |
1446 Copyright (C) 2002 Free Software Foundation, Inc.") | 1446 Copyright (C) 2002 Free Software Foundation, Inc.") |
1447 | 1447 |
1448 (if (and (eq (key-binding "\C-h\C-c") 'describe-copying) | 1448 (if (and (eq (key-binding "\C-h\C-c") 'describe-copying) |
1449 (eq (key-binding "\C-h\C-d") 'describe-distribution) | 1449 (eq (key-binding "\C-h\C-d") 'describe-distribution) |
1450 (eq (key-binding "\C-h\C-w") 'describe-no-warranty)) | 1450 (eq (key-binding "\C-h\C-w") 'describe-no-warranty)) |
1451 (insert | 1451 (insert |
1452 "\n | 1452 "\n |
1453 GNU Emacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details. | 1453 GNU Emacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details. |
1454 Emacs is Free Software--Free as in Freedom--so you can redistribute copies | 1454 Emacs is Free Software--Free as in Freedom--so you can redistribute copies |
1455 of Emacs and modify it; type C-h C-c to see the conditions. | 1455 of Emacs and modify it; type C-h C-c to see the conditions. |
1456 Type C-h C-d for information on getting the latest version.") | 1456 Type C-h C-d for information on getting the latest version.") |