changeset 25211:a1527fde7766

(msdos-bg-mode): Remove. Call frame-set-background-mode instead. All callers changed. (msdos-face-setup): Don't force color display parameter, it is set by frame-set-background-mode. (make-msdos-frame): Call x-handle-reverse-video and face-set-after-frame-default. Delete frame if creation failed.
author Eli Zaretskii <eliz@gnu.org>
date Tue, 10 Aug 1999 10:21:18 +0000
parents b145fd152286
children f0cb2d2e49f2
files lisp/term/pc-win.el
diffstat 1 files changed, 10 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/pc-win.el	Tue Aug 10 10:17:47 1999 +0000
+++ b/lisp/term/pc-win.el	Tue Aug 10 10:21:18 1999 +0000
@@ -293,18 +293,6 @@
 (defvar default-frame-alist nil)
 (modify-frame-parameters terminal-frame default-frame-alist)
 
-(defun msdos-bg-mode (&optional frame)
-  (let* ((frame (or frame (selected-frame)))
-	 (params (frame-parameters frame))
-	 (bg (cdr (assq 'background-color params))))
-    ;; The list of ``dark'' colors should be consistent with
-    ;; `x-color-values' (below) and the dark/light color
-    ;; decisions `frame-set-background-mode' in lisp/faces.el.
-    (if (member bg
-		'("black" "blue" "green" "red" "magenta" "brown" "darkgray"))
-	'dark
-      'light)))
-
 (defun msdos-face-setup ()
   (modify-frame-parameters terminal-frame default-frame-alist)
   (face-clear-tty-colors)
@@ -314,10 +302,7 @@
       (face-register-tty-color (car (car colors)) i)
       (setq colors (cdr colors) i (1+ i))))
 
-  (modify-frame-parameters terminal-frame
-			   (list (cons 'background-mode
-				       (msdos-bg-mode terminal-frame))
-				 (cons 'display-type 'color)))
+  (frame-set-background-mode terminal-frame)
   (face-set-after-frame-default terminal-frame)
 
   (set-face-foreground 'bold "yellow" terminal-frame)
@@ -341,11 +326,15 @@
 (defun make-msdos-frame (&optional parameters)
   (let* ((parms
 	  (append initial-frame-alist default-frame-alist parameters nil))
-	 (frame (make-terminal-frame parms)))
-    (modify-frame-parameters frame
-			     (list (cons 'background-mode
-					 (msdos-bg-mode frame))
-				   (cons 'display-type 'color)))
+	 (frame (make-terminal-frame parms))
+	 success)
+    (unwind-protect
+	(progn
+	  (x-handle-reverse-video frame parms)
+	  (frame-set-background-mode frame)
+	  (face-set-after-frame-default frame)
+	  (setq success t))
+      (unless success (delete-frame frame)))
     frame))
 
 (setq frame-creation-function 'make-msdos-frame)