Mercurial > emacs
comparison lisp/term/pc-win.el @ 18770:94ca3c126cee
(msdos-bg-mode): New function.
(msdos-face-setup, make-msdos-frame): Set background-mode and
display-type properties for created frames.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 13 Jul 1997 20:52:08 +0000 |
parents | 8f952e921136 |
children | e83ac35f9bcb |
comparison
equal
deleted
inserted
replaced
18769:48fd714b8115 | 18770:94ca3c126cee |
---|---|
1 ;;; pc-win.el --- setup support for `PC windows' (whatever that is). | 1 ;;; pc-win.el --- setup support for `PC windows' (whatever that is). |
2 | 2 |
3 ;; Copyright (C) 1994, 1996 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Morten Welinder <terra@diku.dk> | 5 ;; Author: Morten Welinder <terra@diku.dk> |
6 ;; Maintainer: FSF | 6 ;; Maintainer: FSF |
7 | 7 |
8 ;; This file is part of GNU Emacs. | 8 ;; This file is part of GNU Emacs. |
204 ;; --------------------------------------------------------------------------- | 204 ;; --------------------------------------------------------------------------- |
205 ;; We want to delay setting frame parameters until the faces are setup | 205 ;; We want to delay setting frame parameters until the faces are setup |
206 (defvar default-frame-alist nil) | 206 (defvar default-frame-alist nil) |
207 (modify-frame-parameters terminal-frame default-frame-alist) | 207 (modify-frame-parameters terminal-frame default-frame-alist) |
208 | 208 |
209 (defun msdos-bg-mode (&optional frame) | |
210 (let* ((frame (or frame (selected-frame))) | |
211 (params (frame-parameters frame)) | |
212 (bg (cdr (assq 'background-color params)))) | |
213 (if (member bg '("black" "blue" "darkgray" "green")) | |
214 'dark | |
215 'light))) | |
216 | |
209 (defun msdos-face-setup () | 217 (defun msdos-face-setup () |
210 (modify-frame-parameters terminal-frame default-frame-alist) | 218 (modify-frame-parameters terminal-frame default-frame-alist) |
211 | 219 |
212 (set-face-foreground 'bold "yellow" terminal-frame) | 220 (set-face-foreground 'bold "yellow" terminal-frame) |
213 (set-face-foreground 'italic "red" terminal-frame) | 221 (set-face-foreground 'italic "red" terminal-frame) |
220 (make-face 'msdos-menu-select-face) | 228 (make-face 'msdos-menu-select-face) |
221 (set-face-foreground 'msdos-menu-active-face "white" terminal-frame) | 229 (set-face-foreground 'msdos-menu-active-face "white" terminal-frame) |
222 (set-face-foreground 'msdos-menu-passive-face "lightgray" terminal-frame) | 230 (set-face-foreground 'msdos-menu-passive-face "lightgray" terminal-frame) |
223 (set-face-background 'msdos-menu-active-face "blue" terminal-frame) | 231 (set-face-background 'msdos-menu-active-face "blue" terminal-frame) |
224 (set-face-background 'msdos-menu-passive-face "blue" terminal-frame) | 232 (set-face-background 'msdos-menu-passive-face "blue" terminal-frame) |
225 (set-face-background 'msdos-menu-select-face "red" terminal-frame)) | 233 (set-face-background 'msdos-menu-select-face "red" terminal-frame) |
234 (modify-frame-parameters terminal-frame | |
235 (list (cons 'background-mode | |
236 (msdos-bg-mode terminal-frame)) | |
237 (cons 'display-type 'color)))) | |
226 | 238 |
227 ;; We have only one font, so... | 239 ;; We have only one font, so... |
228 (add-hook 'before-init-hook 'msdos-face-setup) | 240 (add-hook 'before-init-hook 'msdos-face-setup) |
229 | 241 |
230 ;; We create frames as if we were a terminal, but with a twist. | 242 ;; We create frames as if we were a terminal, but with a twist. |
231 (defun make-msdos-frame (&optional parameters) | 243 (defun make-msdos-frame (&optional parameters) |
232 (let ((parms | 244 (let* ((parms |
233 (append initial-frame-alist default-frame-alist parameters nil))) | 245 (append initial-frame-alist default-frame-alist parameters nil)) |
234 (make-terminal-frame parms))) | 246 (frame (make-terminal-frame parms))) |
247 (modify-frame-parameters frame | |
248 (list (cons 'background-mode | |
249 (msdos-bg-mode frame)) | |
250 (cons 'display-type 'color))) | |
251 frame)) | |
235 | 252 |
236 (setq frame-creation-function 'make-msdos-frame) | 253 (setq frame-creation-function 'make-msdos-frame) |
237 | 254 |
238 ;; --------------------------------------------------------------------------- | 255 ;; --------------------------------------------------------------------------- |
239 ;; More or less useful imitations of certain X-functions. A lot of the | 256 ;; More or less useful imitations of certain X-functions. A lot of the |