Mercurial > emacs
comparison lisp/startup.el @ 83359:8f0c7632f259
Slightly refactor the terminal initialization code for simplicity.
* lisp/faces.el (tty-run-terminal-initialization): New function.
(tty-create-frame-with-faces): Use it.
* lisp/startup.el (command-line): Replace duplicated code with a call to
tty-run-terminal-initialization.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-399
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Wed, 07 Sep 2005 02:29:18 +0000 |
parents | 07db5d4dfae1 |
children | 2a679c81f552 |
comparison
equal
deleted
inserted
replaced
83358:07db5d4dfae1 | 83359:8f0c7632f259 |
---|---|
977 (funcall initial-major-mode)))) | 977 (funcall initial-major-mode)))) |
978 | 978 |
979 ;; Load library for our terminal type. | 979 ;; Load library for our terminal type. |
980 ;; User init file can set term-file-prefix to nil to prevent this. | 980 ;; User init file can set term-file-prefix to nil to prevent this. |
981 (unless (or noninteractive | 981 (unless (or noninteractive |
982 initial-window-system | 982 initial-window-system) |
983 (null term-file-prefix)) | 983 (tty-run-terminal-initialization (selected-frame))) |
984 (let ((term (getenv "TERM")) | |
985 hyphend | |
986 term-init-func) | |
987 (while (and term | |
988 (not (fboundp | |
989 (setq term-init-func (intern (concat "terminal-init-" term))))) | |
990 (not (load (concat term-file-prefix term) t t))) | |
991 ;; Strip off last hyphen and what follows, then try again | |
992 (setq term | |
993 (if (setq hyphend (string-match "[-_][^-_]+$" term)) | |
994 (substring term 0 hyphend) | |
995 nil)) | |
996 (setq term-init-func nil)) | |
997 (when term | |
998 ;; The terminal file has been loaded, now call the terminal | |
999 ;; specific initialization function. | |
1000 (unless term-init-func | |
1001 (setq term-init-func (intern (concat "terminal-init-" term))) | |
1002 (when (fboundp term-init-func) | |
1003 (funcall term-init-func)))))) | |
1004 | 984 |
1005 ;; Update the out-of-memory error message based on user's key bindings | 985 ;; Update the out-of-memory error message based on user's key bindings |
1006 ;; for save-some-buffers. | 986 ;; for save-some-buffers. |
1007 (setq memory-signal-data | 987 (setq memory-signal-data |
1008 (list 'error | 988 (list 'error |