# HG changeset patch # User Karoly Lorentey # Date 1126059772 0 # Node ID 07db5d4dfae183ee84565c5bc2c8be4e7c76f3f7 # Parent e6d91c4a8c05d28f847bb732b5c776d1cb77d394 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 diff -r e6d91c4a8c05 -r 07db5d4dfae1 lisp/faces.el --- a/lisp/faces.el Mon Sep 05 14:29:12 2005 +0000 +++ b/lisp/faces.el Wed Sep 07 02:22:52 2005 +0000 @@ -1820,14 +1820,25 @@ ;; User init file can set term-file-prefix to nil to prevent this. (unless (null term-file-prefix) (let ((term (cdr (assq 'tty-type parameters))) - hyphend) + hyphend + term-init-func) (while (and term + (not (fboundp + (setq term-init-func (intern (concat "terminal-init-" term))))) (not (load (concat term-file-prefix term) t t))) ;; Strip off last hyphen and what follows, then try again (setq term (if (setq hyphend (string-match "[-_][^-_]+$" term)) (substring term 0 hyphend) - nil))))) + nil)) + (setq term-init-func nil)) + (when term + ;; The terminal file has been loaded, now call the terminal + ;; specific initialization function. + (unless term-init-func + (setq term-init-func (intern (concat "terminal-init-" term))) + (when (fboundp term-init-func) + (funcall term-init-func)))))) ;; Make sure the kill and yank functions do not touch the X clipboard. (modify-frame-parameters frame '((interprogram-cut-function . nil))) (modify-frame-parameters frame '((interprogram-paste-function . nil))) diff -r e6d91c4a8c05 -r 07db5d4dfae1 lisp/startup.el --- a/lisp/startup.el Mon Sep 05 14:29:12 2005 +0000 +++ b/lisp/startup.el Wed Sep 07 02:22:52 2005 +0000 @@ -982,18 +982,23 @@ initial-window-system (null term-file-prefix)) (let ((term (getenv "TERM")) - hyphend) + hyphend + term-init-func) (while (and term + (not (fboundp + (setq term-init-func (intern (concat "terminal-init-" term))))) (not (load (concat term-file-prefix term) t t))) ;; Strip off last hyphen and what follows, then try again (setq term (if (setq hyphend (string-match "[-_][^-_]+$" term)) (substring term 0 hyphend) - nil))) + nil)) + (setq term-init-func nil)) (when term ;; The terminal file has been loaded, now call the terminal ;; specific initialization function. - (let ((term-init-func (intern (concat "terminal-init-" term)))) + (unless term-init-func + (setq term-init-func (intern (concat "terminal-init-" term))) (when (fboundp term-init-func) (funcall term-init-func))))))