annotate lisp/term/pc-win.el @ 14220:74d7745bcaa4

sp correction
author Simon Marshall <simon@gnu.org>
date Thu, 18 Jan 1996 16:10:41 +0000
parents 23cc3f54e536
children e46b1e676418
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9571
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
1 ;; pc-win.el -- setup support for `PC windows' (whatever that is).
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
2
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
3 ;; Copyright (C) 1994 Free Software Foundation, Inc.
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
4
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
5 ;; Author: Morten Welinder <terra@diku.dk>
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
6 ;; Version: 1,00
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
7
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
9
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
13 ;; any later version.
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
14
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
18 ;; GNU General Public License for more details.
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
19
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
14170
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
23 ;; Boston, MA 02111-1307, USA.
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
24
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
25 ;;; Code:
23cc3f54e536 Update FSF's office address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
26
9571
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
27 (load "term/internal" nil t)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
28
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
29 ;; Color translation -- doesn't really need to be fast
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
30
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
31 (defvar msdos-color-aliases
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
32 '(("purple" . "magenta")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
33 ("firebrick" . "red") ; ?
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
34 ("pink" . "lightred")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
35 ("royalblue" . "blue")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
36 ("cadetblue" . "blue")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
37 ("forestgreen" . "green")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
38 ("darkolivegreen" . "green")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
39 ("darkgoldenrod" . "brown")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
40 ("goldenrod" . "yellow")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
41 ("grey40" . "darkgray")
13924
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
42 ("dark gray" . "darkgray")
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
43 ("light gray" . "lightgray")
13628
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
44 ("rosybrown" . "brown")
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
45 ("blue" . "lightblue") ;; from here: for Enriched Text
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
46 ("darkslategray" . "darkgray")
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
47 ("orange" . "brown")
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
48 ("light blue" . "lightblue") ;; from here: for cpp-highlight
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
49 ("light cyan" . "lightcyan")
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
50 ("light yellow" . "yellow")
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
51 ("light pink" . "lightred")
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
52 ("pale green" . "lightgreen")
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
53 ("beige" . "brown")
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
54 ("medium purple" . "magenta")
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
55 ("turquoise" . "lightgreen")
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
56 ("violet" . "magenta"))
9571
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
57 "List of alternate names for colors.")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
58
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
59 (defun msdos-color-translate (name)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
60 (setq name (downcase name))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
61 (let* ((len (length name))
13924
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
62 (val (- (length x-colors)
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
63 (length (member name x-colors))))
9571
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
64 (try))
13924
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
65 (if (or (< val 0) (>= val (length x-colors))) (setq val nil))
9571
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
66 (or val
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
67 (and (setq try (cdr (assoc name msdos-color-aliases)))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
68 (msdos-color-translate try))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
69 (and (> len 5)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
70 (string= "light" (substring name 0 4))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
71 (setq try (msdos-color-translate (substring name 5)))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
72 (logior try 8))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
73 (and (> len 6)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
74 (string= "light " (substring name 0 5))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
75 (setq try (msdos-color-translate (substring name 6)))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
76 (logior try 8))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
77 (and (> len 4)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
78 (string= "dark" (substring name 0 3))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
79 (msdos-color-translate (substring name 4)))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
80 (and (> len 5)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
81 (string= "dark " (substring name 0 4))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
82 (msdos-color-translate (substring name 5))))))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
83 ;; ---------------------------------------------------------------------------
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
84 ;; We want to delay setting frame parameters until the faces are setup
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
85 (defvar default-frame-alist nil)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
86
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
87 (defun msdos-face-setup ()
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
88 (modify-frame-parameters (selected-frame) default-frame-alist)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
89
13628
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
90 (set-face-foreground 'bold "yellow")
9571
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
91 (set-face-foreground 'italic "red")
13628
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
92 (set-face-foreground 'bold-italic "lightred")
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
93 (set-face-foreground 'underline "white")
9571
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
94 (set-face-background 'region "green")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
95
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
96 (make-face 'msdos-menu-active-face)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
97 (make-face 'msdos-menu-passive-face)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
98 (make-face 'msdos-menu-select-face)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
99 (set-face-foreground 'msdos-menu-active-face "white")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
100 (set-face-foreground 'msdos-menu-passive-face "lightgray")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
101 (set-face-background 'msdos-menu-active-face "blue")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
102 (set-face-background 'msdos-menu-passive-face "blue")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
103 (set-face-background 'msdos-menu-select-face "red"))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
104
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
105 ;; We have only one font, so...
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
106 (add-hook 'before-init-hook 'msdos-face-setup)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
107 ;; ---------------------------------------------------------------------------
14040
187735b53d52 Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 13924
diff changeset
108 ;; More or less useful imitations of certain X-functions. A lot of the
9571
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
109 ;; values returned are questionable, but usually only the form of the
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
110 ;; returned value matters. Also, by the way, recall that `ignore' is
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
111 ;; a useful function for returning 'nil regardless of argument.
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
112
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
113 ;; From src/xfns.c
13484
be831ed47a75 (x-display-color-p): Accept optional arg.
Richard M. Stallman <rms@gnu.org>
parents: 9571
diff changeset
114 (defun x-display-color-p (&optional display) 't)
9571
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
115 (fset 'focus-frame 'ignore)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
116 (fset 'unfocus-frame 'ignore)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
117 (defun x-list-fonts (pattern &optional face frame) (list "default"))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
118 (defun x-color-defined-p (color) (numberp (msdos-color-translate color)))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
119 (defun x-display-pixel-width (&optional frame) (* 8 (frame-width frame)))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
120 (defun x-display-pixel-height (&optional frame) (* 8 (frame-height frame)))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
121 (defun x-display-planes (&optional frame) 4) ; 3 for background, actually
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
122 (defun x-display-color-cells (&optional frame) 16) ; ???
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
123 (defun x-server-max-request-size (&optional frame) 1000000) ; ???
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
124 (defun x-server-vendor (&optional frame) t "GNU")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
125 (defun x-server-version (&optional frame) '(1 0 0))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
126 (defun x-display-screens (&optional frame) 1)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
127 (defun x-display-mm-height (&optional frame) 200) ; Guess the size of my
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
128 (defun x-display-mm-width (&optional frame) 253) ; monitor, MW...
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
129 (defun x-display-backing-store (&optional frame) 'not-useful)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
130 (defun x-display-visual-class (&optional frame) 'static-color)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
131 (fset 'x-display-save-under 'ignore)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
132 (fset 'x-get-resource 'ignore)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
133
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
134 ;; From lisp/term/x-win.el
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
135 (setq x-display-name "pc")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
136 (setq split-window-keep-point t)
13924
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
137 (defvar x-colors '("black"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
138 "blue"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
139 "green"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
140 "cyan"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
141 "red"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
142 "magenta"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
143 "brown"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
144 "lightgray"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
145 "darkgray"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
146 "lightblue"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
147 "lightgreen"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
148 "lightcyan"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
149 "lightred"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
150 "lightmagenta"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
151 "yellow"
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
152 "white")
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
153 "The list of colors available on a PC display under MS-DOS.")
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
154 (defun x-defined-colors (&optional frame)
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
155 "Return a list of colors supported for a particular frame.
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
156 The argument FRAME specifies which frame to try.
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
157 The value may be different for frames on different X displays."
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
158 x-colors)
36aa12b0ea6a (x-colors): New variable, a list of colors
Richard M. Stallman <rms@gnu.org>
parents: 13628
diff changeset
159 ;
9571
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
160 ;; From lisp/select.el
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
161 (defun x-get-selection (&rest rest) "")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
162 (fset 'x-set-selection 'ignore)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
163
13628
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
164 ;; From lisp/faces.el: we only have one font, so always return
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
165 ;; it, no matter which variety they've asked for.
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
166 (defun x-frob-font-slant (font which)
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
167 font)
6da84b713ae7 (msdos-color-aliases): Add more aliases.
Richard M. Stallman <rms@gnu.org>
parents: 13484
diff changeset
168
9571
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
169 ;; From lisp/frame.el
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
170 (fset 'set-default-font 'ignore)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
171 (fset 'set-mouse-color 'ignore) ; We cannot, I think.
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
172 (fset 'set-cursor-color 'ignore) ; Hardware determined by char under.
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
173 (fset 'set-border-color 'ignore) ; Not useful.
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
174 (fset 'auto-raise-mode 'ignore)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
175 (fset 'auto-lower-mode 'ignore)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
176 (defun set-background-color (color-name)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
177 "Set the background color of the selected frame to COLOR.
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
178 When called interactively, prompt for the name of the color to use."
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
179 (interactive "sColor: ")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
180 (modify-frame-parameters (selected-frame)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
181 (list (cons 'background-color color-name))))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
182 (defun set-foreground-color (color-name)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
183 "Set the foreground color of the selected frame to COLOR.
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
184 When called interactively, prompt for the name of the color to use."
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
185 (interactive "sColor: ")
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
186 (modify-frame-parameters (selected-frame)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
187 (list (cons 'foreground-color color-name))))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
188 ;; ---------------------------------------------------------------------------
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
189 ;; Handle the X-like command line parameters "-fg" and "-bg"
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
190 (defun msdos-handle-args (args)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
191 (let ((rest nil))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
192 (while args
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
193 (let ((this (car args)))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
194 (setq args (cdr args))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
195 (cond ((or (string= this "-fg") (string= this "-foreground"))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
196 (if args
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
197 (setq default-frame-alist
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
198 (cons (cons 'foreground-color (car args))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
199 default-frame-alist)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
200 args (cdr args))))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
201 ((or (string= this "-bg") (string= this "-background"))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
202 (if args
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
203 (setq default-frame-alist
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
204 (cons (cons 'background-color (car args))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
205 default-frame-alist)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
206 args (cdr args))))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
207 (t (setq rest (cons this rest))))))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
208 (nreverse rest)))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
209
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
210 (setq command-line-args (msdos-handle-args command-line-args))
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
211 ;; ---------------------------------------------------------------------------
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
212 (require 'faces)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
213 (if (msdos-mouse-p)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
214 (progn
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
215 (require 'menu-bar)
b37425ecb3f0 Initial revision
Morten Welinder <terra@diku.dk>
parents:
diff changeset
216 (menu-bar-mode t)))