changeset 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 e6d91c4a8c05
children 8f0c7632f259
files lisp/faces.el lisp/startup.el
diffstat 2 files changed, 21 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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)))
--- 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))))))