Mercurial > emacs
comparison lisp/startup.el @ 83353:532e0a9335a9
Merged in changes from CVS trunk. Plus added lisp/term tweaks.
Patches applied:
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--base-0
tag of miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-474
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-1
Add CVS metadata files.
* lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-2
Update from CVS.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-393
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sun, 04 Sep 2005 03:48:17 +0000 |
parents | 6c13700d1c13 d92890473bd3 |
children | 07db5d4dfae1 |
comparison
equal
deleted
inserted
replaced
83352:b258b3492423 | 83353:532e0a9335a9 |
---|---|
1 ;;; startup.el --- process Emacs shell arguments | 1 ;;; startup.el --- process Emacs shell arguments |
2 | 2 |
3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, | 3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, |
4 ;; 2001, 2002, 2004, 2005 Free Software Foundation, Inc. | 4 ;; 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
5 | 5 |
6 ;; Maintainer: FSF | 6 ;; Maintainer: FSF |
7 ;; Keywords: internal | 7 ;; Keywords: internal |
8 | 8 |
9 ;; This file is part of GNU Emacs. | 9 ;; This file is part of GNU Emacs. |
189 "Non-nil means don't run `term-setup-hook' and `emacs-startup-hook'. | 189 "Non-nil means don't run `term-setup-hook' and `emacs-startup-hook'. |
190 This is because we already did so.") | 190 This is because we already did so.") |
191 | 191 |
192 (defvar keyboard-type nil | 192 (defvar keyboard-type nil |
193 "The brand of keyboard you are using. | 193 "The brand of keyboard you are using. |
194 This variable is used to define | 194 This variable is used to define the proper function and keypad |
195 the proper function and keypad keys for use under X. It is used in a | 195 keys for use under X. It is used in a fashion analogous to the |
196 fashion analogous to the environment variable TERM.") | 196 environment variable TERM.") |
197 | 197 |
198 (defvar window-setup-hook nil | 198 (defvar window-setup-hook nil |
199 "Normal hook run to initialize window system display. | 199 "Normal hook run to initialize window system display. |
200 Emacs runs this hook after processing the command line arguments and loading | 200 Emacs runs this hook after processing the command line arguments and loading |
201 the user's init file.") | 201 the user's init file.") |
239 is less convenient. | 239 is less convenient. |
240 | 240 |
241 This variable is defined for customization so as to make | 241 This variable is defined for customization so as to make |
242 it visible in the relevant context. However, actually customizing it | 242 it visible in the relevant context. However, actually customizing it |
243 is not allowed, since it would not work anyway. The only way to set | 243 is not allowed, since it would not work anyway. The only way to set |
244 this variable usefully is to set it during while building and dumping Emacs." | 244 this variable usefully is to set it while building and dumping Emacs." |
245 :type '(choice (const :tag "none" nil) string) | 245 :type '(choice (const :tag "none" nil) string) |
246 :group 'initialization | 246 :group 'initialization |
247 :initialize 'custom-initialize-default | 247 :initialize 'custom-initialize-default |
248 :set '(lambda (variable value) | 248 :set '(lambda (variable value) |
249 (error "Customizing `site-run-file' does not work"))) | 249 (error "Customizing `site-run-file' does not work"))) |
577 (defun command-line () | 577 (defun command-line () |
578 (setq command-line-default-directory default-directory) | 578 (setq command-line-default-directory default-directory) |
579 | 579 |
580 ;; Choose a reasonable location for temporary files. | 580 ;; Choose a reasonable location for temporary files. |
581 (custom-reevaluate-setting 'temporary-file-directory) | 581 (custom-reevaluate-setting 'temporary-file-directory) |
582 (custom-reevaluate-setting 'small-emporary-file-directory) | 582 (custom-reevaluate-setting 'small-temporary-file-directory) |
583 (custom-reevaluate-setting 'auto-save-file-name-transforms) | 583 (custom-reevaluate-setting 'auto-save-file-name-transforms) |
584 | 584 |
585 ;; See if we should import version-control from the environment variable. | 585 ;; See if we should import version-control from the environment variable. |
586 (let ((vc (getenv "VERSION_CONTROL"))) | 586 (let ((vc (getenv "VERSION_CONTROL"))) |
587 (cond ((eq vc nil)) ;don't do anything if not set | 587 (cond ((eq vc nil)) ;don't do anything if not set |
668 | 668 |
669 ;; Process the command-line args, and delete the arguments | 669 ;; Process the command-line args, and delete the arguments |
670 ;; processed. This is consistent with the way main in emacs.c | 670 ;; processed. This is consistent with the way main in emacs.c |
671 ;; does things. | 671 ;; does things. |
672 (while (and (not done) args) | 672 (while (and (not done) args) |
673 (let* ((longopts '(("--no-init-file") ("--no-site-file") ("--user") | 673 (let* ((longopts '(("--no-init-file") ("--no-site-file") ("--debug-init") |
674 ("--debug-init") ("--iconic") ("--icon-type") | 674 ("--user") ("--iconic") ("--icon-type") ("--quick") |
675 ("--no-blinking-cursor") ("--bare-bones"))) | 675 ("--no-blinking-cursor") ("--basic-display"))) |
676 (argi (pop args)) | 676 (argi (pop args)) |
677 (orig-argi argi) | 677 (orig-argi argi) |
678 argval) | 678 argval) |
679 ;; Handle --OPTION=VALUE format. | 679 ;; Handle --OPTION=VALUE format. |
680 (when (string-match "^\\(--[^=]*\\)=" argi) | 680 (when (string-match "^\\(--[^=]*\\)=" argi) |
756 | 756 |
757 ;; Can't do this init in defcustom because the relevant variables | 757 ;; Can't do this init in defcustom because the relevant variables |
758 ;; are not set. | 758 ;; are not set. |
759 (custom-reevaluate-setting 'blink-cursor-mode) | 759 (custom-reevaluate-setting 'blink-cursor-mode) |
760 (custom-reevaluate-setting 'normal-erase-is-backspace) | 760 (custom-reevaluate-setting 'normal-erase-is-backspace) |
761 | 761 (custom-reevaluate-setting 'tooltip-mode) |
762 ;; If you change the code below, you need to also change the | |
763 ;; corresponding code in the tooltip-mode defcustom. The two need | |
764 ;; to be equivalent under all conditions, or Custom will get confused. | |
765 (unless (or noninteractive | |
766 emacs-basic-display | |
767 (not (display-graphic-p)) | |
768 (not (fboundp 'x-show-tip))) | |
769 (tooltip-mode 1)) | |
770 | 762 |
771 ;; Register default TTY colors for the case the terminal hasn't a | 763 ;; Register default TTY colors for the case the terminal hasn't a |
772 ;; terminal init file. | 764 ;; terminal init file. |
773 ;; We do this regardles of whether the terminal supports colors | 765 ;; We do this regardles of whether the terminal supports colors |
774 ;; or not, since they can switch that support on or off in | 766 ;; or not, since they can switch that support on or off in |
995 (not (load (concat term-file-prefix term) t t))) | 987 (not (load (concat term-file-prefix term) t t))) |
996 ;; Strip off last hyphen and what follows, then try again | 988 ;; Strip off last hyphen and what follows, then try again |
997 (setq term | 989 (setq term |
998 (if (setq hyphend (string-match "[-_][^-_]+$" term)) | 990 (if (setq hyphend (string-match "[-_][^-_]+$" term)) |
999 (substring term 0 hyphend) | 991 (substring term 0 hyphend) |
1000 nil))))) | 992 nil))) |
993 (when term | |
994 ;; The terminal file has been loaded, now call the terminal | |
995 ;; specific initialization function. | |
996 (let ((term-init-func (intern (concat "terminal-init-" term)))) | |
997 (when (fboundp term-init-func) | |
998 (funcall term-init-func)))))) | |
1001 | 999 |
1002 ;; Update the out-of-memory error message based on user's key bindings | 1000 ;; Update the out-of-memory error message based on user's key bindings |
1003 ;; for save-some-buffers. | 1001 ;; for save-some-buffers. |
1004 (setq memory-signal-data | 1002 (setq memory-signal-data |
1005 (list 'error | 1003 (list 'error |
1068 :face (variable-pitch :slant oblique) | 1066 :face (variable-pitch :slant oblique) |
1069 "ABSOLUTELY NO WARRANTY\n" | 1067 "ABSOLUTELY NO WARRANTY\n" |
1070 :face variable-pitch | 1068 :face variable-pitch |
1071 "\ | 1069 "\ |
1072 Copying Conditions\tConditions for redistributing and changing Emacs | 1070 Copying Conditions\tConditions for redistributing and changing Emacs |
1071 Getting New Versions\tHow to obtain the latest version of Emacs | |
1073 More Manuals / Ordering Manuals Buying printed manuals from the FSF\n") | 1072 More Manuals / Ordering Manuals Buying printed manuals from the FSF\n") |
1074 (:face variable-pitch | 1073 (:face variable-pitch |
1075 "You can do basic editing with the menu bar and scroll bar \ | 1074 "You can do basic editing with the menu bar and scroll bar \ |
1076 using the mouse.\n\n" | 1075 using the mouse.\n\n" |
1077 :face (variable-pitch :weight bold) | 1076 :face (variable-pitch :weight bold) |
1353 (insert "\ | 1352 (insert "\ |
1354 You can do basic editing with the menu bar and scroll bar using the mouse. | 1353 You can do basic editing with the menu bar and scroll bar using the mouse. |
1355 | 1354 |
1356 Useful File menu items: | 1355 Useful File menu items: |
1357 Exit Emacs (or type Control-x followed by Control-c) | 1356 Exit Emacs (or type Control-x followed by Control-c) |
1358 Recover Session recover files you were editing before a crash | 1357 Recover Crashed Session Recover files you were editing before a crash |
1359 | 1358 |
1360 Important Help menu items: | 1359 Important Help menu items: |
1361 Emacs Tutorial Learn-by-doing tutorial for using Emacs efficiently. | 1360 Emacs Tutorial Learn how to use Emacs efficiently |
1362 Emacs FAQ Frequently asked questions and answers | 1361 Emacs FAQ Frequently asked questions and answers |
1363 Read the Emacs Manual View the Emacs manual using Info | 1362 Read the Emacs Manual View the Emacs manual using Info |
1364 \(Non)Warranty GNU Emacs comes with ABSOLUTELY NO WARRANTY | 1363 \(Non)Warranty GNU Emacs comes with ABSOLUTELY NO WARRANTY |
1365 Copying Conditions Conditions for redistributing and changing Emacs. | 1364 Copying Conditions Conditions for redistributing and changing Emacs |
1366 Getting New Versions How to obtain the latest version of Emacs. | 1365 Getting New Versions How to obtain the latest version of Emacs |
1367 More Manuals / Ordering Manuals How to order printed manuals from the FSF. | 1366 More Manuals / Ordering Manuals How to order printed manuals from the FSF |
1368 ") | 1367 ") |
1369 (insert "\n\n" (emacs-version) | 1368 (insert "\n\n" (emacs-version) |
1370 " | 1369 " |
1371 Copyright (C) 2004 Free Software Foundation, Inc.")) | 1370 Copyright (C) 2005 Free Software Foundation, Inc.")) |
1372 | 1371 |
1373 ;; No mouse menus, so give help using kbd commands. | 1372 ;; No mouse menus, so give help using kbd commands. |
1374 | 1373 |
1375 ;; If keys have their default meanings, | 1374 ;; If keys have their default meanings, |
1376 ;; use precomputed string to save lots of time. | 1375 ;; use precomputed string to save lots of time. |
1414 \(`C-' means use the CTRL key. `M-' means use the Meta (or Alt) key. | 1413 \(`C-' means use the CTRL key. `M-' means use the Meta (or Alt) key. |
1415 If you have no Meta key, you may instead type ESC followed by the character.)") | 1414 If you have no Meta key, you may instead type ESC followed by the character.)") |
1416 | 1415 |
1417 (insert "\n\n" (emacs-version) | 1416 (insert "\n\n" (emacs-version) |
1418 " | 1417 " |
1419 Copyright (C) 2004 Free Software Foundation, Inc.") | 1418 Copyright (C) 2005 Free Software Foundation, Inc.") |
1420 | 1419 |
1421 (if (and (eq (key-binding "\C-h\C-c") 'describe-copying) | 1420 (if (and (eq (key-binding "\C-h\C-c") 'describe-copying) |
1422 (eq (key-binding "\C-h\C-d") 'describe-distribution) | 1421 (eq (key-binding "\C-h\C-d") 'describe-distribution) |
1423 (eq (key-binding "\C-h\C-w") 'describe-no-warranty)) | 1422 (eq (key-binding "\C-h\C-w") 'describe-no-warranty)) |
1424 (insert | 1423 (insert |
1639 (file-ex (expand-file-name file))) | 1638 (file-ex (expand-file-name file))) |
1640 (when (file-exists-p file-ex) | 1639 (when (file-exists-p file-ex) |
1641 (setq file file-ex)) | 1640 (setq file file-ex)) |
1642 (load file nil t))) | 1641 (load file nil t))) |
1643 | 1642 |
1643 ;; This is used to handle -script. It's not clear | |
1644 ;; we need to document it. | |
1645 ((member argi '("-scriptload")) | |
1646 (let* ((file (command-line-normalize-file-name | |
1647 (or argval (pop command-line-args-left)))) | |
1648 ;; Take file from default dir. | |
1649 (file-ex (expand-file-name file))) | |
1650 (load file-ex nil t t))) | |
1651 | |
1644 ((equal argi "-insert") | 1652 ((equal argi "-insert") |
1645 (setq tem (or argval (pop command-line-args-left))) | 1653 (setq tem (or argval (pop command-line-args-left))) |
1646 (or (stringp tem) | 1654 (or (stringp tem) |
1647 (error "File name omitted from `-insert' option")) | 1655 (error "File name omitted from `-insert' option")) |
1648 (insert-file-contents (command-line-normalize-file-name tem))) | 1656 (insert-file-contents (command-line-normalize-file-name tem))) |
1719 (list-buffers))))) | 1727 (list-buffers))))) |
1720 | 1728 |
1721 ;; Maybe display a startup screen. | 1729 ;; Maybe display a startup screen. |
1722 (unless (or inhibit-startup-message | 1730 (unless (or inhibit-startup-message |
1723 noninteractive | 1731 noninteractive |
1724 emacs-quick-startup | 1732 emacs-quick-startup) |
1725 ;; Don't display startup screen if init file | |
1726 ;; has started some sort of server. | |
1727 (and (fboundp 'process-list) | |
1728 (process-list))) | |
1729 ;; Display a startup screen, after some preparations. | 1733 ;; Display a startup screen, after some preparations. |
1730 | 1734 |
1731 ;; If there are no switches to process, we might as well | 1735 ;; If there are no switches to process, we might as well |
1732 ;; run this hook now, and there may be some need to do it | 1736 ;; run this hook now, and there may be some need to do it |
1733 ;; before doing any output. | 1737 ;; before doing any output. |