comparison lisp/startup.el @ 83358:07db5d4dfae1

Fix terminal initialization code. (Contributed by Dan Nicolaescu.) * lisp/faces.el (tty-create-frame-with-faces): Call terminal-init-*. Don't load the initialization file more than once. * lisp/startup.el (command-line): Don't load the terminal initialization file more than once. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-398
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 07 Sep 2005 02:22:52 +0000
parents 532e0a9335a9
children 8f0c7632f259
comparison
equal deleted inserted replaced
83357:e6d91c4a8c05 83358:07db5d4dfae1
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 (null term-file-prefix))
984 (let ((term (getenv "TERM")) 984 (let ((term (getenv "TERM"))
985 hyphend) 985 hyphend
986 term-init-func)
986 (while (and term 987 (while (and term
988 (not (fboundp
989 (setq term-init-func (intern (concat "terminal-init-" term)))))
987 (not (load (concat term-file-prefix term) t t))) 990 (not (load (concat term-file-prefix term) t t)))
988 ;; Strip off last hyphen and what follows, then try again 991 ;; Strip off last hyphen and what follows, then try again
989 (setq term 992 (setq term
990 (if (setq hyphend (string-match "[-_][^-_]+$" term)) 993 (if (setq hyphend (string-match "[-_][^-_]+$" term))
991 (substring term 0 hyphend) 994 (substring term 0 hyphend)
992 nil))) 995 nil))
996 (setq term-init-func nil))
993 (when term 997 (when term
994 ;; The terminal file has been loaded, now call the terminal 998 ;; The terminal file has been loaded, now call the terminal
995 ;; specific initialization function. 999 ;; specific initialization function.
996 (let ((term-init-func (intern (concat "terminal-init-" term)))) 1000 (unless term-init-func
1001 (setq term-init-func (intern (concat "terminal-init-" term)))
997 (when (fboundp term-init-func) 1002 (when (fboundp term-init-func)
998 (funcall term-init-func)))))) 1003 (funcall term-init-func))))))
999 1004
1000 ;; Update the out-of-memory error message based on user's key bindings 1005 ;; Update the out-of-memory error message based on user's key bindings
1001 ;; for save-some-buffers. 1006 ;; for save-some-buffers.