diff 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
line wrap: on
line diff
--- a/lisp/startup.el	Wed Sep 07 02:22:52 2005 +0000
+++ b/lisp/startup.el	Wed Sep 07 02:29:18 2005 +0000
@@ -979,28 +979,8 @@
   ;; Load library for our terminal type.
   ;; User init file can set term-file-prefix to nil to prevent this.
   (unless (or noninteractive
-              initial-window-system
-              (null term-file-prefix))
-    (let ((term (getenv "TERM"))
-          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))
-	(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))))))
+              initial-window-system)
+    (tty-run-terminal-initialization (selected-frame)))
 
   ;; Update the out-of-memory error message based on user's key bindings
   ;; for save-some-buffers.