]> code.delx.au - gnu-emacs/blob - lisp/term/w32-win.el
(locate): Remove dot at the end of error argument.
[gnu-emacs] / lisp / term / w32-win.el
1 ;;; w32-win.el --- parse switches controlling interface with W32 window system
2
3 ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
4
5 ;; Author: Kevin Gallo
6 ;; Keywords: terminals
7
8 ;; This file is part of GNU Emacs.
9
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Commentary:
26
27 ;; w32-win.el: this file is loaded from ../lisp/startup.el when it recognizes
28 ;; that W32 windows are to be used. Command line switches are parsed and those
29 ;; pertaining to W32 are processed and removed from the command line. The
30 ;; W32 display is opened and hooks are set for popping up the initial window.
31
32 ;; startup.el will then examine startup files, and eventually call the hooks
33 ;; which create the first window (s).
34
35 ;;; Code:
36 \f
37
38 ;; These are the standard X switches from the Xt Initialize.c file of
39 ;; Release 4.
40
41 ;; Command line Resource Manager string
42
43 ;; +rv *reverseVideo
44 ;; +synchronous *synchronous
45 ;; -background *background
46 ;; -bd *borderColor
47 ;; -bg *background
48 ;; -bordercolor *borderColor
49 ;; -borderwidth .borderWidth
50 ;; -bw .borderWidth
51 ;; -display .display
52 ;; -fg *foreground
53 ;; -fn *font
54 ;; -font *font
55 ;; -foreground *foreground
56 ;; -geometry .geometry
57 ;; -i .iconType
58 ;; -itype .iconType
59 ;; -iconic .iconic
60 ;; -name .name
61 ;; -reverse *reverseVideo
62 ;; -rv *reverseVideo
63 ;; -selectionTimeout .selectionTimeout
64 ;; -synchronous *synchronous
65 ;; -xrm
66
67 ;; An alist of X options and the function which handles them. See
68 ;; ../startup.el.
69
70 (if (not (eq window-system 'w32))
71 (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name)))
72
73 (require 'frame)
74 (require 'mouse)
75 (require 'scroll-bar)
76 (require 'faces)
77 (require 'select)
78 (require 'menu-bar)
79 (if (fboundp 'new-fontset)
80 (require 'fontset))
81
82 ;; Because Windows scrollbars look and act quite differently compared
83 ;; with the standard X scroll-bars, we don't try to use the normal
84 ;; scroll bar routines.
85
86 (defun w32-handle-scroll-bar-event (event)
87 "Handle W32 scroll bar EVENT to do normal Window style scrolling."
88 (interactive "e")
89 (let ((old-window (selected-window)))
90 (unwind-protect
91 (let* ((position (event-start event))
92 (window (nth 0 position))
93 (portion-whole (nth 2 position))
94 (bar-part (nth 4 position)))
95 (save-excursion
96 (select-window window)
97 (cond
98 ((eq bar-part 'up)
99 (goto-char (window-start window))
100 (scroll-down 1))
101 ((eq bar-part 'above-handle)
102 (scroll-down))
103 ((eq bar-part 'handle)
104 (scroll-bar-maybe-set-window-start event))
105 ((eq bar-part 'below-handle)
106 (scroll-up))
107 ((eq bar-part 'down)
108 (goto-char (window-start window))
109 (scroll-up 1))
110 )))
111 (select-window old-window))))
112
113 ;; The following definition is used for debugging.
114 ;(defun w32-handle-scroll-bar-event (event) (interactive "e") (princ event))
115
116 (global-set-key [vertical-scroll-bar mouse-1] 'w32-handle-scroll-bar-event)
117
118 ;; (scroll-bar-mode nil)
119
120 (defvar mouse-wheel-scroll-amount 4
121 "*Number of lines to scroll per click of the mouse wheel.")
122
123 (defun mouse-wheel-scroll-line (event)
124 "Scroll the window in which EVENT occurred by `mouse-wheel-scroll-amount'."
125 (interactive "e")
126 (condition-case nil
127 (if (< (car (cdr (cdr event))) 0)
128 (scroll-up mouse-wheel-scroll-amount)
129 (scroll-down mouse-wheel-scroll-amount))
130 (error nil)))
131
132 ;; for scroll-in-place.el, this way the -scroll-line and -scroll-screen
133 ;; commands won't interact
134 (setq scroll-command-groups (list '(mouse-wheel-scroll-line)))
135
136 (defun mouse-wheel-scroll-screen (event)
137 "Scroll the window in which EVENT occurred by `mouse-wheel-scroll-amount'."
138 (interactive "e")
139 (condition-case nil
140 (if (< (car (cdr (cdr event))) 0)
141 (scroll-up)
142 (scroll-down))
143 (error nil)))
144
145 ;; Bind the mouse-wheel event:
146 (global-set-key [mouse-wheel] 'mouse-wheel-scroll-line)
147 (global-set-key [C-mouse-wheel] 'mouse-wheel-scroll-screen)
148
149 (defun w32-drag-n-drop-debug (event)
150 "Print the drag-n-drop EVENT in a readable form."
151 (interactive "e")
152 (princ event))
153
154 (defun w32-drag-n-drop (event)
155 "Edit the files listed in the drag-n-drop EVENT.
156 Switch to a buffer editing the last file dropped."
157 (interactive "e")
158 (save-excursion
159 ;; Make sure the drop target has positive co-ords
160 ;; before setting the selected frame - otherwise it
161 ;; won't work. <skx@tardis.ed.ac.uk>
162 (let* ((window (posn-window (event-start event)))
163 (coords (posn-x-y (event-start event)))
164 (x (car coords))
165 (y (cdr coords)))
166 (if (and (> x 0) (> y 0))
167 (set-frame-selected-window nil window))
168 (mapcar 'find-file (car (cdr (cdr event)))))
169 (raise-frame)))
170
171 (defun w32-drag-n-drop-other-frame (event)
172 "Edit the files listed in the drag-n-drop EVENT, in other frames.
173 May create new frames, or reuse existing ones. The frame editing
174 the last file dropped is selected."
175 (interactive "e")
176 (mapcar 'find-file-other-frame (car (cdr (cdr event)))))
177
178 ;; Bind the drag-n-drop event.
179 (global-set-key [drag-n-drop] 'w32-drag-n-drop)
180 (global-set-key [C-drag-n-drop] 'w32-drag-n-drop-other-frame)
181
182 ;; Keyboard layout/language change events
183 ;; For now ignore language-change events; in the future
184 ;; we should switch the Emacs Input Method to match the
185 ;; new layout/language selected by the user.
186 (global-set-key [language-change] 'ignore)
187
188 (defvar x-invocation-args)
189
190 (defvar x-command-line-resources nil)
191
192 (defconst x-option-alist
193 '(("-bw" . x-handle-numeric-switch)
194 ("-d" . x-handle-display)
195 ("-display" . x-handle-display)
196 ("-name" . x-handle-name-rn-switch)
197 ("-rn" . x-handle-name-rn-switch)
198 ("-T" . x-handle-switch)
199 ("-r" . x-handle-switch)
200 ("-rv" . x-handle-switch)
201 ("-reverse" . x-handle-switch)
202 ("-fn" . x-handle-switch)
203 ("-font" . x-handle-switch)
204 ("-ib" . x-handle-numeric-switch)
205 ("-g" . x-handle-geometry)
206 ("-geometry" . x-handle-geometry)
207 ("-fg" . x-handle-switch)
208 ("-foreground". x-handle-switch)
209 ("-bg" . x-handle-switch)
210 ("-background". x-handle-switch)
211 ("-ms" . x-handle-switch)
212 ("-itype" . x-handle-switch)
213 ("-i" . x-handle-switch)
214 ("-iconic" . x-handle-iconic)
215 ("-xrm" . x-handle-xrm-switch)
216 ("-cr" . x-handle-switch)
217 ("-vb" . x-handle-switch)
218 ("-hb" . x-handle-switch)
219 ("-bd" . x-handle-switch)))
220
221 (defconst x-long-option-alist
222 '(("--border-width" . "-bw")
223 ("--display" . "-d")
224 ("--name" . "-name")
225 ("--title" . "-T")
226 ("--reverse-video" . "-reverse")
227 ("--font" . "-font")
228 ("--internal-border" . "-ib")
229 ("--geometry" . "-geometry")
230 ("--foreground-color" . "-fg")
231 ("--background-color" . "-bg")
232 ("--mouse-color" . "-ms")
233 ("--icon-type" . "-itype")
234 ("--iconic" . "-iconic")
235 ("--xrm" . "-xrm")
236 ("--cursor-color" . "-cr")
237 ("--vertical-scroll-bars" . "-vb")
238 ("--border-color" . "-bd")))
239
240 (defconst x-switch-definitions
241 '(("-name" name)
242 ("-T" name)
243 ("-r" reverse t)
244 ("-rv" reverse t)
245 ("-reverse" reverse t)
246 ("-fn" font)
247 ("-font" font)
248 ("-ib" internal-border-width)
249 ("-fg" foreground-color)
250 ("-foreground" foreground-color)
251 ("-bg" background-color)
252 ("-background" background-color)
253 ("-ms" mouse-color)
254 ("-cr" cursor-color)
255 ("-itype" icon-type t)
256 ("-i" icon-type t)
257 ("-vb" vertical-scroll-bars t)
258 ("-hb" horizontal-scroll-bars t)
259 ("-bd" border-color)
260 ("-bw" border-width)))
261
262
263 (defun x-handle-switch (switch)
264 "Handle SWITCH of the form \"-switch value\" or \"-switch\"."
265 (let ((aelt (assoc switch x-switch-definitions)))
266 (if aelt
267 (if (nth 2 aelt)
268 (setq default-frame-alist
269 (cons (cons (nth 1 aelt) (nth 2 aelt))
270 default-frame-alist))
271 (setq default-frame-alist
272 (cons (cons (nth 1 aelt)
273 (car x-invocation-args))
274 default-frame-alist)
275 x-invocation-args (cdr x-invocation-args))))))
276
277 (defun x-handle-iconic (switch)
278 "Make \"-iconic\" SWITCH apply only to the initial frame."
279 (setq initial-frame-alist
280 (cons '(visibility . icon) initial-frame-alist)))
281
282
283 (defun x-handle-numeric-switch (switch)
284 "Handle SWITCH of the form \"-switch n\"."
285 (let ((aelt (assoc switch x-switch-definitions)))
286 (if aelt
287 (setq default-frame-alist
288 (cons (cons (nth 1 aelt)
289 (string-to-int (car x-invocation-args)))
290 default-frame-alist)
291 x-invocation-args
292 (cdr x-invocation-args)))))
293
294 (defun x-handle-xrm-switch (switch)
295 "Handle the \"-xrm\" SWITCH."
296 (or (consp x-invocation-args)
297 (error "%s: missing argument to `%s' option" (invocation-name) switch))
298 (setq x-command-line-resources (car x-invocation-args))
299 (setq x-invocation-args (cdr x-invocation-args)))
300
301 (defun x-handle-geometry (switch)
302 "Handle the \"-geometry\" SWITCH."
303 (let* ((geo (x-parse-geometry (car x-invocation-args)))
304 (left (assq 'left geo))
305 (top (assq 'top geo))
306 (height (assq 'height geo))
307 (width (assq 'width geo)))
308 (if (or height width)
309 (setq default-frame-alist
310 (append default-frame-alist
311 '((user-size . t))
312 (if height (list height))
313 (if width (list width)))))
314 (if (or left top)
315 (setq initial-frame-alist
316 (append initial-frame-alist
317 '((user-position . t))
318 (if left (list left))
319 (if top (list top)))))
320 (setq x-invocation-args (cdr x-invocation-args))))
321
322 (defun x-handle-name-rn-switch (switch)
323 "Handle a \"-name\" or \"-rn\" SWITCH."
324 ;; Handle the -name and -rn options. Set the variable x-resource-name
325 ;; to the option's operand; if the switch was `-name', set the name of
326 ;; the initial frame, too.
327 (or (consp x-invocation-args)
328 (error "%s: missing argument to `%s' option" (invocation-name) switch))
329 (setq x-resource-name (car x-invocation-args)
330 x-invocation-args (cdr x-invocation-args))
331 (if (string= switch "-name")
332 (setq initial-frame-alist (cons (cons 'name x-resource-name)
333 initial-frame-alist))))
334
335 (defvar x-display-name nil
336 "The display name specifying server and frame.")
337
338 (defun x-handle-display (switch)
339 "Handle the \"-display\" SWITCH."
340 (setq x-display-name (car x-invocation-args)
341 x-invocation-args (cdr x-invocation-args)))
342
343 (defvar x-invocation-args nil)
344
345 (defun x-handle-args (args)
346 "Process the X-related command line options in ARGS.
347 This is done before the user's startup file is loaded. They are copied to
348 x-invocation args from which the X-related things are extracted, first
349 the switch (e.g., \"-fg\") in the following code, and possible values
350 \(e.g., \"black\") in the option handler code (e.g., x-handle-switch).
351 This returns ARGS with the arguments that have been processed removed."
352 (setq x-invocation-args args
353 args nil)
354 (while x-invocation-args
355 (let* ((this-switch (car x-invocation-args))
356 (orig-this-switch this-switch)
357 completion argval aelt)
358 (setq x-invocation-args (cdr x-invocation-args))
359 ;; Check for long options with attached arguments
360 ;; and separate out the attached option argument into argval.
361 (if (string-match "^--[^=]*=" this-switch)
362 (setq argval (substring this-switch (match-end 0))
363 this-switch (substring this-switch 0 (1- (match-end 0)))))
364 (setq completion (try-completion this-switch x-long-option-alist))
365 (if (eq completion t)
366 ;; Exact match for long option.
367 (setq this-switch (cdr (assoc this-switch x-long-option-alist)))
368 (if (stringp completion)
369 (let ((elt (assoc completion x-long-option-alist)))
370 ;; Check for abbreviated long option.
371 (or elt
372 (error "Option `%s' is ambiguous" this-switch))
373 (setq this-switch (cdr elt)))
374 ;; Check for a short option.
375 (setq argval nil this-switch orig-this-switch)))
376 (setq aelt (assoc this-switch x-option-alist))
377 (if aelt
378 (if argval
379 (let ((x-invocation-args
380 (cons argval x-invocation-args)))
381 (funcall (cdr aelt) this-switch))
382 (funcall (cdr aelt) this-switch))
383 (setq args (cons this-switch args)))))
384 (setq args (nreverse args)))
385
386
387 \f
388 ;;
389 ;; Available colors
390 ;;
391
392 (defvar x-colors '("LightGreen"
393 "light green"
394 "DarkRed"
395 "dark red"
396 "DarkMagenta"
397 "dark magenta"
398 "DarkCyan"
399 "dark cyan"
400 "DarkBlue"
401 "dark blue"
402 "DarkGray"
403 "dark gray"
404 "DarkGrey"
405 "dark grey"
406 "grey100"
407 "gray100"
408 "grey99"
409 "gray99"
410 "grey98"
411 "gray98"
412 "grey97"
413 "gray97"
414 "grey96"
415 "gray96"
416 "grey95"
417 "gray95"
418 "grey94"
419 "gray94"
420 "grey93"
421 "gray93"
422 "grey92"
423 "gray92"
424 "grey91"
425 "gray91"
426 "grey90"
427 "gray90"
428 "grey89"
429 "gray89"
430 "grey88"
431 "gray88"
432 "grey87"
433 "gray87"
434 "grey86"
435 "gray86"
436 "grey85"
437 "gray85"
438 "grey84"
439 "gray84"
440 "grey83"
441 "gray83"
442 "grey82"
443 "gray82"
444 "grey81"
445 "gray81"
446 "grey80"
447 "gray80"
448 "grey79"
449 "gray79"
450 "grey78"
451 "gray78"
452 "grey77"
453 "gray77"
454 "grey76"
455 "gray76"
456 "grey75"
457 "gray75"
458 "grey74"
459 "gray74"
460 "grey73"
461 "gray73"
462 "grey72"
463 "gray72"
464 "grey71"
465 "gray71"
466 "grey70"
467 "gray70"
468 "grey69"
469 "gray69"
470 "grey68"
471 "gray68"
472 "grey67"
473 "gray67"
474 "grey66"
475 "gray66"
476 "grey65"
477 "gray65"
478 "grey64"
479 "gray64"
480 "grey63"
481 "gray63"
482 "grey62"
483 "gray62"
484 "grey61"
485 "gray61"
486 "grey60"
487 "gray60"
488 "grey59"
489 "gray59"
490 "grey58"
491 "gray58"
492 "grey57"
493 "gray57"
494 "grey56"
495 "gray56"
496 "grey55"
497 "gray55"
498 "grey54"
499 "gray54"
500 "grey53"
501 "gray53"
502 "grey52"
503 "gray52"
504 "grey51"
505 "gray51"
506 "grey50"
507 "gray50"
508 "grey49"
509 "gray49"
510 "grey48"
511 "gray48"
512 "grey47"
513 "gray47"
514 "grey46"
515 "gray46"
516 "grey45"
517 "gray45"
518 "grey44"
519 "gray44"
520 "grey43"
521 "gray43"
522 "grey42"
523 "gray42"
524 "grey41"
525 "gray41"
526 "grey40"
527 "gray40"
528 "grey39"
529 "gray39"
530 "grey38"
531 "gray38"
532 "grey37"
533 "gray37"
534 "grey36"
535 "gray36"
536 "grey35"
537 "gray35"
538 "grey34"
539 "gray34"
540 "grey33"
541 "gray33"
542 "grey32"
543 "gray32"
544 "grey31"
545 "gray31"
546 "grey30"
547 "gray30"
548 "grey29"
549 "gray29"
550 "grey28"
551 "gray28"
552 "grey27"
553 "gray27"
554 "grey26"
555 "gray26"
556 "grey25"
557 "gray25"
558 "grey24"
559 "gray24"
560 "grey23"
561 "gray23"
562 "grey22"
563 "gray22"
564 "grey21"
565 "gray21"
566 "grey20"
567 "gray20"
568 "grey19"
569 "gray19"
570 "grey18"
571 "gray18"
572 "grey17"
573 "gray17"
574 "grey16"
575 "gray16"
576 "grey15"
577 "gray15"
578 "grey14"
579 "gray14"
580 "grey13"
581 "gray13"
582 "grey12"
583 "gray12"
584 "grey11"
585 "gray11"
586 "grey10"
587 "gray10"
588 "grey9"
589 "gray9"
590 "grey8"
591 "gray8"
592 "grey7"
593 "gray7"
594 "grey6"
595 "gray6"
596 "grey5"
597 "gray5"
598 "grey4"
599 "gray4"
600 "grey3"
601 "gray3"
602 "grey2"
603 "gray2"
604 "grey1"
605 "gray1"
606 "grey0"
607 "gray0"
608 "thistle4"
609 "thistle3"
610 "thistle2"
611 "thistle1"
612 "MediumPurple4"
613 "MediumPurple3"
614 "MediumPurple2"
615 "MediumPurple1"
616 "purple4"
617 "purple3"
618 "purple2"
619 "purple1"
620 "DarkOrchid4"
621 "DarkOrchid3"
622 "DarkOrchid2"
623 "DarkOrchid1"
624 "MediumOrchid4"
625 "MediumOrchid3"
626 "MediumOrchid2"
627 "MediumOrchid1"
628 "plum4"
629 "plum3"
630 "plum2"
631 "plum1"
632 "orchid4"
633 "orchid3"
634 "orchid2"
635 "orchid1"
636 "magenta4"
637 "magenta3"
638 "magenta2"
639 "magenta1"
640 "VioletRed4"
641 "VioletRed3"
642 "VioletRed2"
643 "VioletRed1"
644 "maroon4"
645 "maroon3"
646 "maroon2"
647 "maroon1"
648 "PaleVioletRed4"
649 "PaleVioletRed3"
650 "PaleVioletRed2"
651 "PaleVioletRed1"
652 "LightPink4"
653 "LightPink3"
654 "LightPink2"
655 "LightPink1"
656 "pink4"
657 "pink3"
658 "pink2"
659 "pink1"
660 "HotPink4"
661 "HotPink3"
662 "HotPink2"
663 "HotPink1"
664 "DeepPink4"
665 "DeepPink3"
666 "DeepPink2"
667 "DeepPink1"
668 "red4"
669 "red3"
670 "red2"
671 "red1"
672 "OrangeRed4"
673 "OrangeRed3"
674 "OrangeRed2"
675 "OrangeRed1"
676 "tomato4"
677 "tomato3"
678 "tomato2"
679 "tomato1"
680 "coral4"
681 "coral3"
682 "coral2"
683 "coral1"
684 "DarkOrange4"
685 "DarkOrange3"
686 "DarkOrange2"
687 "DarkOrange1"
688 "orange4"
689 "orange3"
690 "orange2"
691 "orange1"
692 "LightSalmon4"
693 "LightSalmon3"
694 "LightSalmon2"
695 "LightSalmon1"
696 "salmon4"
697 "salmon3"
698 "salmon2"
699 "salmon1"
700 "brown4"
701 "brown3"
702 "brown2"
703 "brown1"
704 "firebrick4"
705 "firebrick3"
706 "firebrick2"
707 "firebrick1"
708 "chocolate4"
709 "chocolate3"
710 "chocolate2"
711 "chocolate1"
712 "tan4"
713 "tan3"
714 "tan2"
715 "tan1"
716 "wheat4"
717 "wheat3"
718 "wheat2"
719 "wheat1"
720 "burlywood4"
721 "burlywood3"
722 "burlywood2"
723 "burlywood1"
724 "sienna4"
725 "sienna3"
726 "sienna2"
727 "sienna1"
728 "IndianRed4"
729 "IndianRed3"
730 "IndianRed2"
731 "IndianRed1"
732 "RosyBrown4"
733 "RosyBrown3"
734 "RosyBrown2"
735 "RosyBrown1"
736 "DarkGoldenrod4"
737 "DarkGoldenrod3"
738 "DarkGoldenrod2"
739 "DarkGoldenrod1"
740 "goldenrod4"
741 "goldenrod3"
742 "goldenrod2"
743 "goldenrod1"
744 "gold4"
745 "gold3"
746 "gold2"
747 "gold1"
748 "yellow4"
749 "yellow3"
750 "yellow2"
751 "yellow1"
752 "LightYellow4"
753 "LightYellow3"
754 "LightYellow2"
755 "LightYellow1"
756 "LightGoldenrod4"
757 "LightGoldenrod3"
758 "LightGoldenrod2"
759 "LightGoldenrod1"
760 "khaki4"
761 "khaki3"
762 "khaki2"
763 "khaki1"
764 "DarkOliveGreen4"
765 "DarkOliveGreen3"
766 "DarkOliveGreen2"
767 "DarkOliveGreen1"
768 "OliveDrab4"
769 "OliveDrab3"
770 "OliveDrab2"
771 "OliveDrab1"
772 "chartreuse4"
773 "chartreuse3"
774 "chartreuse2"
775 "chartreuse1"
776 "green4"
777 "green3"
778 "green2"
779 "green1"
780 "SpringGreen4"
781 "SpringGreen3"
782 "SpringGreen2"
783 "SpringGreen1"
784 "PaleGreen4"
785 "PaleGreen3"
786 "PaleGreen2"
787 "PaleGreen1"
788 "SeaGreen4"
789 "SeaGreen3"
790 "SeaGreen2"
791 "SeaGreen1"
792 "DarkSeaGreen4"
793 "DarkSeaGreen3"
794 "DarkSeaGreen2"
795 "DarkSeaGreen1"
796 "aquamarine4"
797 "aquamarine3"
798 "aquamarine2"
799 "aquamarine1"
800 "DarkSlateGray4"
801 "DarkSlateGray3"
802 "DarkSlateGray2"
803 "DarkSlateGray1"
804 "cyan4"
805 "cyan3"
806 "cyan2"
807 "cyan1"
808 "turquoise4"
809 "turquoise3"
810 "turquoise2"
811 "turquoise1"
812 "CadetBlue4"
813 "CadetBlue3"
814 "CadetBlue2"
815 "CadetBlue1"
816 "PaleTurquoise4"
817 "PaleTurquoise3"
818 "PaleTurquoise2"
819 "PaleTurquoise1"
820 "LightCyan4"
821 "LightCyan3"
822 "LightCyan2"
823 "LightCyan1"
824 "LightBlue4"
825 "LightBlue3"
826 "LightBlue2"
827 "LightBlue1"
828 "LightSteelBlue4"
829 "LightSteelBlue3"
830 "LightSteelBlue2"
831 "LightSteelBlue1"
832 "SlateGray4"
833 "SlateGray3"
834 "SlateGray2"
835 "SlateGray1"
836 "LightSkyBlue4"
837 "LightSkyBlue3"
838 "LightSkyBlue2"
839 "LightSkyBlue1"
840 "SkyBlue4"
841 "SkyBlue3"
842 "SkyBlue2"
843 "SkyBlue1"
844 "DeepSkyBlue4"
845 "DeepSkyBlue3"
846 "DeepSkyBlue2"
847 "DeepSkyBlue1"
848 "SteelBlue4"
849 "SteelBlue3"
850 "SteelBlue2"
851 "SteelBlue1"
852 "DodgerBlue4"
853 "DodgerBlue3"
854 "DodgerBlue2"
855 "DodgerBlue1"
856 "blue4"
857 "blue3"
858 "blue2"
859 "blue1"
860 "RoyalBlue4"
861 "RoyalBlue3"
862 "RoyalBlue2"
863 "RoyalBlue1"
864 "SlateBlue4"
865 "SlateBlue3"
866 "SlateBlue2"
867 "SlateBlue1"
868 "azure4"
869 "azure3"
870 "azure2"
871 "azure1"
872 "MistyRose4"
873 "MistyRose3"
874 "MistyRose2"
875 "MistyRose1"
876 "LavenderBlush4"
877 "LavenderBlush3"
878 "LavenderBlush2"
879 "LavenderBlush1"
880 "honeydew4"
881 "honeydew3"
882 "honeydew2"
883 "honeydew1"
884 "ivory4"
885 "ivory3"
886 "ivory2"
887 "ivory1"
888 "cornsilk4"
889 "cornsilk3"
890 "cornsilk2"
891 "cornsilk1"
892 "LemonChiffon4"
893 "LemonChiffon3"
894 "LemonChiffon2"
895 "LemonChiffon1"
896 "NavajoWhite4"
897 "NavajoWhite3"
898 "NavajoWhite2"
899 "NavajoWhite1"
900 "PeachPuff4"
901 "PeachPuff3"
902 "PeachPuff2"
903 "PeachPuff1"
904 "bisque4"
905 "bisque3"
906 "bisque2"
907 "bisque1"
908 "AntiqueWhite4"
909 "AntiqueWhite3"
910 "AntiqueWhite2"
911 "AntiqueWhite1"
912 "seashell4"
913 "seashell3"
914 "seashell2"
915 "seashell1"
916 "snow4"
917 "snow3"
918 "snow2"
919 "snow1"
920 "thistle"
921 "MediumPurple"
922 "medium purple"
923 "purple"
924 "BlueViolet"
925 "blue violet"
926 "DarkViolet"
927 "dark violet"
928 "DarkOrchid"
929 "dark orchid"
930 "MediumOrchid"
931 "medium orchid"
932 "orchid"
933 "plum"
934 "violet"
935 "magenta"
936 "VioletRed"
937 "violet red"
938 "MediumVioletRed"
939 "medium violet red"
940 "maroon"
941 "PaleVioletRed"
942 "pale violet red"
943 "LightPink"
944 "light pink"
945 "pink"
946 "DeepPink"
947 "deep pink"
948 "HotPink"
949 "hot pink"
950 "red"
951 "OrangeRed"
952 "orange red"
953 "tomato"
954 "LightCoral"
955 "light coral"
956 "coral"
957 "DarkOrange"
958 "dark orange"
959 "orange"
960 "LightSalmon"
961 "light salmon"
962 "salmon"
963 "DarkSalmon"
964 "dark salmon"
965 "brown"
966 "firebrick"
967 "chocolate"
968 "tan"
969 "SandyBrown"
970 "sandy brown"
971 "wheat"
972 "beige"
973 "burlywood"
974 "peru"
975 "sienna"
976 "SaddleBrown"
977 "saddle brown"
978 "IndianRed"
979 "indian red"
980 "RosyBrown"
981 "rosy brown"
982 "DarkGoldenrod"
983 "dark goldenrod"
984 "goldenrod"
985 "LightGoldenrod"
986 "light goldenrod"
987 "gold"
988 "yellow"
989 "LightYellow"
990 "light yellow"
991 "LightGoldenrodYellow"
992 "light goldenrod yellow"
993 "PaleGoldenrod"
994 "pale goldenrod"
995 "khaki"
996 "DarkKhaki"
997 "dark khaki"
998 "OliveDrab"
999 "olive drab"
1000 "ForestGreen"
1001 "forest green"
1002 "YellowGreen"
1003 "yellow green"
1004 "LimeGreen"
1005 "lime green"
1006 "GreenYellow"
1007 "green yellow"
1008 "MediumSpringGreen"
1009 "medium spring green"
1010 "chartreuse"
1011 "green"
1012 "LawnGreen"
1013 "lawn green"
1014 "SpringGreen"
1015 "spring green"
1016 "PaleGreen"
1017 "pale green"
1018 "LightSeaGreen"
1019 "light sea green"
1020 "MediumSeaGreen"
1021 "medium sea green"
1022 "SeaGreen"
1023 "sea green"
1024 "DarkSeaGreen"
1025 "dark sea green"
1026 "DarkOliveGreen"
1027 "dark olive green"
1028 "DarkGreen"
1029 "dark green"
1030 "aquamarine"
1031 "MediumAquamarine"
1032 "medium aquamarine"
1033 "CadetBlue"
1034 "cadet blue"
1035 "LightCyan"
1036 "light cyan"
1037 "cyan"
1038 "turquoise"
1039 "MediumTurquoise"
1040 "medium turquoise"
1041 "DarkTurquoise"
1042 "dark turquoise"
1043 "PaleTurquoise"
1044 "pale turquoise"
1045 "PowderBlue"
1046 "powder blue"
1047 "LightBlue"
1048 "light blue"
1049 "LightSteelBlue"
1050 "light steel blue"
1051 "SteelBlue"
1052 "steel blue"
1053 "LightSkyBlue"
1054 "light sky blue"
1055 "SkyBlue"
1056 "sky blue"
1057 "DeepSkyBlue"
1058 "deep sky blue"
1059 "DodgerBlue"
1060 "dodger blue"
1061 "blue"
1062 "RoyalBlue"
1063 "royal blue"
1064 "MediumBlue"
1065 "medium blue"
1066 "LightSlateBlue"
1067 "light slate blue"
1068 "MediumSlateBlue"
1069 "medium slate blue"
1070 "SlateBlue"
1071 "slate blue"
1072 "DarkSlateBlue"
1073 "dark slate blue"
1074 "CornflowerBlue"
1075 "cornflower blue"
1076 "NavyBlue"
1077 "navy blue"
1078 "navy"
1079 "MidnightBlue"
1080 "midnight blue"
1081 "LightGray"
1082 "light gray"
1083 "LightGrey"
1084 "light grey"
1085 "grey"
1086 "gray"
1087 "LightSlateGrey"
1088 "light slate grey"
1089 "LightSlateGray"
1090 "light slate gray"
1091 "SlateGrey"
1092 "slate grey"
1093 "SlateGray"
1094 "slate gray"
1095 "DimGrey"
1096 "dim grey"
1097 "DimGray"
1098 "dim gray"
1099 "DarkSlateGrey"
1100 "dark slate grey"
1101 "DarkSlateGray"
1102 "dark slate gray"
1103 "black"
1104 "white"
1105 "MistyRose"
1106 "misty rose"
1107 "LavenderBlush"
1108 "lavender blush"
1109 "lavender"
1110 "AliceBlue"
1111 "alice blue"
1112 "azure"
1113 "MintCream"
1114 "mint cream"
1115 "honeydew"
1116 "seashell"
1117 "LemonChiffon"
1118 "lemon chiffon"
1119 "ivory"
1120 "cornsilk"
1121 "moccasin"
1122 "NavajoWhite"
1123 "navajo white"
1124 "PeachPuff"
1125 "peach puff"
1126 "bisque"
1127 "BlanchedAlmond"
1128 "blanched almond"
1129 "PapayaWhip"
1130 "papaya whip"
1131 "AntiqueWhite"
1132 "antique white"
1133 "linen"
1134 "OldLace"
1135 "old lace"
1136 "FloralWhite"
1137 "floral white"
1138 "gainsboro"
1139 "WhiteSmoke"
1140 "white smoke"
1141 "GhostWhite"
1142 "ghost white"
1143 "snow")
1144 "The list of X colors from the `rgb.txt' file.
1145 XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
1146
1147 (defun xw-defined-colors (&optional frame)
1148 "Internal function called by `defined-colors', which see."
1149 (or frame (setq frame (selected-frame)))
1150 (let* ((color-map-colors (mapcar (lambda (clr) (car clr)) w32-color-map))
1151 (all-colors (or color-map-colors x-colors))
1152 (this-color nil)
1153 (defined-colors nil))
1154 (message "Defining colors...")
1155 (while all-colors
1156 (setq this-color (car all-colors)
1157 all-colors (cdr all-colors))
1158 (and (color-supported-p this-color frame t)
1159 (setq defined-colors (cons this-color defined-colors))))
1160 defined-colors))
1161 \f
1162 \f
1163 ;;;; Function keys
1164
1165 ;;; make f10 activate the real menubar rather than the mini-buffer menu
1166 ;;; navigation feature.
1167 (global-set-key [f10] (lambda ()
1168 (interactive) (w32-send-sys-command ?\xf100)))
1169
1170 (defun iconify-or-deiconify-frame ()
1171 "Iconify the selected frame, or deiconify if it's currently an icon."
1172 (interactive)
1173 (if (eq (cdr (assq 'visibility (frame-parameters))) t)
1174 (iconify-frame)
1175 (make-frame-visible)))
1176
1177 (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
1178 global-map)
1179
1180 \f
1181 ;;; Do the actual Windows setup here; the above code just defines
1182 ;;; functions and variables that we use now.
1183
1184 (setq command-line-args (x-handle-args command-line-args))
1185
1186 ;;; Make sure we have a valid resource name.
1187 (or (stringp x-resource-name)
1188 (let (i)
1189 (setq x-resource-name (invocation-name))
1190
1191 ;; Change any . or * characters in x-resource-name to hyphens,
1192 ;; so as not to choke when we use it in X resource queries.
1193 (while (setq i (string-match "[.*]" x-resource-name))
1194 (aset x-resource-name i ?-))))
1195
1196 ;; For the benefit of older Emacses (19.27 and earlier) that are sharing
1197 ;; the same lisp directory, don't pass the third argument unless we seem
1198 ;; to have the multi-display support.
1199 (if (fboundp 'x-close-connection)
1200 (x-open-connection ""
1201 x-command-line-resources
1202 ;; Exit Emacs with fatal error if this fails.
1203 t)
1204 (x-open-connection ""
1205 x-command-line-resources))
1206
1207 (setq frame-creation-function 'x-create-frame-with-faces)
1208
1209 (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100)
1210 x-cut-buffer-max))
1211
1212 ;; W32 expects the menu bar cut and paste commands to use the clipboard.
1213 ;; This has ,? to match both on Sunos and on Solaris.
1214 (menu-bar-enable-clipboard)
1215
1216 ;; W32 systems have different fonts than commonly found on X, so
1217 ;; we define our own standard fontset here.
1218 (defvar w32-standard-fontset-spec
1219 "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-fontset-standard"
1220 "String of fontset spec of the standard fontset.
1221 This defines a fontset consisting of the Courier New variations for
1222 European languages which are distributed with Windows as
1223 \"Multilanguage Support\".
1224
1225 See the documentation of `create-fontset-from-fontset-spec for the format.")
1226
1227 (if (fboundp 'new-fontset)
1228 (progn
1229 ;; Create the standard fontset.
1230 (create-fontset-from-fontset-spec w32-standard-fontset-spec t)
1231 ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1,...).
1232 (create-fontset-from-x-resource)
1233 ;; Try to create a fontset from a font specification which comes
1234 ;; from initial-frame-alist, default-frame-alist, or X resource.
1235 ;; A font specification in command line argument (i.e. -fn XXXX)
1236 ;; should be already in default-frame-alist as a `font'
1237 ;; parameter. However, any font specifications in site-start
1238 ;; library, user's init file (.emacs), and default.el are not
1239 ;; yet handled here.
1240
1241 (let ((font (or (cdr (assq 'font initial-frame-alist))
1242 (cdr (assq 'font default-frame-alist))
1243 (x-get-resource "font" "Font")))
1244 xlfd-fields resolved-name)
1245 (if (and font
1246 (not (query-fontset font))
1247 (setq resolved-name (x-resolve-font-name font))
1248 (setq xlfd-fields (x-decompose-font-name font)))
1249 (if (string= "fontset"
1250 (aref xlfd-fields xlfd-regexp-registry-subnum))
1251 (new-fontset font
1252 (x-complement-fontset-spec xlfd-fields nil))
1253 ;; Create a fontset from FONT. The fontset name is
1254 ;; generated from FONT.
1255 (create-fontset-from-ascii-font font
1256 resolved-name "startup"))))))
1257
1258 ;; Apply a geometry resource to the initial frame. Put it at the end
1259 ;; of the alist, so that anything specified on the command line takes
1260 ;; precedence.
1261 (let* ((res-geometry (x-get-resource "geometry" "Geometry"))
1262 parsed)
1263 (if res-geometry
1264 (progn
1265 (setq parsed (x-parse-geometry res-geometry))
1266 ;; If the resource specifies a position,
1267 ;; call the position and size "user-specified".
1268 (if (or (assq 'top parsed) (assq 'left parsed))
1269 (setq parsed (cons '(user-position . t)
1270 (cons '(user-size . t) parsed))))
1271 ;; All geometry parms apply to the initial frame.
1272 (setq initial-frame-alist (append initial-frame-alist parsed))
1273 ;; The size parms apply to all frames.
1274 (if (assq 'height parsed)
1275 (setq default-frame-alist
1276 (cons (cons 'height (cdr (assq 'height parsed)))
1277 default-frame-alist)))
1278 (if (assq 'width parsed)
1279 (setq default-frame-alist
1280 (cons (cons 'width (cdr (assq 'width parsed)))
1281 default-frame-alist))))))
1282
1283 ;; Check the reverseVideo resource.
1284 (let ((case-fold-search t))
1285 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
1286 (if (and rv
1287 (string-match "^\\(true\\|yes\\|on\\)$" rv))
1288 (setq default-frame-alist
1289 (cons '(reverse . t) default-frame-alist)))))
1290
1291 (defun x-win-suspend-error ()
1292 "Report an error when a suspend is attempted."
1293 (error "Suspending an Emacs running under W32 makes no sense"))
1294 (add-hook 'suspend-hook 'x-win-suspend-error)
1295
1296 ;;; Turn off window-splitting optimization; w32 is usually fast enough
1297 ;;; that this is only annoying.
1298 (setq split-window-keep-point t)
1299
1300 ;; Don't show the frame name; that's redundant.
1301 (setq-default mode-line-frame-identification " ")
1302
1303 ;;; Set to a system sound if you want a fancy bell.
1304 (set-message-beep 'ok)
1305
1306 ;; Remap some functions to call w32 common dialogs
1307
1308 (defun internal-face-interactive (what &optional bool)
1309 (let* ((fn (intern (concat "face-" what)))
1310 (prompt (concat "Set " what " of face "))
1311 (face (read-face-name prompt))
1312 (default (if (fboundp fn)
1313 (or (funcall fn face (selected-frame))
1314 (funcall fn 'default (selected-frame)))))
1315 (fn-win (intern (concat (symbol-name window-system) "-select-" what)))
1316 value)
1317 (setq value
1318 (cond ((fboundp fn-win)
1319 (funcall fn-win))
1320 ((eq bool 'color)
1321 (completing-read (concat prompt " " (symbol-name face) " to: ")
1322 (mapcar (function (lambda (color)
1323 (cons color color)))
1324 x-colors)
1325 nil nil nil nil default))
1326 (bool
1327 (y-or-n-p (concat "Should face " (symbol-name face)
1328 " be " bool "? ")))
1329 (t
1330 (read-string (concat prompt " " (symbol-name face) " to: ")
1331 nil nil default))))
1332 (list face (if (equal value "") nil value))))
1333
1334 ;; Redefine the font selection to use the standard W32 dialog
1335 (defvar w32-use-w32-font-dialog t
1336 "*Use the standard font dialog if 't'.
1337 Otherwise pop up a menu of some standard fonts like X does - including
1338 fontsets.")
1339
1340 (defvar w32-fixed-font-alist
1341 '("Font menu"
1342 ("Misc"
1343 ;; For these, we specify the pixel height and width.
1344 ("fixed" "Fixedsys")
1345 ("")
1346 ("Terminal 5x4"
1347 "-*-Terminal-normal-r-*-*-*-45-*-*-c-40-*-oem")
1348 ("Terminal 6x8"
1349 "-*-Terminal-normal-r-*-*-*-60-*-*-c-80-*-oem")
1350 ("Terminal 9x5"
1351 "-*-Terminal-normal-r-*-*-*-90-*-*-c-50-*-oem")
1352 ("Terminal 9x7"
1353 "-*-Terminal-normal-r-*-*-*-90-*-*-c-70-*-oem")
1354 ("Terminal 9x8"
1355 "-*-Terminal-normal-r-*-*-*-90-*-*-c-80-*-oem")
1356 ("Terminal 12x12"
1357 "-*-Terminal-normal-r-*-*-*-120-*-*-c-120-*-oem")
1358 ("Terminal 14x10"
1359 "-*-Terminal-normal-r-*-*-*-135-*-*-c-100-*-oem")
1360 ("Terminal 6x6 Bold"
1361 "-*-Terminal-bold-r-*-*-*-60-*-*-c-60-*-oem")
1362 ("")
1363 ("Lucida Sans Typewriter.8"
1364 "-*-Lucida Sans Typewriter-normal-r-*-*-11-*-*-*-c-*-iso8859-1")
1365 ("Lucida Sans Typewriter.9"
1366 "-*-Lucida Sans Typewriter-normal-r-*-*-12-*-*-*-c-*-iso8859-1")
1367 ("Lucida Sans Typewriter.10"
1368 "-*-Lucida Sans Typewriter-normal-r-*-*-13-*-*-*-c-*-iso8859-1")
1369 ("Lucida Sans Typewriter.11"
1370 "-*-Lucida Sans Typewriter-normal-r-*-*-15-*-*-*-c-*-iso8859-1")
1371 ("Lucida Sans Typewriter.12"
1372 "-*-Lucida Sans Typewriter-normal-r-*-*-16-*-*-*-c-*-iso8859-1")
1373 ("Lucida Sans Typewriter.8 Bold"
1374 "-*-Lucida Sans Typewriter-semibold-r-*-*-11-*-*-*-c-*-iso8859-1")
1375 ("Lucida Sans Typewriter.9 Bold"
1376 "-*-Lucida Sans Typewriter-semibold-r-*-*-12-*-*-*-c-*-iso8859-1")
1377 ("Lucida Sans Typewriter.10 Bold"
1378 "-*-Lucida Sans Typewriter-semibold-r-*-*-13-*-*-*-c-*-iso8859-1")
1379 ("Lucida Sans Typewriter.11 Bold"
1380 "-*-Lucida Sans Typewriter-semibold-r-*-*-15-*-*-*-c-*-iso8859-1")
1381 ("Lucida Sans Typewriter.12 Bold"
1382 "-*-Lucida Sans Typewriter-semibold-r-*-*-16-*-*-*-c-*-iso8859-1"))
1383 ("Courier"
1384 ("Courier 10x8"
1385 "-*-Courier-*normal-r-*-*-*-97-*-*-c-80-iso8859-1")
1386 ("Courier 12x9"
1387 "-*-Courier-*normal-r-*-*-*-120-*-*-c-90-iso8859-1")
1388 ("Courier 15x12"
1389 "-*-Courier-*normal-r-*-*-*-150-*-*-c-120-iso8859-1")
1390 ;; For these, we specify the point height.
1391 ("")
1392 ("8" "-*-Courier New-normal-r-*-*-11-*-*-*-c-*-iso8859-1")
1393 ("9" "-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-1")
1394 ("10" "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-iso8859-1")
1395 ("11" "-*-Courier New-normal-r-*-*-15-*-*-*-c-*-iso8859-1")
1396 ("12" "-*-Courier New-normal-r-*-*-16-*-*-*-c-*-iso8859-1")
1397 ("8 bold" "-*-Courier New-bold-r-*-*-11-*-*-*-c-*-iso8859-1")
1398 ("9 bold" "-*-Courier New-bold-r-*-*-12-*-*-*-c-*-iso8859-1")
1399 ("10 bold" "-*-Courier New-bold-r-*-*-13-*-*-*-c-*-iso8859-1")
1400 ("11 bold" "-*-Courier New-bold-r-*-*-15-*-*-*-c-*-iso8859-1")
1401 ("12 bold" "-*-Courier New-bold-r-*-*-16-*-*-*-c-*-iso8859-1")
1402 ("8 italic" "-*-Courier New-normal-i-*-*-11-*-*-*-c-*-iso8859-1")
1403 ("9 italic" "-*-Courier New-normal-i-*-*-12-*-*-*-c-*-iso8859-1")
1404 ("10 italic" "-*-Courier New-normal-i-*-*-13-*-*-*-c-*-iso8859-1")
1405 ("11 italic" "-*-Courier New-normal-i-*-*-15-*-*-*-c-*-iso8859-1")
1406 ("12 italic" "-*-Courier New-normal-i-*-*-16-*-*-*-c-*-iso8859-1")
1407 ("8 bold italic" "-*-Courier New-bold-i-*-*-11-*-*-*-c-*-iso8859-1")
1408 ("9 bold italic" "-*-Courier New-bold-i-*-*-12-*-*-*-c-*-iso8859-1")
1409 ("10 bold italic" "-*-Courier New-bold-i-*-*-13-*-*-*-c-*-iso8859-1")
1410 ("11 bold italic" "-*-Courier New-bold-i-*-*-15-*-*-*-c-*-iso8859-1")
1411 ("12 bold italic" "-*-Courier New-bold-i-*-*-16-*-*-*-c-*-iso8859-1")
1412 ))
1413 "Fonts suitable for use in Emacs.
1414 Initially this is a list of some fixed width fonts that most people
1415 will have like Terminal and Courier. These fonts are used in the font
1416 menu if the variable `w32-use-w32-font-dialog' is nil.")
1417
1418 ;;; Enable Japanese fonts on Windows to be used by default.
1419 (set-fontset-font t (make-char 'katakana-jisx0201) '("*" . "JISX0208-SJIS"))
1420 (set-fontset-font t (make-char 'latin-jisx0201) '("*" . "JISX0208-SJIS"))
1421 (set-fontset-font t (make-char 'japanese-jisx0208) '("*" . "JISX0208-SJIS"))
1422 (set-fontset-font t (make-char 'japanese-jisx0208-1978) '("*" . "JISX0208-SJIS"))
1423
1424 (defun mouse-set-font (&rest fonts)
1425 "Select a font.
1426 If `w32-use-w32-font-dialog' is non-nil (the default), use the Windows
1427 font dialog to get the matching FONTS. Otherwise use a pop-up menu
1428 \(like Emacs on other platforms) initialized with the fonts in
1429 `w32-fixed-font-alist'."
1430 (interactive
1431 (if w32-use-w32-font-dialog
1432 (let ((chosen-font (w32-select-font)))
1433 (and chosen-font (list chosen-font)))
1434 (x-popup-menu
1435 last-nonmenu-event
1436 ;; Append list of fontsets currently defined.
1437 (if (fboundp 'new-fontset)
1438 (append w32-fixed-font-alist (list (generate-fontset-menu)))))))
1439 (if fonts
1440 (let (font)
1441 (while fonts
1442 (condition-case nil
1443 (progn
1444 (setq font (car fonts))
1445 (set-default-font font)
1446 (setq fonts nil))
1447 (error (setq fonts (cdr fonts)))))
1448 (if (null font)
1449 (error "Font not found")))))
1450
1451 ;;; w32-win.el ends here