| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
(load "term/internal" nil t) |
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
(defvar msdos-color-values |
|---|
| 47 |
'(("black" 0 0 0 0) |
|---|
| 48 |
("blue" 1 0 0 52480) |
|---|
| 49 |
("green" 2 8704 35584 8704) |
|---|
| 50 |
("cyan" 3 0 52736 53504) |
|---|
| 51 |
("red" 4 45568 8704 8704) |
|---|
| 52 |
("magenta" 5 35584 0 35584) |
|---|
| 53 |
("brown" 6 40960 20992 11520) |
|---|
| 54 |
("lightgray" 7 48640 48640 48640) |
|---|
| 55 |
("darkgray" 8 26112 26112 26112) |
|---|
| 56 |
("lightblue" 9 0 0 65535) |
|---|
| 57 |
("lightgreen" 10 0 65535 0) |
|---|
| 58 |
("lightcyan" 11 0 65535 65535) |
|---|
| 59 |
("lightred" 12 65535 0 0) |
|---|
| 60 |
("lightmagenta" 13 65535 0 65535) |
|---|
| 61 |
("yellow" 14 65535 65535 0) |
|---|
| 62 |
("white" 15 65535 65535 65535)) |
|---|
| 63 |
"A list of MS-DOS console colors, their indices and 16-bit RGB values.") |
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
(defvar default-frame-alist nil) |
|---|
| 68 |
(modify-frame-parameters terminal-frame default-frame-alist) |
|---|
| 69 |
(tty-color-clear) |
|---|
| 70 |
|
|---|
| 71 |
(defun msdos-face-setup () |
|---|
| 72 |
(set-face-foreground 'bold "yellow" terminal-frame) |
|---|
| 73 |
(set-face-foreground 'italic "red" terminal-frame) |
|---|
| 74 |
(set-face-foreground 'bold-italic "lightred" terminal-frame) |
|---|
| 75 |
(set-face-foreground 'underline "white" terminal-frame) |
|---|
| 76 |
|
|---|
| 77 |
(make-face 'msdos-menu-active-face) |
|---|
| 78 |
(make-face 'msdos-menu-passive-face) |
|---|
| 79 |
(make-face 'msdos-menu-select-face) |
|---|
| 80 |
(set-face-foreground 'msdos-menu-active-face "white" terminal-frame) |
|---|
| 81 |
(set-face-foreground 'msdos-menu-passive-face "lightgray" terminal-frame) |
|---|
| 82 |
(set-face-background 'msdos-menu-active-face "blue" terminal-frame) |
|---|
| 83 |
(set-face-background 'msdos-menu-passive-face "blue" terminal-frame) |
|---|
| 84 |
(set-face-background 'msdos-menu-select-face "red" terminal-frame)) |
|---|
| 85 |
|
|---|
| 86 |
(add-hook 'before-init-hook 'msdos-face-setup) |
|---|
| 87 |
|
|---|
| 88 |
(defun msdos-handle-reverse-video (frame parameters) |
|---|
| 89 |
"Handle the reverse-video frame parameter on MS-DOS frames." |
|---|
| 90 |
(when (cdr (or (assq 'reverse parameters) |
|---|
| 91 |
(assq 'reverse default-frame-alist))) |
|---|
| 92 |
(let* ((params (frame-parameters frame)) |
|---|
| 93 |
(fg (cdr (assq 'foreground-color params))) |
|---|
| 94 |
(bg (cdr (assq 'background-color params)))) |
|---|
| 95 |
(if (equal fg (cdr (assq 'mouse-color params))) |
|---|
| 96 |
(modify-frame-parameters frame |
|---|
| 97 |
(list (cons 'mouse-color bg)))) |
|---|
| 98 |
(if (equal fg (cdr (assq 'cursor-color params))) |
|---|
| 99 |
(modify-frame-parameters frame |
|---|
| 100 |
(list (cons 'cursor-color bg))))))) |
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
(defun msdos-setup-initial-frame () |
|---|
| 107 |
(modify-frame-parameters terminal-frame default-frame-alist) |
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
(msdos-remember-default-colors terminal-frame) |
|---|
| 111 |
(modify-frame-parameters terminal-frame initial-frame-alist) |
|---|
| 112 |
(msdos-handle-reverse-video terminal-frame |
|---|
| 113 |
(frame-parameters terminal-frame)) |
|---|
| 114 |
|
|---|
| 115 |
(frame-set-background-mode terminal-frame) |
|---|
| 116 |
(face-set-after-frame-default terminal-frame)) |
|---|
| 117 |
|
|---|
| 118 |
(add-hook 'term-setup-hook 'msdos-setup-initial-frame) |
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
(defun make-msdos-frame (&optional parameters) |
|---|
| 122 |
(let ((frame (make-terminal-frame parameters)) |
|---|
| 123 |
success) |
|---|
| 124 |
(unwind-protect |
|---|
| 125 |
(progn |
|---|
| 126 |
(msdos-handle-reverse-video frame (frame-parameters frame)) |
|---|
| 127 |
(frame-set-background-mode frame) |
|---|
| 128 |
(face-set-after-frame-default frame) |
|---|
| 129 |
(setq success t)) |
|---|
| 130 |
(unless success (delete-frame frame))) |
|---|
| 131 |
frame)) |
|---|
| 132 |
|
|---|
| 133 |
(setq frame-creation-function 'make-msdos-frame) |
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
(defun x-list-fonts (pattern &optional face frame maximum width) |
|---|
| 143 |
(if (or (null width) (and (numberp width) (= width 1))) |
|---|
| 144 |
(list "ms-dos") |
|---|
| 145 |
(list "no-such-font"))) |
|---|
| 146 |
(defun x-display-pixel-width (&optional frame) (frame-width frame)) |
|---|
| 147 |
(defun x-display-pixel-height (&optional frame) (frame-height frame)) |
|---|
| 148 |
(defun x-display-planes (&optional frame) 4) |
|---|
| 149 |
(defun x-display-color-cells (&optional frame) 16) |
|---|
| 150 |
(defun x-server-max-request-size (&optional frame) 1000000) |
|---|
| 151 |
(defun x-server-vendor (&optional frame) t "GNU") |
|---|
| 152 |
(defun x-server-version (&optional frame) '(1 0 0)) |
|---|
| 153 |
(defun x-display-screens (&optional frame) 1) |
|---|
| 154 |
(defun x-display-mm-height (&optional frame) 245) |
|---|
| 155 |
(defun x-display-mm-width (&optional frame) 322) |
|---|
| 156 |
(defun x-display-backing-store (&optional frame) 'not-useful) |
|---|
| 157 |
(defun x-display-visual-class (&optional frame) 'static-color) |
|---|
| 158 |
(fset 'x-display-save-under 'ignore) |
|---|
| 159 |
(fset 'x-get-resource 'ignore) |
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
(defvar x-display-name "pc" |
|---|
| 163 |
"The display name specifying the MS-DOS display and frame type.") |
|---|
| 164 |
(setq split-window-keep-point t) |
|---|
| 165 |
(defvar x-colors (mapcar 'car msdos-color-values) |
|---|
| 166 |
"The list of colors available on a PC display under MS-DOS.") |
|---|
| 167 |
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
(defvar x-last-selected-text nil) |
|---|
| 176 |
|
|---|
| 177 |
(defcustom x-select-enable-clipboard t |
|---|
| 178 |
"Non-nil means cutting and pasting uses the clipboard. |
|---|
| 179 |
This is the default on this system, since MS-Windows does not |
|---|
| 180 |
support other types of selections." |
|---|
| 181 |
:type 'boolean |
|---|
| 182 |
:group 'killing) |
|---|
| 183 |
|
|---|
| 184 |
(defun x-select-text (text &optional push) |
|---|
| 185 |
(if x-select-enable-clipboard |
|---|
| 186 |
(w16-set-clipboard-data text)) |
|---|
| 187 |
(setq x-last-selected-text text)) |
|---|
| 188 |
|
|---|
| 189 |
|
|---|
| 190 |
|
|---|
| 191 |
|
|---|
| 192 |
(defun x-get-selection-value () |
|---|
| 193 |
(if x-select-enable-clipboard |
|---|
| 194 |
(let (text) |
|---|
| 195 |
|
|---|
| 196 |
(condition-case c |
|---|
| 197 |
(setq text (w16-get-clipboard-data)) |
|---|
| 198 |
(error (message "w16-get-clipboard-data:%s" c))) |
|---|
| 199 |
(if (string= text "") (setq text nil)) |
|---|
| 200 |
(cond |
|---|
| 201 |
((not text) nil) |
|---|
| 202 |
((eq text x-last-selected-text) nil) |
|---|
| 203 |
((string= text x-last-selected-text) |
|---|
| 204 |
|
|---|
| 205 |
(setq x-last-selected-text text) |
|---|
| 206 |
nil) |
|---|
| 207 |
(t |
|---|
| 208 |
(setq x-last-selected-text text)))))) |
|---|
| 209 |
|
|---|
| 210 |
|
|---|
| 211 |
(setq interprogram-cut-function 'x-select-text) |
|---|
| 212 |
(setq interprogram-paste-function 'x-get-selection-value) |
|---|
| 213 |
|
|---|
| 214 |
|
|---|
| 215 |
|
|---|
| 216 |
(defun x-frob-font-slant (font which) |
|---|
| 217 |
font) |
|---|
| 218 |
(make-obsolete 'x-frob-font-slant 'make-face-... "21.1") |
|---|
| 219 |
(defun x-frob-font-weight (font which) |
|---|
| 220 |
font) |
|---|
| 221 |
(make-obsolete 'x-frob-font-weight 'make-face-... "21.1") |
|---|
| 222 |
(defun x-font-family-list () |
|---|
| 223 |
"Return a list of available font families on FRAME.\n\ |
|---|
| 224 |
If FRAME is omitted or nil, use the selected frame.\n\ |
|---|
| 225 |
Value is a list of conses (FAMILY . FIXED-P) where FAMILY\n\ |
|---|
| 226 |
is a font family, and FIXED-P is non-nil if fonts of that family\n\ |
|---|
| 227 |
are fixed-pitch." |
|---|
| 228 |
'(("default" . t))) |
|---|
| 229 |
|
|---|
| 230 |
|
|---|
| 231 |
(fset 'query-fontset 'ignore) |
|---|
| 232 |
|
|---|
| 233 |
|
|---|
| 234 |
(fset 'iconify-or-deiconify-frame 'ignore) |
|---|
| 235 |
|
|---|
| 236 |
|
|---|
| 237 |
(fset 'set-default-font 'ignore) |
|---|
| 238 |
(fset 'set-mouse-color 'ignore) |
|---|
| 239 |
(fset 'set-cursor-color 'ignore) |
|---|
| 240 |
(fset 'set-border-color 'ignore) |
|---|
| 241 |
|
|---|
| 242 |
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 |
|
|---|
| 246 |
|
|---|