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 EVENT 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 window in which EVENT occurred 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 window in which EVENT occurred 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."
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)))
166 (if (and (> x 0) (> y 0))
167 (set-frame-selected-window nil window))
168 (mapcar 'find-file (car (cdr (cdr event)))))
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."
176 (mapcar 'find-file-other-frame (car (cdr (cdr event)))))
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)
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)
188 (defvar x-invocation-args)
190 (defvar x-command-line-resources nil)
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)))
221 (defconst x-long-option-alist
222 '(("--border-width" . "-bw")
226 ("--reverse-video" . "-reverse")
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")
236 ("--cursor-color" . "-cr")
237 ("--vertical-scroll-bars" . "-vb")
238 ("--border-color" . "-bd")))
240 (defconst x-switch-definitions
245 ("-reverse" reverse t)
248 ("-ib" internal-border-width)
249 ("-fg" foreground-color)
250 ("-foreground" foreground-color)
251 ("-bg" background-color)
252 ("-background" background-color)
255 ("-itype" icon-type t)
257 ("-vb" vertical-scroll-bars t)
258 ("-hb" horizontal-scroll-bars t)
260 ("-bw" border-width)))
263 (defun x-handle-switch (switch)
264 "Handle SWITCH of the form \"-switch value\" or \"-switch\"."
265 (let ((aelt (assoc switch x-switch-definitions)))
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))
275 x-invocation-args (cdr x-invocation-args))))))
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)))
283 (defun x-handle-numeric-switch (switch)
284 "Handle SWITCH of the form \"-switch n\"."
285 (let ((aelt (assoc switch x-switch-definitions)))
287 (setq default-frame-alist
288 (cons (cons (nth 1 aelt)
289 (string-to-int (car x-invocation-args)))
292 (cdr x-invocation-args)))))
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)))
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
312 (if height (list height))
313 (if width (list width)))))
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))))
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))))
335 (defvar x-display-name nil
336 "The display name specifying server and frame.")
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)))
343 (defvar x-invocation-args nil)
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
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.
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))
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)))
392 (defvar x-colors '("LightGreen"
991 "LightGoldenrodYellow"
992 "light goldenrod yellow"
1009 "medium spring green"
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")
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))
1153 (defined-colors nil))
1154 (message "Defining 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))))
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)))
1170 (defun iconify-or-deiconify-frame ()
1171 "Iconify the selected frame, or deiconify if it's currently an icon."
1173 (if (eq (cdr (assq 'visibility (frame-parameters))) t)
1175 (make-frame-visible)))
1177 (substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
1181 ;;; Do the actual Windows setup here; the above code just defines
1182 ;;; functions and variables that we use now.
1184 (setq command-line-args (x-handle-args command-line-args))
1186 ;;; Make sure we have a valid resource name.
1187 (or (stringp x-resource-name)
1189 (setq x-resource-name (invocation-name))
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 ?-))))
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.
1204 (x-open-connection ""
1205 x-command-line-resources))
1207 (setq frame-creation-function 'x-create-frame-with-faces)
1209 (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100)
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)
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\".
1225 See the documentation of `create-fontset-from-fontset-spec for the format.")
1227 (if (fboundp 'new-fontset)
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.
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)
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))
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"))))))
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
1261 (let* ((res-geometry (x-get-resource "geometry" "Geometry"))
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))))))
1283 ;; Check the reverseVideo resource.
1284 (let ((case-fold-search t))
1285 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
1287 (string-match "^\\(true\\|yes\\|on\\)$" rv))
1288 (setq default-frame-alist
1289 (cons '(reverse . t) default-frame-alist)))))
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)
1296 ;;; Turn off window-splitting optimization; w32 is usually fast enough
1297 ;;; that this is only annoying.
1298 (setq split-window-keep-point t)
1300 ;; Don't show the frame name; that's redundant.
1301 (setq-default mode-line-frame-identification " ")
1303 ;;; Set to a system sound if you want a fancy bell.
1304 (set-message-beep 'ok)
1306 ;; Remap some functions to call w32 common dialogs
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)))
1318 (cond ((fboundp fn-win)
1321 (completing-read (concat prompt " " (symbol-name face) " to: ")
1322 (mapcar (function (lambda (color)
1323 (cons color color)))
1325 nil nil nil nil default))
1327 (y-or-n-p (concat "Should face " (symbol-name face)
1330 (read-string (concat prompt " " (symbol-name face) " to: ")
1332 (list face (if (equal value "") nil value))))
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
1340 (defvar w32-fixed-font-alist
1343 ;; For these, we specify the pixel height and width.
1344 ("fixed" "Fixedsys")
1347 "-*-Terminal-normal-r-*-*-*-45-*-*-c-40-*-oem")
1349 "-*-Terminal-normal-r-*-*-*-60-*-*-c-80-*-oem")
1351 "-*-Terminal-normal-r-*-*-*-90-*-*-c-50-*-oem")
1353 "-*-Terminal-normal-r-*-*-*-90-*-*-c-70-*-oem")
1355 "-*-Terminal-normal-r-*-*-*-90-*-*-c-80-*-oem")
1357 "-*-Terminal-normal-r-*-*-*-120-*-*-c-120-*-oem")
1359 "-*-Terminal-normal-r-*-*-*-135-*-*-c-100-*-oem")
1360 ("Terminal 6x6 Bold"
1361 "-*-Terminal-bold-r-*-*-*-60-*-*-c-60-*-oem")
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"))
1385 "-*-Courier-*normal-r-*-*-*-97-*-*-c-80-iso8859-1")
1387 "-*-Courier-*normal-r-*-*-*-120-*-*-c-90-iso8859-1")
1389 "-*-Courier-*normal-r-*-*-*-150-*-*-c-120-iso8859-1")
1390 ;; For these, we specify the point height.
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")
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.")
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"))
1424 (defun mouse-set-font (&rest fonts)
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'."
1431 (if w32-use-w32-font-dialog
1432 (let ((chosen-font (w32-select-font)))
1433 (and chosen-font (list chosen-font)))
1436 ;; Append list of fontsets currently defined.
1437 (if (fboundp 'new-fontset)
1438 (append w32-fixed-font-alist (list (generate-fontset-menu)))))))
1444 (setq font (car fonts))
1445 (set-default-font font)
1447 (error (setq fonts (cdr fonts)))))
1449 (error "Font not found")))))
1451 ;;; w32-win.el ends here