1 ;;; w32-win.el --- parse switches controlling interface with W32 window system.
3 ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
8 ;; This file is part of GNU Emacs.
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)
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.
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.
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.
32 ;; startup.el will then examine startup files, and eventually call the hooks
33 ;; which create the first window (s).
38 ;; These are the standard X switches from the Xt Initialize.c file of
41 ;; Command line Resource Manager string
44 ;; +synchronous *synchronous
45 ;; -background *background
48 ;; -bordercolor *borderColor
49 ;; -borderwidth .borderWidth
55 ;; -foreground *foreground
56 ;; -geometry .geometry
61 ;; -reverse *reverseVideo
63 ;; -selectionTimeout .selectionTimeout
64 ;; -synchronous *synchronous
67 ;; An alist of X options and the function which handles them. See
70 (if (not (eq window-system 'w32))
71 (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name)))
79 (if (fboundp 'new-fontset)
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.
86 (defun w32-handle-scroll-bar-event (event)
87 "Handle W32 scroll bar events to do normal Window style scrolling."
89 (let ((old-window (selected-window)))
91 (let* ((position (event-start event))
92 (window (nth 0 position))
93 (portion-whole (nth 2 position))
94 (bar-part (nth 4 position)))
96 (select-window window)
99 (goto-char (window-start window))
101 ((eq bar-part 'above-handle)
103 ((eq bar-part 'handle)
104 (scroll-bar-maybe-set-window-start event))
105 ((eq bar-part 'below-handle)
108 (goto-char (window-start window))
111 (select-window old-window))))
113 ;; The following definition is used for debugging.
114 ;(defun w32-handle-scroll-bar-event (event) (interactive "e") (princ event))
116 (global-set-key [vertical-scroll-bar mouse-1] 'w32-handle-scroll-bar-event)
118 ;; (scroll-bar-mode nil)
120 (defvar mouse-wheel-scroll-amount 4
121 "*Number of lines to scroll per click of the mouse wheel.")
123 (defun mouse-wheel-scroll-line (event)
124 "Scroll the current buffer by `mouse-wheel-scroll-amount'."
127 (if (< (car (cdr (cdr event))) 0)
128 (scroll-up mouse-wheel-scroll-amount)
129 (scroll-down mouse-wheel-scroll-amount))
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)))
136 (defun mouse-wheel-scroll-screen (event)
137 "Scroll the current buffer by `mouse-wheel-scroll-amount'."
140 (if (< (car (cdr (cdr event))) 0)
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)
149 (defun w32-drag-n-drop-debug (event)
150 "Print the drag-n-drop event in a readable form."
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."
158 (mapcar 'find-file (car (cdr (cdr event))))
161 (defun w32-drag-n-drop-other-frame (event)
162 "Edit the files listed in the drag-n-drop event, in other frames.
163 May create new frames, or reuse existing ones. The frame editing
164 the last file dropped is selected."
166 (mapcar 'find-file-other-frame (car (cdr (cdr event)))))
168 ;; Bind the drag-n-drop event.
169 (global-set-key [drag-n-drop] 'w32-drag-n-drop)
170 (global-set-key [C-drag-n-drop] 'w32-drag-n-drop-other-frame)
172 (defvar x-invocation-args)
174 (defvar x-command-line-resources nil)
176 (defconst x-option-alist
177 '(("-bw" . x-handle-numeric-switch)
178 ("-d" . x-handle-display)
179 ("-display" . x-handle-display)
180 ("-name" . x-handle-name-rn-switch)
181 ("-rn" . x-handle-name-rn-switch)
182 ("-T" . x-handle-switch)
183 ("-r" . x-handle-switch)
184 ("-rv" . x-handle-switch)
185 ("-reverse" . x-handle-switch)
186 ("-fn" . x-handle-switch)
187 ("-font" . x-handle-switch)
188 ("-ib" . x-handle-numeric-switch)
189 ("-g" . x-handle-geometry)
190 ("-geometry" . x-handle-geometry)
191 ("-fg" . x-handle-switch)
192 ("-foreground". x-handle-switch)
193 ("-bg" . x-handle-switch)
194 ("-background". x-handle-switch)
195 ("-ms" . x-handle-switch)
196 ("-itype" . x-handle-switch)
197 ("-i" . x-handle-switch)
198 ("-iconic" . x-handle-iconic)
199 ("-xrm" . x-handle-xrm-switch)
200 ("-cr" . x-handle-switch)
201 ("-vb" . x-handle-switch)
202 ("-hb" . x-handle-switch)
203 ("-bd" . x-handle-switch)))
205 (defconst x-long-option-alist
206 '(("--border-width" . "-bw")
210 ("--reverse-video" . "-reverse")
212 ("--internal-border" . "-ib")
213 ("--geometry" . "-geometry")
214 ("--foreground-color" . "-fg")
215 ("--background-color" . "-bg")
216 ("--mouse-color" . "-ms")
217 ("--icon-type" . "-itype")
218 ("--iconic" . "-iconic")
220 ("--cursor-color" . "-cr")
221 ("--vertical-scroll-bars" . "-vb")
222 ("--border-color" . "-bd")))
224 (defconst x-switch-definitions
229 ("-reverse" reverse t)
232 ("-ib" internal-border-width)
233 ("-fg" foreground-color)
234 ("-foreground" foreground-color)
235 ("-bg" background-color)
236 ("-background" background-color)
239 ("-itype" icon-type t)
241 ("-vb" vertical-scroll-bars t)
242 ("-hb" horizontal-scroll-bars t)
244 ("-bw" border-width)))
246 ;; Handler for switches of the form "-switch value" or "-switch".
247 (defun x-handle-switch (switch)
248 (let ((aelt (assoc switch x-switch-definitions)))
251 (setq default-frame-alist
252 (cons (cons (nth 1 aelt) (nth 2 aelt))
253 default-frame-alist))
254 (setq default-frame-alist
255 (cons (cons (nth 1 aelt)
256 (car x-invocation-args))
258 x-invocation-args (cdr x-invocation-args))))))
260 ;; Make -iconic apply only to the initial frame!
261 (defun x-handle-iconic (switch)
262 (setq initial-frame-alist
263 (cons '(visibility . icon) initial-frame-alist)))
265 ;; Handler for switches of the form "-switch n"
266 (defun x-handle-numeric-switch (switch)
267 (let ((aelt (assoc switch x-switch-definitions)))
269 (setq default-frame-alist
270 (cons (cons (nth 1 aelt)
271 (string-to-int (car x-invocation-args)))
274 (cdr x-invocation-args)))))
276 ;; Handle the -xrm option.
277 (defun x-handle-xrm-switch (switch)
278 (or (consp x-invocation-args)
279 (error "%s: missing argument to `%s' option" (invocation-name) switch))
280 (setq x-command-line-resources (car x-invocation-args))
281 (setq x-invocation-args (cdr x-invocation-args)))
283 ;; Handle the geometry option
284 (defun x-handle-geometry (switch)
285 (let ((geo (x-parse-geometry (car x-invocation-args))))
286 (setq initial-frame-alist
287 (append initial-frame-alist
288 (if (or (assq 'left geo) (assq 'top geo))
289 '((user-position . t)))
290 (if (or (assq 'height geo) (assq 'width geo))
293 x-invocation-args (cdr x-invocation-args))))
295 ;; Handle the -name and -rn options. Set the variable x-resource-name
296 ;; to the option's operand; if the switch was `-name', set the name of
297 ;; the initial frame, too.
298 (defun x-handle-name-rn-switch (switch)
299 (or (consp x-invocation-args)
300 (error "%s: missing argument to `%s' option" (invocation-name) switch))
301 (setq x-resource-name (car x-invocation-args)
302 x-invocation-args (cdr x-invocation-args))
303 (if (string= switch "-name")
304 (setq initial-frame-alist (cons (cons 'name x-resource-name)
305 initial-frame-alist))))
307 (defvar x-display-name nil
308 "The display name specifying server and frame.")
310 (defun x-handle-display (switch)
311 (setq x-display-name (car x-invocation-args)
312 x-invocation-args (cdr x-invocation-args)))
314 (defvar x-invocation-args nil)
316 (defun x-handle-args (args)
317 "Process the X-related command line options in ARGS.
318 This is done before the user's startup file is loaded. They are copied to
319 x-invocation args from which the X-related things are extracted, first
320 the switch (e.g., \"-fg\") in the following code, and possible values
321 \(e.g., \"black\") in the option handler code (e.g., x-handle-switch).
322 This returns ARGS with the arguments that have been processed removed."
324 (setq x-invocation-args args
326 (while x-invocation-args
327 (let* ((this-switch (car x-invocation-args))
328 (orig-this-switch this-switch)
329 completion argval aelt)
330 (setq x-invocation-args (cdr x-invocation-args))
331 ;; Check for long options with attached arguments
332 ;; and separate out the attached option argument into argval.
333 (if (string-match "^--[^=]*=" this-switch)
334 (setq argval (substring this-switch (match-end 0))
335 this-switch (substring this-switch 0 (1- (match-end 0)))))
336 (setq completion (try-completion this-switch x-long-option-alist))
337 (if (eq completion t)
338 ;; Exact match for long option.
339 (setq this-switch (cdr (assoc this-switch x-long-option-alist)))
340 (if (stringp completion)
341 (let ((elt (assoc completion x-long-option-alist)))
342 ;; Check for abbreviated long option.
344 (error "Option `%s' is ambiguous" this-switch))
345 (setq this-switch (cdr elt)))
346 ;; Check for a short option.
347 (setq argval nil this-switch orig-this-switch)))
348 (setq aelt (assoc this-switch x-option-alist))
351 (let ((x-invocation-args
352 (cons argval x-invocation-args)))
353 (funcall (cdr aelt) this-switch))
354 (funcall (cdr aelt) this-switch))
355 (setq args (cons this-switch args)))))
356 (setq args (nreverse args)))
364 (defvar x-colors '("aquamarine"
422 "medium spring green"
502 "The full list of X colors from the `rgb.text' file.")
504 (defun x-defined-colors (&optional frame)
505 "Return a list of colors supported for a particular frame.
506 The argument FRAME specifies which frame to try.
507 The value may be different for frames on different X displays."
508 (or frame (setq frame (selected-frame)))
509 (let* ((color-map-colors (mapcar (lambda (clr) (car clr)) w32-color-map))
510 (all-colors (or color-map-colors x-colors))
512 (defined-colors nil))
513 (message "Defining colors...")
515 (setq this-color (car all-colors)
516 all-colors (cdr all-colors))
517 (and (face-color-supported-p frame this-color t)
518 (setq defined-colors (cons this-color defined-colors))))
524 ;;; make f10 activate the real menubar rather than the mini-buffer menu
525 ;;; navigation feature.
526 (global-set-key [f10] (lambda ()
527 (interactive) (w32-send-sys-command ?\xf100)))
529 (defun iconify-or-deiconify-frame ()
530 "Iconify the selected frame, or deiconify if it's currently an icon."
532 (if (eq (cdr (assq 'visibility (frame-parameters))) t)
534 (make-frame-visible)))
536 (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
540 ;;;; Selections and cut buffers
542 ;;; We keep track of the last text selected here, so we can check the
543 ;;; current selection against it, and avoid passing back our own text
544 ;;; from x-cut-buffer-or-selection-value.
545 (defvar x-last-selected-text nil)
547 ;;; It is said that overlarge strings are slow to put into the cut buffer.
548 ;;; Note this value is overridden below.
549 (defvar x-cut-buffer-max 20000
550 "Max number of characters to put in the cut buffer.")
552 (defvar x-select-enable-clipboard t
553 "Non-nil means cutting and pasting uses the clipboard.
554 This is in addition to the primary selection.")
556 (defun x-select-text (text &optional push)
557 (if x-select-enable-clipboard
558 (w32-set-clipboard-data text))
559 (setq x-last-selected-text text))
561 ;;; Return the value of the current selection.
562 ;;; Consult the selection, then the cut buffer. Treat empty strings
563 ;;; as if they were unset.
564 (defun x-get-selection-value ()
565 (if x-select-enable-clipboard
567 ;; Don't die if x-get-selection signals an error.
569 (setq text (w32-get-clipboard-data))
570 (error (message "w32-get-clipboard-data:%s" c)))
571 (if (string= text "") (setq text nil))
574 ((eq text x-last-selected-text) nil)
575 ((string= text x-last-selected-text)
576 ;; Record the newer string, so subsequent calls can use the 'eq' test.
577 (setq x-last-selected-text text)
580 (setq x-last-selected-text text))))))
582 (defalias 'x-cut-buffer-or-selection-value 'x-get-selection-value)
585 ;;; Do the actual Windows setup here; the above code just defines
586 ;;; functions and variables that we use now.
588 (setq command-line-args (x-handle-args command-line-args))
590 ;;; Make sure we have a valid resource name.
591 (or (stringp x-resource-name)
593 (setq x-resource-name (invocation-name))
595 ;; Change any . or * characters in x-resource-name to hyphens,
596 ;; so as not to choke when we use it in X resource queries.
597 (while (setq i (string-match "[.*]" x-resource-name))
598 (aset x-resource-name i ?-))))
600 ;; For the benefit of older Emacses (19.27 and earlier) that are sharing
601 ;; the same lisp directory, don't pass the third argument unless we seem
602 ;; to have the multi-display support.
603 (if (fboundp 'x-close-connection)
604 (x-open-connection ""
605 x-command-line-resources
606 ;; Exit Emacs with fatal error if this fails.
608 (x-open-connection ""
609 x-command-line-resources))
611 (setq frame-creation-function 'x-create-frame-with-faces)
613 (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100)
616 ;; W32 expects the menu bar cut and paste commands to use the clipboard.
617 ;; This has ,? to match both on Sunos and on Solaris.
618 (menu-bar-enable-clipboard)
620 ;; W32 systems have different fonts than commonly found on X, so
621 ;; we define our own standard fontset here.
622 (defvar w32-standard-fontset-spec
623 "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-fontset-standard,
624 latin-iso8859-2:-*-Courier New CE-normal-r-*-*-13-*-*-*-c-*-iso8859-2,
625 latin-iso8859-3:-*-Courier New Tur-normal-r-*-*-13-*-*-*-c-*-iso8859-3,
626 latin-iso8859-4:-*-Courier New Baltic-normal-r-*-*-13-*-*-*-c-*-iso8859-4,
627 cyrillic-iso8859-5:-*-Courier New Cyr-normal-r-*-*-13-*-*-*-c-*-iso8859-5,
628 greek-iso8859-7:-*-Courier New Greek-normal-r-*-*-13-*-*-*-c-*-iso8859-7"
629 "String of fontset spec of the standard fontset. This defines a
630 fontset consisting of the Courier New variations for European
631 languages which are distributed with Windows as \"Multilanguage Support\".
633 See the documentation of `create-fontset-from-fontset-spec for the format.")
635 (if (fboundp 'new-fontset)
637 (defun w32-create-initial-fontsets ()
638 "Create fontset-startup, fontset-standard and any fontsets
639 specified in X resources."
640 ;; Create the standard fontset.
641 (create-fontset-from-fontset-spec w32-standard-fontset-spec t)
643 ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1,...).
644 (create-fontset-from-x-resource)
646 ;; Try to create a fontset from a font specification which comes
647 ;; from initial-frame-alist, default-frame-alist, or X resource.
648 ;; A font specification in command line argument (i.e. -fn XXXX)
649 ;; should be already in default-frame-alist as a `font'
650 ;; parameter. However, any font specifications in site-start
651 ;; library, user's init file (.emacs), and default.el are not
654 (let ((font (or (cdr (assq 'font initial-frame-alist))
655 (cdr (assq 'font default-frame-alist))
656 (x-get-resource "font" "Font")))
657 xlfd-fields resolved-name)
659 (not (query-fontset font))
660 (setq resolved-name (x-resolve-font-name font))
661 (setq xlfd-fields (x-decompose-font-name font)))
662 (if (string= "fontset"
663 (aref xlfd-fields xlfd-regexp-registry-subnum))
665 (x-complement-fontset-spec xlfd-fields nil))
666 ;; Create a fontset from FONT. The fontset name is
667 ;; generated from FONT. Create style variants of the
668 ;; fontset too. Font names in the variants are
669 ;; generated automatially unless X resources
670 ;; XXX.attribyteFont explicitly specify them.
671 (let ((styles (mapcar 'car x-style-funcs-alist))
672 (faces '(bold italic bold-italic))
673 face face-font fontset fontset-spec)
675 (setq face (car faces))
676 (setq face-font (x-get-resource (concat (symbol-name face)
678 "Face.AttributeFont"))
680 (setq styles (cons (cons face face-font)
681 (delq face styles))))
682 (setq faces (cdr faces)))
683 (aset xlfd-fields xlfd-regexp-foundry-subnum nil)
684 (aset xlfd-fields xlfd-regexp-family-subnum nil)
685 (aset xlfd-fields xlfd-regexp-registry-subnum "fontset")
686 (aset xlfd-fields xlfd-regexp-encoding-subnum "startup")
687 ;; The fontset name should have concrete values in
688 ;; weight and slant field.
689 (let ((weight (aref xlfd-fields xlfd-regexp-weight-subnum))
690 (slant (aref xlfd-fields xlfd-regexp-slant-subnum))
692 (if (or (not weight) (string-match "[*?]*" weight))
695 (x-decompose-font-name resolved-name))
696 (aset xlfd-fields xlfd-regexp-weight-subnum
697 (aref xlfd-temp xlfd-regexp-weight-subnum))))
698 (if (or (not slant) (string-match "[*?]*" slant))
702 (x-decompose-font-name resolved-name)))
703 (aset xlfd-fields xlfd-regexp-slant-subnum
704 (aref xlfd-temp xlfd-regexp-slant-subnum)))))
705 (setq fontset (x-compose-font-name xlfd-fields))
706 (create-fontset-from-fontset-spec
707 (concat fontset ", ascii:" font) styles)
709 ;; This cannot be run yet, as creating fontsets requires a
710 ;; Window to be initialised so the fonts can be listed.
711 ;; Add it to a hook so it gets run later.
712 (add-hook 'before-init-hook 'w32-create-initial-fontsets)
715 ;; Apply a geometry resource to the initial frame. Put it at the end
716 ;; of the alist, so that anything specified on the command line takes
718 (let* ((res-geometry (x-get-resource "geometry" "Geometry"))
722 (setq parsed (x-parse-geometry res-geometry))
723 ;; If the resource specifies a position,
724 ;; call the position and size "user-specified".
725 (if (or (assq 'top parsed) (assq 'left parsed))
726 (setq parsed (cons '(user-position . t)
727 (cons '(user-size . t) parsed))))
728 ;; All geometry parms apply to the initial frame.
729 (setq initial-frame-alist (append initial-frame-alist parsed))
730 ;; The size parms apply to all frames.
731 (if (assq 'height parsed)
732 (setq default-frame-alist
733 (cons (cons 'height (cdr (assq 'height parsed)))
734 default-frame-alist)))
735 (if (assq 'width parsed)
736 (setq default-frame-alist
737 (cons (cons 'width (cdr (assq 'width parsed)))
738 default-frame-alist))))))
740 ;; Check the reverseVideo resource.
741 (let ((case-fold-search t))
742 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
744 (string-match "^\\(true\\|yes\\|on\\)$" rv))
745 (setq default-frame-alist
746 (cons '(reverse . t) default-frame-alist)))))
748 ;; Set x-selection-timeout, measured in milliseconds.
749 (let ((res-selection-timeout
750 (x-get-resource "selectionTimeout" "SelectionTimeout")))
751 (setq x-selection-timeout 20000)
752 (if res-selection-timeout
753 (setq x-selection-timeout (string-to-number res-selection-timeout))))
755 (defun x-win-suspend-error ()
756 (error "Suspending an emacs running under W32 makes no sense"))
757 (add-hook 'suspend-hook 'x-win-suspend-error)
759 ;;; Arrange for the kill and yank functions to set and check the clipboard.
760 (setq interprogram-cut-function 'x-select-text)
761 (setq interprogram-paste-function 'x-get-selection-value)
763 ;;; Turn off window-splitting optimization; w32 is usually fast enough
764 ;;; that this is only annoying.
765 (setq split-window-keep-point t)
767 ;; Don't show the frame name; that's redundant.
768 (setq-default mode-line-frame-identification " ")
770 ;;; Set to a system sound if you want a fancy bell.
771 (set-message-beep 'ok)
773 ;; Remap some functions to call w32 common dialogs
775 (defun internal-face-interactive (what &optional bool)
776 (let* ((fn (intern (concat "face-" what)))
777 (prompt (concat "Set " what " of face"))
778 (face (read-face-name (concat prompt ": ")))
779 (default (if (fboundp fn)
780 (or (funcall fn face (selected-frame))
781 (funcall fn 'default (selected-frame)))))
782 (fn-win (intern (concat (symbol-name window-system) "-select-" what)))
785 (cond ((fboundp fn-win)
788 (completing-read (concat prompt " " (symbol-name face) " to: ")
789 (mapcar (function (lambda (color)
792 nil nil nil nil default))
794 (y-or-n-p (concat "Should face " (symbol-name face)
797 (read-string (concat prompt " " (symbol-name face) " to: ")
799 (list face (if (equal value "") nil value))))
801 ;; Redefine the font selection to use the standard W32 dialog
802 (defvar w32-use-w32-font-dialog t
803 "*Use the standard font dialog if 't' - otherwise pop up a menu of
804 some standard fonts like X does - including fontsets")
806 (defvar w32-fixed-font-alist
809 ;; For these, we specify the pixel height and width.
813 "-*-Terminal-normal-r-*-*-*-45-*-*-c-40-*-oem")
815 "-*-Terminal-normal-r-*-*-*-60-*-*-c-80-*-oem")
817 "-*-Terminal-normal-r-*-*-*-90-*-*-c-50-*-oem")
819 "-*-Terminal-normal-r-*-*-*-90-*-*-c-70-*-oem")
821 "-*-Terminal-normal-r-*-*-*-90-*-*-c-80-*-oem")
823 "-*-Terminal-normal-r-*-*-*-120-*-*-c-120-*-oem")
825 "-*-Terminal-normal-r-*-*-*-135-*-*-c-100-*-oem")
827 "-*-Terminal-bold-r-*-*-*-60-*-*-c-60-*-oem")
829 ("Lucida Sans Typewriter.8"
830 "-*-Lucida Sans Typewriter-normal-r-*-*-11-*-*-*-c-*-iso8859-1")
831 ("Lucida Sans Typewriter.9"
832 "-*-Lucida Sans Typewriter-normal-r-*-*-12-*-*-*-c-*-iso8859-1")
833 ("Lucida Sans Typewriter.10"
834 "-*-Lucida Sans Typewriter-normal-r-*-*-13-*-*-*-c-*-iso8859-1")
835 ("Lucida Sans Typewriter.11"
836 "-*-Lucida Sans Typewriter-normal-r-*-*-15-*-*-*-c-*-iso8859-1")
837 ("Lucida Sans Typewriter.12"
838 "-*-Lucida Sans Typewriter-normal-r-*-*-16-*-*-*-c-*-iso8859-1")
839 ("Lucida Sans Typewriter.8 Bold"
840 "-*-Lucida Sans Typewriter-semibold-r-*-*-11-*-*-*-c-*-iso8859-1")
841 ("Lucida Sans Typewriter.9 Bold"
842 "-*-Lucida Sans Typewriter-semibold-r-*-*-12-*-*-*-c-*-iso8859-1")
843 ("Lucida Sans Typewriter.10 Bold"
844 "-*-Lucida Sans Typewriter-semibold-r-*-*-13-*-*-*-c-*-iso8859-1")
845 ("Lucida Sans Typewriter.11 Bold"
846 "-*-Lucida Sans Typewriter-semibold-r-*-*-15-*-*-*-c-*-iso8859-1")
847 ("Lucida Sans Typewriter.12 Bold"
848 "-*-Lucida Sans Typewriter-semibold-r-*-*-16-*-*-*-c-*-iso8859-1"))
851 "-*-Courier-*normal-r-*-*-*-97-*-*-c-80-iso8859-1")
853 "-*-Courier-*normal-r-*-*-*-120-*-*-c-90-iso8859-1")
855 "-*-Courier-*normal-r-*-*-*-150-*-*-c-120-iso8859-1")
856 ;; For these, we specify the point height.
858 ("8" "-*-Courier New-normal-r-*-*-11-*-*-*-c-*-iso8859-1")
859 ("9" "-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-1")
860 ("10" "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-iso8859-1")
861 ("11" "-*-Courier New-normal-r-*-*-15-*-*-*-c-*-iso8859-1")
862 ("12" "-*-Courier New-normal-r-*-*-16-*-*-*-c-*-iso8859-1")
863 ("8 bold" "-*-Courier New-bold-r-*-*-11-*-*-*-c-*-iso8859-1")
864 ("9 bold" "-*-Courier New-bold-r-*-*-12-*-*-*-c-*-iso8859-1")
865 ("10 bold" "-*-Courier New-bold-r-*-*-13-*-*-*-c-*-iso8859-1")
866 ("11 bold" "-*-Courier New-bold-r-*-*-15-*-*-*-c-*-iso8859-1")
867 ("12 bold" "-*-Courier New-bold-r-*-*-16-*-*-*-c-*-iso8859-1")
868 ("8 italic" "-*-Courier New-normal-i-*-*-11-*-*-*-c-*-iso8859-1")
869 ("9 italic" "-*-Courier New-normal-i-*-*-12-*-*-*-c-*-iso8859-1")
870 ("10 italic" "-*-Courier New-normal-i-*-*-13-*-*-*-c-*-iso8859-1")
871 ("11 italic" "-*-Courier New-normal-i-*-*-15-*-*-*-c-*-iso8859-1")
872 ("12 italic" "-*-Courier New-normal-i-*-*-16-*-*-*-c-*-iso8859-1")
873 ("8 bold italic" "-*-Courier New-bold-i-*-*-11-*-*-*-c-*-iso8859-1")
874 ("9 bold italic" "-*-Courier New-bold-i-*-*-12-*-*-*-c-*-iso8859-1")
875 ("10 bold italic" "-*-Courier New-bold-i-*-*-13-*-*-*-c-*-iso8859-1")
876 ("11 bold italic" "-*-Courier New-bold-i-*-*-15-*-*-*-c-*-iso8859-1")
877 ("12 bold italic" "-*-Courier New-bold-i-*-*-16-*-*-*-c-*-iso8859-1")
879 "Fonts suitable for use in Emacs. Initially this is a list of some
880 fixed width fonts that most people will have like Terminal and
881 Courier. These fonts are used in the font menu if the variable
882 `w32-use-w32-font-dialog' is nil.")
884 (defun mouse-set-font (&rest fonts)
886 (if w32-use-w32-font-dialog
887 (list (w32-select-font))
890 ;; Append list of fontsets currently defined.
891 (if (fboundp 'new-fontset)
892 (append w32-fixed-font-alist (list (generate-fontset-menu)))))))
898 (set-default-font (car fonts))
899 (setq font (car fonts))
902 (setq fonts (cdr fonts)))))
904 (error "Font not found")))))
906 ;;; w32-win.el ends here