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 ;; FIXME: this is temporary for v21.1, since many redisplay problems
83 ;; happen if redisplay-dont-pause is nil.
84 (setq redisplay-dont-pause t)
86 ;; Because Windows scrollbars look and act quite differently compared
87 ;; with the standard X scroll-bars, we don't try to use the normal
88 ;; scroll bar routines.
90 (defun w32-handle-scroll-bar-event (event)
91 "Handle W32 scroll bar EVENT to do normal Window style scrolling."
93 (let ((old-window (selected-window)))
95 (let* ((position (event-start event))
96 (window (nth 0 position))
97 (portion-whole (nth 2 position))
98 (bar-part (nth 4 position)))
100 (select-window window)
103 (goto-char (window-start window))
105 ((eq bar-part 'above-handle)
107 ((eq bar-part 'handle)
108 (scroll-bar-maybe-set-window-start event))
109 ((eq bar-part 'below-handle)
112 (goto-char (window-start window))
115 (select-window old-window))))
117 ;; The following definition is used for debugging.
118 ;(defun w32-handle-scroll-bar-event (event) (interactive "e") (princ event))
120 (global-set-key [vertical-scroll-bar mouse-1] 'w32-handle-scroll-bar-event)
122 ;; (scroll-bar-mode nil)
124 (defvar mouse-wheel-scroll-amount 4
125 "*Number of lines to scroll per click of the mouse wheel.")
127 (defun mouse-wheel-scroll-line (event)
128 "Scroll the window in which EVENT occurred by `mouse-wheel-scroll-amount'."
131 (if (< (car (cdr (cdr event))) 0)
132 (scroll-up mouse-wheel-scroll-amount)
133 (scroll-down mouse-wheel-scroll-amount))
136 ;; for scroll-in-place.el, this way the -scroll-line and -scroll-screen
137 ;; commands won't interact
138 (setq scroll-command-groups (list '(mouse-wheel-scroll-line)))
140 (defun mouse-wheel-scroll-screen (event)
141 "Scroll the window in which EVENT occurred by `mouse-wheel-scroll-amount'."
144 (if (< (car (cdr (cdr event))) 0)
149 ;; Bind the mouse-wheel event:
150 (global-set-key [mouse-wheel] 'mouse-wheel-scroll-line)
151 (global-set-key [C-mouse-wheel] 'mouse-wheel-scroll-screen)
153 (defun w32-drag-n-drop-debug (event)
154 "Print the drag-n-drop EVENT in a readable form."
158 (defun w32-drag-n-drop (event)
159 "Edit the files listed in the drag-n-drop EVENT.
160 Switch to a buffer editing the last file dropped."
163 ;; Make sure the drop target has positive co-ords
164 ;; before setting the selected frame - otherwise it
165 ;; won't work. <skx@tardis.ed.ac.uk>
166 (let* ((window (posn-window (event-start event)))
167 (coords (posn-x-y (event-start event)))
170 (if (and (> x 0) (> y 0))
171 (set-frame-selected-window nil window))
172 (mapcar 'find-file (car (cdr (cdr event)))))
175 (defun w32-drag-n-drop-other-frame (event)
176 "Edit the files listed in the drag-n-drop EVENT, in other frames.
177 May create new frames, or reuse existing ones. The frame editing
178 the last file dropped is selected."
180 (mapcar 'find-file-other-frame (car (cdr (cdr event)))))
182 ;; Bind the drag-n-drop event.
183 (global-set-key [drag-n-drop] 'w32-drag-n-drop)
184 (global-set-key [C-drag-n-drop] 'w32-drag-n-drop-other-frame)
186 ;; Keyboard layout/language change events
187 ;; For now ignore language-change events; in the future
188 ;; we should switch the Emacs Input Method to match the
189 ;; new layout/language selected by the user.
190 (global-set-key [language-change] 'ignore)
192 (defvar x-invocation-args)
194 (defvar x-command-line-resources nil)
196 (defconst x-option-alist
197 '(("-bw" . x-handle-numeric-switch)
198 ("-d" . x-handle-display)
199 ("-display" . x-handle-display)
200 ("-name" . x-handle-name-rn-switch)
201 ("-rn" . x-handle-name-rn-switch)
202 ("-T" . x-handle-switch)
203 ("-r" . x-handle-switch)
204 ("-rv" . x-handle-switch)
205 ("-reverse" . x-handle-switch)
206 ("-fn" . x-handle-switch)
207 ("-font" . x-handle-switch)
208 ("-ib" . x-handle-numeric-switch)
209 ("-g" . x-handle-geometry)
210 ("-geometry" . x-handle-geometry)
211 ("-fg" . x-handle-switch)
212 ("-foreground". x-handle-switch)
213 ("-bg" . x-handle-switch)
214 ("-background". x-handle-switch)
215 ("-ms" . x-handle-switch)
216 ("-itype" . x-handle-switch)
217 ("-i" . x-handle-switch)
218 ("-iconic" . x-handle-iconic)
219 ("-xrm" . x-handle-xrm-switch)
220 ("-cr" . x-handle-switch)
221 ("-vb" . x-handle-switch)
222 ("-hb" . x-handle-switch)
223 ("-bd" . x-handle-switch)))
225 (defconst x-long-option-alist
226 '(("--border-width" . "-bw")
230 ("--reverse-video" . "-reverse")
232 ("--internal-border" . "-ib")
233 ("--geometry" . "-geometry")
234 ("--foreground-color" . "-fg")
235 ("--background-color" . "-bg")
236 ("--mouse-color" . "-ms")
237 ("--icon-type" . "-itype")
238 ("--iconic" . "-iconic")
240 ("--cursor-color" . "-cr")
241 ("--vertical-scroll-bars" . "-vb")
242 ("--border-color" . "-bd")))
244 (defconst x-switch-definitions
249 ("-reverse" reverse t)
252 ("-ib" internal-border-width)
253 ("-fg" foreground-color)
254 ("-foreground" foreground-color)
255 ("-bg" background-color)
256 ("-background" background-color)
259 ("-itype" icon-type t)
261 ("-vb" vertical-scroll-bars t)
262 ("-hb" horizontal-scroll-bars t)
264 ("-bw" border-width)))
267 (defun x-handle-switch (switch)
268 "Handle SWITCH of the form \"-switch value\" or \"-switch\"."
269 (let ((aelt (assoc switch x-switch-definitions)))
272 (setq default-frame-alist
273 (cons (cons (nth 1 aelt) (nth 2 aelt))
274 default-frame-alist))
275 (setq default-frame-alist
276 (cons (cons (nth 1 aelt)
277 (car x-invocation-args))
279 x-invocation-args (cdr x-invocation-args))))))
281 (defun x-handle-iconic (switch)
282 "Make \"-iconic\" SWITCH apply only to the initial frame."
283 (setq initial-frame-alist
284 (cons '(visibility . icon) initial-frame-alist)))
287 (defun x-handle-numeric-switch (switch)
288 "Handle SWITCH of the form \"-switch n\"."
289 (let ((aelt (assoc switch x-switch-definitions)))
291 (setq default-frame-alist
292 (cons (cons (nth 1 aelt)
293 (string-to-int (car x-invocation-args)))
296 (cdr x-invocation-args)))))
298 (defun x-handle-xrm-switch (switch)
299 "Handle the \"-xrm\" SWITCH."
300 (or (consp x-invocation-args)
301 (error "%s: missing argument to `%s' option" (invocation-name) switch))
302 (setq x-command-line-resources (car x-invocation-args))
303 (setq x-invocation-args (cdr x-invocation-args)))
305 (defun x-handle-geometry (switch)
306 "Handle the \"-geometry\" SWITCH."
307 (let ((geo (x-parse-geometry (car x-invocation-args))))
308 (setq initial-frame-alist
309 (append initial-frame-alist
310 (if (or (assq 'left geo) (assq 'top geo))
311 '((user-position . t)))
312 (if (or (assq 'height geo) (assq 'width geo))
315 x-invocation-args (cdr x-invocation-args))))
317 (defun x-handle-name-rn-switch (switch)
318 "Handle a \"-name\" or \"-rn\" SWITCH."
319 ;; Handle the -name and -rn options. Set the variable x-resource-name
320 ;; to the option's operand; if the switch was `-name', set the name of
321 ;; the initial frame, too.
322 (or (consp x-invocation-args)
323 (error "%s: missing argument to `%s' option" (invocation-name) switch))
324 (setq x-resource-name (car x-invocation-args)
325 x-invocation-args (cdr x-invocation-args))
326 (if (string= switch "-name")
327 (setq initial-frame-alist (cons (cons 'name x-resource-name)
328 initial-frame-alist))))
330 (defvar x-display-name nil
331 "The display name specifying server and frame.")
333 (defun x-handle-display (switch)
334 "Handle the \"-display\" SWITCH."
335 (setq x-display-name (car x-invocation-args)
336 x-invocation-args (cdr x-invocation-args)))
338 (defvar x-invocation-args nil)
340 (defun x-handle-args (args)
341 "Process the X-related command line options in ARGS.
342 This is done before the user's startup file is loaded. They are copied to
343 x-invocation args from which the X-related things are extracted, first
344 the switch (e.g., \"-fg\") in the following code, and possible values
345 \(e.g., \"black\") in the option handler code (e.g., x-handle-switch).
346 This returns ARGS with the arguments that have been processed removed."
347 (setq x-invocation-args args
349 (while x-invocation-args
350 (let* ((this-switch (car x-invocation-args))
351 (orig-this-switch this-switch)
352 completion argval aelt)
353 (setq x-invocation-args (cdr x-invocation-args))
354 ;; Check for long options with attached arguments
355 ;; and separate out the attached option argument into argval.
356 (if (string-match "^--[^=]*=" this-switch)
357 (setq argval (substring this-switch (match-end 0))
358 this-switch (substring this-switch 0 (1- (match-end 0)))))
359 (setq completion (try-completion this-switch x-long-option-alist))
360 (if (eq completion t)
361 ;; Exact match for long option.
362 (setq this-switch (cdr (assoc this-switch x-long-option-alist)))
363 (if (stringp completion)
364 (let ((elt (assoc completion x-long-option-alist)))
365 ;; Check for abbreviated long option.
367 (error "Option `%s' is ambiguous" this-switch))
368 (setq this-switch (cdr elt)))
369 ;; Check for a short option.
370 (setq argval nil this-switch orig-this-switch)))
371 (setq aelt (assoc this-switch x-option-alist))
374 (let ((x-invocation-args
375 (cons argval x-invocation-args)))
376 (funcall (cdr aelt) this-switch))
377 (funcall (cdr aelt) this-switch))
378 (setq args (cons this-switch args)))))
379 (setq args (nreverse args)))
387 (defvar x-colors '("LightGreen"
986 "LightGoldenrodYellow"
987 "light goldenrod yellow"
1004 "medium spring green"
1139 "The list of X colors from the `rgb.txt' file.
1140 XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
1142 (defun xw-defined-colors (&optional frame)
1143 "Internal function called by `defined-colors', which see."
1144 (or frame (setq frame (selected-frame)))
1145 (let* ((color-map-colors (mapcar (lambda (clr) (car clr)) w32-color-map))
1146 (all-colors (or color-map-colors x-colors))
1148 (defined-colors nil))
1149 (message "Defining colors...")
1151 (setq this-color (car all-colors)
1152 all-colors (cdr all-colors))
1153 (and (color-supported-p this-color frame t)
1154 (setq defined-colors (cons this-color defined-colors))))
1160 ;;; make f10 activate the real menubar rather than the mini-buffer menu
1161 ;;; navigation feature.
1162 (global-set-key [f10] (lambda ()
1163 (interactive) (w32-send-sys-command ?\xf100)))
1165 (defun iconify-or-deiconify-frame ()
1166 "Iconify the selected frame, or deiconify if it's currently an icon."
1168 (if (eq (cdr (assq 'visibility (frame-parameters))) t)
1170 (make-frame-visible)))
1172 (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
1176 ;;; Do the actual Windows setup here; the above code just defines
1177 ;;; functions and variables that we use now.
1179 (setq command-line-args (x-handle-args command-line-args))
1181 ;;; Make sure we have a valid resource name.
1182 (or (stringp x-resource-name)
1184 (setq x-resource-name (invocation-name))
1186 ;; Change any . or * characters in x-resource-name to hyphens,
1187 ;; so as not to choke when we use it in X resource queries.
1188 (while (setq i (string-match "[.*]" x-resource-name))
1189 (aset x-resource-name i ?-))))
1191 ;; For the benefit of older Emacses (19.27 and earlier) that are sharing
1192 ;; the same lisp directory, don't pass the third argument unless we seem
1193 ;; to have the multi-display support.
1194 (if (fboundp 'x-close-connection)
1195 (x-open-connection ""
1196 x-command-line-resources
1197 ;; Exit Emacs with fatal error if this fails.
1199 (x-open-connection ""
1200 x-command-line-resources))
1202 (setq frame-creation-function 'x-create-frame-with-faces)
1204 (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100)
1207 ;; W32 expects the menu bar cut and paste commands to use the clipboard.
1208 ;; This has ,? to match both on Sunos and on Solaris.
1209 (menu-bar-enable-clipboard)
1211 ;; W32 systems have different fonts than commonly found on X, so
1212 ;; we define our own standard fontset here.
1213 (defvar w32-standard-fontset-spec
1214 "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-fontset-standard"
1215 "String of fontset spec of the standard fontset.
1216 This defines a fontset consisting of the Courier New variations for
1217 European languages which are distributed with Windows as
1218 \"Multilanguage Support\".
1220 See the documentation of `create-fontset-from-fontset-spec for the format.")
1222 (if (fboundp 'new-fontset)
1224 ;; Create the standard fontset.
1225 (create-fontset-from-fontset-spec w32-standard-fontset-spec t)
1226 ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1,...).
1227 (create-fontset-from-x-resource)
1228 ;; Try to create a fontset from a font specification which comes
1229 ;; from initial-frame-alist, default-frame-alist, or X resource.
1230 ;; A font specification in command line argument (i.e. -fn XXXX)
1231 ;; should be already in default-frame-alist as a `font'
1232 ;; parameter. However, any font specifications in site-start
1233 ;; library, user's init file (.emacs), and default.el are not
1234 ;; yet handled here.
1236 (let ((font (or (cdr (assq 'font initial-frame-alist))
1237 (cdr (assq 'font default-frame-alist))
1238 (x-get-resource "font" "Font")))
1239 xlfd-fields resolved-name)
1241 (not (query-fontset font))
1242 (setq resolved-name (x-resolve-font-name font))
1243 (setq xlfd-fields (x-decompose-font-name font)))
1244 (if (string= "fontset"
1245 (aref xlfd-fields xlfd-regexp-registry-subnum))
1247 (x-complement-fontset-spec xlfd-fields nil))
1248 ;; Create a fontset from FONT. The fontset name is
1249 ;; generated from FONT.
1250 (create-fontset-from-ascii-font font
1251 resolved-name "startup"))))))
1253 ;; Apply a geometry resource to the initial frame. Put it at the end
1254 ;; of the alist, so that anything specified on the command line takes
1256 (let* ((res-geometry (x-get-resource "geometry" "Geometry"))
1260 (setq parsed (x-parse-geometry res-geometry))
1261 ;; If the resource specifies a position,
1262 ;; call the position and size "user-specified".
1263 (if (or (assq 'top parsed) (assq 'left parsed))
1264 (setq parsed (cons '(user-position . t)
1265 (cons '(user-size . t) parsed))))
1266 ;; All geometry parms apply to the initial frame.
1267 (setq initial-frame-alist (append initial-frame-alist parsed))
1268 ;; The size parms apply to all frames.
1269 (if (assq 'height parsed)
1270 (setq default-frame-alist
1271 (cons (cons 'height (cdr (assq 'height parsed)))
1272 default-frame-alist)))
1273 (if (assq 'width parsed)
1274 (setq default-frame-alist
1275 (cons (cons 'width (cdr (assq 'width parsed)))
1276 default-frame-alist))))))
1278 ;; Check the reverseVideo resource.
1279 (let ((case-fold-search t))
1280 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
1282 (string-match "^\\(true\\|yes\\|on\\)$" rv))
1283 (setq default-frame-alist
1284 (cons '(reverse . t) default-frame-alist)))))
1286 (defun x-win-suspend-error ()
1287 "Report an error when a suspend is attempted."
1288 (error "Suspending an Emacs running under W32 makes no sense"))
1289 (add-hook 'suspend-hook 'x-win-suspend-error)
1291 ;;; Turn off window-splitting optimization; w32 is usually fast enough
1292 ;;; that this is only annoying.
1293 (setq split-window-keep-point t)
1295 ;; Don't show the frame name; that's redundant.
1296 (setq-default mode-line-frame-identification " ")
1298 ;;; Set to a system sound if you want a fancy bell.
1299 (set-message-beep 'ok)
1301 ;; Remap some functions to call w32 common dialogs
1303 (defun internal-face-interactive (what &optional bool)
1304 (let* ((fn (intern (concat "face-" what)))
1305 (prompt (concat "Set " what " of face "))
1306 (face (read-face-name prompt))
1307 (default (if (fboundp fn)
1308 (or (funcall fn face (selected-frame))
1309 (funcall fn 'default (selected-frame)))))
1310 (fn-win (intern (concat (symbol-name window-system) "-select-" what)))
1313 (cond ((fboundp fn-win)
1316 (completing-read (concat prompt " " (symbol-name face) " to: ")
1317 (mapcar (function (lambda (color)
1318 (cons color color)))
1320 nil nil nil nil default))
1322 (y-or-n-p (concat "Should face " (symbol-name face)
1325 (read-string (concat prompt " " (symbol-name face) " to: ")
1327 (list face (if (equal value "") nil value))))
1329 ;; Redefine the font selection to use the standard W32 dialog
1330 (defvar w32-use-w32-font-dialog t
1331 "*Use the standard font dialog if 't'.
1332 Otherwise pop up a menu of some standard fonts like X does - including
1335 (defvar w32-fixed-font-alist
1338 ;; For these, we specify the pixel height and width.
1339 ("fixed" "Fixedsys")
1342 "-*-Terminal-normal-r-*-*-*-45-*-*-c-40-*-oem")
1344 "-*-Terminal-normal-r-*-*-*-60-*-*-c-80-*-oem")
1346 "-*-Terminal-normal-r-*-*-*-90-*-*-c-50-*-oem")
1348 "-*-Terminal-normal-r-*-*-*-90-*-*-c-70-*-oem")
1350 "-*-Terminal-normal-r-*-*-*-90-*-*-c-80-*-oem")
1352 "-*-Terminal-normal-r-*-*-*-120-*-*-c-120-*-oem")
1354 "-*-Terminal-normal-r-*-*-*-135-*-*-c-100-*-oem")
1355 ("Terminal 6x6 Bold"
1356 "-*-Terminal-bold-r-*-*-*-60-*-*-c-60-*-oem")
1358 ("Lucida Sans Typewriter.8"
1359 "-*-Lucida Sans Typewriter-normal-r-*-*-11-*-*-*-c-*-iso8859-1")
1360 ("Lucida Sans Typewriter.9"
1361 "-*-Lucida Sans Typewriter-normal-r-*-*-12-*-*-*-c-*-iso8859-1")
1362 ("Lucida Sans Typewriter.10"
1363 "-*-Lucida Sans Typewriter-normal-r-*-*-13-*-*-*-c-*-iso8859-1")
1364 ("Lucida Sans Typewriter.11"
1365 "-*-Lucida Sans Typewriter-normal-r-*-*-15-*-*-*-c-*-iso8859-1")
1366 ("Lucida Sans Typewriter.12"
1367 "-*-Lucida Sans Typewriter-normal-r-*-*-16-*-*-*-c-*-iso8859-1")
1368 ("Lucida Sans Typewriter.8 Bold"
1369 "-*-Lucida Sans Typewriter-semibold-r-*-*-11-*-*-*-c-*-iso8859-1")
1370 ("Lucida Sans Typewriter.9 Bold"
1371 "-*-Lucida Sans Typewriter-semibold-r-*-*-12-*-*-*-c-*-iso8859-1")
1372 ("Lucida Sans Typewriter.10 Bold"
1373 "-*-Lucida Sans Typewriter-semibold-r-*-*-13-*-*-*-c-*-iso8859-1")
1374 ("Lucida Sans Typewriter.11 Bold"
1375 "-*-Lucida Sans Typewriter-semibold-r-*-*-15-*-*-*-c-*-iso8859-1")
1376 ("Lucida Sans Typewriter.12 Bold"
1377 "-*-Lucida Sans Typewriter-semibold-r-*-*-16-*-*-*-c-*-iso8859-1"))
1380 "-*-Courier-*normal-r-*-*-*-97-*-*-c-80-iso8859-1")
1382 "-*-Courier-*normal-r-*-*-*-120-*-*-c-90-iso8859-1")
1384 "-*-Courier-*normal-r-*-*-*-150-*-*-c-120-iso8859-1")
1385 ;; For these, we specify the point height.
1387 ("8" "-*-Courier New-normal-r-*-*-11-*-*-*-c-*-iso8859-1")
1388 ("9" "-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-1")
1389 ("10" "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-iso8859-1")
1390 ("11" "-*-Courier New-normal-r-*-*-15-*-*-*-c-*-iso8859-1")
1391 ("12" "-*-Courier New-normal-r-*-*-16-*-*-*-c-*-iso8859-1")
1392 ("8 bold" "-*-Courier New-bold-r-*-*-11-*-*-*-c-*-iso8859-1")
1393 ("9 bold" "-*-Courier New-bold-r-*-*-12-*-*-*-c-*-iso8859-1")
1394 ("10 bold" "-*-Courier New-bold-r-*-*-13-*-*-*-c-*-iso8859-1")
1395 ("11 bold" "-*-Courier New-bold-r-*-*-15-*-*-*-c-*-iso8859-1")
1396 ("12 bold" "-*-Courier New-bold-r-*-*-16-*-*-*-c-*-iso8859-1")
1397 ("8 italic" "-*-Courier New-normal-i-*-*-11-*-*-*-c-*-iso8859-1")
1398 ("9 italic" "-*-Courier New-normal-i-*-*-12-*-*-*-c-*-iso8859-1")
1399 ("10 italic" "-*-Courier New-normal-i-*-*-13-*-*-*-c-*-iso8859-1")
1400 ("11 italic" "-*-Courier New-normal-i-*-*-15-*-*-*-c-*-iso8859-1")
1401 ("12 italic" "-*-Courier New-normal-i-*-*-16-*-*-*-c-*-iso8859-1")
1402 ("8 bold italic" "-*-Courier New-bold-i-*-*-11-*-*-*-c-*-iso8859-1")
1403 ("9 bold italic" "-*-Courier New-bold-i-*-*-12-*-*-*-c-*-iso8859-1")
1404 ("10 bold italic" "-*-Courier New-bold-i-*-*-13-*-*-*-c-*-iso8859-1")
1405 ("11 bold italic" "-*-Courier New-bold-i-*-*-15-*-*-*-c-*-iso8859-1")
1406 ("12 bold italic" "-*-Courier New-bold-i-*-*-16-*-*-*-c-*-iso8859-1")
1408 "Fonts suitable for use in Emacs.
1409 Initially this is a list of some fixed width fonts that most people
1410 will have like Terminal and Courier. These fonts are used in the font
1411 menu if the variable `w32-use-w32-font-dialog' is nil.")
1413 ;;; Enable Japanese fonts on Windows to be used by default.
1414 (set-fontset-font t (make-char 'katakana-jisx0201) '("*" . "JISX0208-SJIS"))
1415 (set-fontset-font t (make-char 'latin-jisx0201) '("*" . "JISX0208-SJIS"))
1416 (set-fontset-font t (make-char 'japanese-jisx0208) '("*" . "JISX0208-SJIS"))
1417 (set-fontset-font t (make-char 'japanese-jisx0208-1978) '("*" . "JISX0208-SJIS"))
1419 (defun mouse-set-font (&rest fonts)
1421 If `w32-use-w32-font-dialog' is non-nil (the default), use the Windows
1422 font dialog to get the matching FONTS. Otherwise use a pop-up menu
1423 \(like Emacs on other platforms) initialized with the fonts in
1424 `w32-fixed-font-alist'."
1426 (if w32-use-w32-font-dialog
1427 (let ((chosen-font (w32-select-font)))
1428 (and chosen-font (list chosen-font)))
1431 ;; Append list of fontsets currently defined.
1432 (if (fboundp 'new-fontset)
1433 (append w32-fixed-font-alist (list (generate-fontset-menu)))))))
1439 (setq font (car fonts))
1440 (set-default-font font)
1442 (error (setq fonts (cdr fonts)))))
1444 (error "Font not found")))))
1446 ;;; w32-win.el ends here