]> code.delx.au - gnu-emacs/blob - doc/emacs/msdos.texi
; Merge from origin/emacs-25
[gnu-emacs] / doc / emacs / msdos.texi
1 @c This is part of the Emacs manual.
2 @c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2016 Free Software
3 @c Foundation, Inc.
4 @c See file emacs.texi for copying conditions.
5 @node Microsoft Windows
6 @appendix Emacs and Microsoft Windows/MS-DOS
7 @cindex Microsoft Windows
8 @cindex MS-Windows, Emacs peculiarities
9
10 This section describes peculiarities of using Emacs on Microsoft
11 Windows. Some of these peculiarities are also relevant to Microsoft's
12 older MS-DOS operating system.
13 However, Emacs features that are relevant @emph{only} to MS-DOS are
14 described in a separate
15 @iftex
16 manual (@pxref{MS-DOS,,, emacs-xtra, Specialized Emacs Features}).
17 @end iftex
18 @ifnottex
19 section (@pxref{MS-DOS}).
20 @end ifnottex
21
22
23 The behavior of Emacs on MS-Windows is reasonably similar to what is
24 documented in the rest of the manual, including support for long file
25 names, multiple frames, scroll bars, mouse menus, and subprocesses.
26 However, a few special considerations apply, and they are described
27 here.
28
29 @menu
30 * Windows Startup:: How to start Emacs on Windows.
31 * Text and Binary:: Text files use CRLF to terminate lines.
32 * Windows Files:: File-name conventions on Windows.
33 * ls in Lisp:: Emulation of @code{ls} for Dired.
34 * Windows HOME:: Where Emacs looks for your @file{.emacs} and
35 where it starts up.
36 * Windows Keyboard:: Windows-specific keyboard features.
37 * Windows Mouse:: Windows-specific mouse features.
38 * Windows Processes:: Running subprocesses on Windows.
39 * Windows Printing:: How to specify the printer on MS-Windows.
40 * Windows Fonts:: Specifying fonts on MS-Windows.
41 * Windows Misc:: Miscellaneous Windows features.
42 @ifnottex
43 * MS-DOS:: Using Emacs on MS-DOS.
44 @end ifnottex
45 @end menu
46
47 @node Windows Startup
48 @section How to Start Emacs on MS-Windows
49 @cindex starting Emacs on MS-Windows
50
51 There are several ways of starting Emacs on MS-Windows:
52
53 @enumerate
54 @item
55 @pindex runemacs.exe
56 @cindex desktop shortcut, MS-Windows
57 @cindex start directory, MS-Windows
58 @cindex directory where Emacs starts on MS-Windows
59 From the desktop shortcut icon: either double-click the left mouse
60 button on the icon, or click once, then press @key{RET}. The desktop
61 shortcut should specify as its ``Target'' (in the ``Properties'' of
62 the shortcut) the full absolute file name of @file{runemacs.exe},
63 @emph{not} of @file{emacs.exe}. This is because @file{runemacs.exe}
64 hides the console window that would have been created if the target of
65 the shortcut were @file{emacs.exe} (which is a console program, as far
66 as Windows is concerned). If you use this method, Emacs starts in the
67 directory specified by the shortcut. To control where that is,
68 right-click on the shortcut, select ``Properties'', and in the
69 ``Shortcut'' tab modify the ``Start in'' field to your liking.
70
71 @item
72 From the Command Prompt window, by typing @kbd{emacs @key{RET}} at the
73 prompt. The Command Prompt window where you did that will not be
74 available for invoking other commands until Emacs exits. In this
75 case, Emacs will start in the current directory of the Windows shell.
76
77 @item
78 From the Command Prompt window, by typing @kbd{runemacs @key{RET}} at
79 the prompt. The Command Prompt window where you did that will be
80 immediately available for invoking other commands. In this case,
81 Emacs will start in the current directory of the Windows shell.
82
83 @item
84 @cindex invoking Emacs from Windows Explorer
85 @pindex emacsclient.exe
86 @pindex emacsclientw.exe
87 Via @file{emacsclient.exe} or @file{emacsclientw.exe}, which allow you
88 to invoke Emacs from other programs, and to reuse a running Emacs
89 process for serving editing jobs required by other programs.
90 @xref{Emacs Server}. The difference between @file{emacsclient.exe}
91 and @file{emacsclientw.exe} is that the former is a console program,
92 while the latter is a Windows GUI program. Both programs wait for
93 Emacs to signal that the editing job is finished, before they exit and
94 return control to the program that invoked them. Which one of them to
95 use in each case depends on the expectations of the program that needs
96 editing services. If that program is itself a console (text-mode)
97 program, you should use @file{emacsclient.exe}, so that any of its
98 messages and prompts appear in the same command window as those of the
99 invoking program. By contrast, if the invoking program is a GUI
100 program, you will be better off using @file{emacsclientw.exe}, because
101 @file{emacsclient.exe} will pop up a command window if it is invoked
102 from a GUI program. A notable situation where you would want
103 @file{emacsclientw.exe} is when you right-click on a file in the
104 Windows Explorer and select ``Open With'' from the pop-up menu. Use
105 the @samp{--alternate-editor=} or @samp{-a} options if Emacs might not
106 be running (or not running as a server) when @command{emacsclient} is
107 invoked---that will always give you an editor. When invoked via
108 @command{emacsclient}, Emacs will start in the current directory of
109 the program that invoked @command{emacsclient}.
110 @end enumerate
111
112 @cindex emacsclient, on MS-Windows
113 Note that, due to limitations of MS-Windows, Emacs cannot have both
114 GUI and text-mode frames in the same session. It also cannot open
115 text-mode frames on more than a single @dfn{Command Prompt} window,
116 because each Windows program can have only one console at any given
117 time. For these reasons, if you invoke @command{emacsclient} with the
118 @option{-c} option, and the Emacs server runs in a text-mode session,
119 Emacs will always create a new text-mode frame in the same
120 @dfn{Command Prompt} window where it was started; a GUI frame will be
121 created only if the server runs in a GUI session. Similarly, if you
122 invoke @command{emacsclient} with the @option{-t} option, Emacs will
123 create a GUI frame if the server runs in a GUI session, or a text-mode
124 frame when the session runs in text mode in a @dfn{Command Prompt}
125 window. @xref{emacsclient Options}.
126
127 @node Text and Binary
128 @section Text Files and Binary Files
129 @cindex text and binary files on MS-DOS/MS-Windows
130
131 GNU Emacs uses newline characters to separate text lines. This is the
132 convention used on GNU, Unix, and other Posix-compliant systems.
133
134 @cindex end-of-line conversion on MS-DOS/MS-Windows
135 By contrast, MS-DOS and MS-Windows normally use carriage-return linefeed,
136 a two-character sequence, to separate text lines. (Linefeed is the same
137 character as newline.) Therefore, convenient editing of typical files
138 with Emacs requires conversion of these end-of-line (EOL) sequences.
139 And that is what Emacs normally does: it converts carriage-return
140 linefeed into newline when reading files, and converts newline into
141 carriage-return linefeed when writing files. The same mechanism that
142 handles conversion of international character codes does this conversion
143 also (@pxref{Coding Systems}).
144
145 @cindex cursor location, on MS-DOS
146 @cindex point location, on MS-DOS
147 One consequence of this special format-conversion of most files is
148 that character positions as reported by Emacs (@pxref{Position Info}) do
149 not agree with the file size information known to the operating system.
150
151 In addition, if Emacs recognizes from a file's contents that it uses
152 newline rather than carriage-return linefeed as its line separator, it
153 does not perform EOL conversion when reading or writing that file.
154 Thus, you can read and edit files from GNU and Unix systems on MS-DOS
155 with no special effort, and they will retain their Unix-style
156 end-of-line convention after you edit them.
157
158 The mode line indicates whether end-of-line translation was used for
159 the current buffer. If MS-DOS end-of-line translation is in use for the
160 buffer, the MS-Windows build of Emacs displays a backslash @samp{\} after
161 the coding system mnemonic near the beginning of the mode line
162 (@pxref{Mode Line}). If no EOL translation was performed, the string
163 @samp{(Unix)} is displayed instead of the backslash, to alert you that the
164 file's EOL format is not the usual carriage-return linefeed.
165
166 @cindex DOS-to-Unix conversion of files
167 To visit a file and specify whether it uses DOS-style or Unix-style
168 end-of-line, specify a coding system (@pxref{Text Coding}). For
169 example, @kbd{C-x @key{RET} c unix @key{RET} C-x C-f foobar.txt}
170 visits the file @file{foobar.txt} without converting the EOLs; if some
171 line ends with a carriage-return linefeed pair, Emacs will display
172 @samp{^M} at the end of that line. Similarly, you can direct Emacs to
173 save a buffer in a specified EOL format with the @kbd{C-x @key{RET} f}
174 command. For example, to save a buffer with Unix EOL format, type
175 @kbd{C-x @key{RET} f unix @key{RET} C-x C-s}. If you visit a file
176 with DOS EOL conversion, then save it with Unix EOL format, that
177 effectively converts the file to Unix EOL style, like the
178 @code{dos2unix} program.
179
180 @cindex untranslated file system
181 @findex add-untranslated-filesystem
182 When you use NFS, Samba, or some other similar method to access file
183 systems that reside on computers using GNU or Unix systems, Emacs
184 should not perform end-of-line translation on any files in these file
185 systems---not even when you create a new file. To request this,
186 designate these file systems as @dfn{untranslated} file systems by
187 calling the function @code{add-untranslated-filesystem}. It takes one
188 argument: the file system name, including a drive letter and
189 optionally a directory. For example,
190
191 @example
192 (add-untranslated-filesystem "Z:")
193 @end example
194
195 @noindent
196 designates drive Z as an untranslated file system, and
197
198 @example
199 (add-untranslated-filesystem "Z:\\foo")
200 @end example
201
202 @noindent
203 designates directory @file{\foo} on drive Z as an untranslated file
204 system.
205
206 Most often you would use @code{add-untranslated-filesystem} in your
207 @file{.emacs} file, or in @file{site-start.el} so that all the users at
208 your site get the benefit of it.
209
210 @findex remove-untranslated-filesystem
211 To countermand the effect of @code{add-untranslated-filesystem}, use
212 the function @code{remove-untranslated-filesystem}. This function takes
213 one argument, which should be a string just like the one that was used
214 previously with @code{add-untranslated-filesystem}.
215
216 Designating a file system as untranslated does not affect character
217 set conversion, only end-of-line conversion. Essentially, it directs
218 Emacs to create new files with the Unix-style convention of using
219 newline at the end of a line. @xref{Coding Systems}.
220
221 @node Windows Files
222 @section File Names on MS-Windows
223 @cindex file names on MS-Windows
224
225 MS-Windows and MS-DOS normally use a backslash, @samp{\}, to
226 separate name units within a file name, instead of the slash used on
227 other systems. Emacs on MS-DOS/MS-Windows permits use of either slash or
228 backslash, and also knows about drive letters in file names.
229
230 @cindex file-name completion, on MS-Windows
231 On MS-DOS/MS-Windows, file names are case-insensitive, so Emacs by
232 default ignores letter-case in file names during completion.
233
234 @vindex w32-get-true-file-attributes
235 The variable @code{w32-get-true-file-attributes} controls whether
236 Emacs should issue additional system calls to determine more
237 accurately file attributes in primitives like @code{file-attributes}
238 and @code{directory-files-and-attributes}. These additional calls are
239 needed to report correct file ownership, link counts and file types
240 for special files such as pipes. Without these system calls, file
241 ownership will be attributed to the current user, link counts will be
242 always reported as 1, and special files will be reported as regular
243 files.
244
245 If the value of this variable is @code{local} (the default), Emacs
246 will issue these additional system calls only for files on local fixed
247 drives. Any other non-@code{nil} value means do this even for
248 removable and remote volumes, where this could potentially slow down
249 Dired and other related features. The value of @code{nil} means never
250 issue those system calls. Non-@code{nil} values are more useful on
251 NTFS volumes, which support hard links and file security, than on FAT,
252 FAT32, and exFAT volumes.
253
254 @cindex file names, invalid characters on MS-Windows
255 Unlike Unix, MS-Windows file systems restrict the set of characters
256 that can be used in a file name. The following characters are not
257 allowed:
258
259 @itemize @bullet
260 @item
261 Shell redirection symbols @samp{<}, @samp{>}, and @samp{|}.
262
263 @item
264 Colon @samp{:} (except after the drive letter).
265
266 @item
267 Forward slash @samp{/} and backslash @samp{\} (except as directory
268 separators).
269
270 @item
271 Wildcard characters @samp{*} and @samp{?}.
272
273 @item
274 Control characters whose codepoints are 1 through 31 decimal. In
275 particular, newlines in file names are not allowed.
276
277 @item
278 The null character, whose codepoint is zero (this limitation exists on
279 Unix filesystems as well).
280 @end itemize
281
282 @noindent
283 In addition, referencing any file whose name matches a DOS character
284 device, such as @file{NUL} or @file{LPT1} or @file{PRN} or @file{CON},
285 with or without any file-name extension, will always resolve to those
286 character devices, in any directory. Therefore, only use such file
287 names when you want to use the corresponding character device.
288
289 @node ls in Lisp
290 @section Emulation of @code{ls} on MS-Windows
291 @cindex Dired, and MS-Windows/MS-DOS
292 @cindex @code{ls} emulation
293
294 Dired normally uses the external program @code{ls}
295 to produce the directory listing displayed in Dired
296 buffers (@pxref{Dired}). However, MS-Windows and MS-DOS systems don't
297 come with such a program, although several ports of @sc{gnu} @code{ls}
298 are available. Therefore, Emacs on those systems @emph{emulates}
299 @code{ls} in Lisp, by using the @file{ls-lisp.el} package. While
300 @file{ls-lisp.el} provides a reasonably full emulation of @code{ls},
301 there are some options and features peculiar to that emulation;
302 @iftex
303 for more details, see the documentation of the variables whose names
304 begin with @code{ls-lisp}.
305 @end iftex
306 @ifnottex
307 they are described in this section.
308
309 The @code{ls} emulation supports many of the @code{ls} switches, but
310 it doesn't support all of them. Here's the list of the switches it
311 does support: @option{-A}, @option{-a}, @option{-B}, @option{-C},
312 @option{-c}, @option{-G}, @option{-g}, @option{-h}, @option{-i}, @option{-n},
313 @option{-R}, @option{-r}, @option{-S}, @option{-s}, @option{-t}, @option{-U},
314 @option{-u}, and @option{-X}. The @option{-F} switch is partially
315 supported (it appends the character that classifies the file, but does
316 not prevent symlink following).
317
318 @vindex ls-lisp-use-insert-directory-program
319 On MS-Windows and MS-DOS, @file{ls-lisp.el} is preloaded when Emacs
320 is built, so the Lisp emulation of @code{ls} is always used on those
321 platforms. If you have a ported @code{ls}, setting
322 @code{ls-lisp-use-insert-directory-program} to a non-@code{nil} value
323 will revert to using an external program named by the variable
324 @code{insert-directory-program}.
325
326 @vindex ls-lisp-ignore-case
327 By default, @file{ls-lisp.el} uses a case-sensitive sort order for
328 the directory listing it produces; this is so the listing looks the
329 same as on other platforms. If you wish that the files be sorted in
330 case-insensitive order, set the variable @code{ls-lisp-ignore-case} to
331 a non-@code{nil} value.
332
333 @vindex ls-lisp-dirs-first
334 By default, files and subdirectories are sorted together, to emulate
335 the behavior of @code{ls}. However, native MS-Windows/MS-DOS file
336 managers list the directories before the files; if you want that
337 behavior, customize the option @code{ls-lisp-dirs-first} to a
338 non-@code{nil} value.
339
340 @vindex ls-lisp-verbosity
341 The variable @code{ls-lisp-verbosity} controls the file attributes
342 that @file{ls-lisp.el} displays. The value should be a list that
343 contains one or more of the symbols @code{links}, @code{uid}, and
344 @code{gid}. @code{links} means display the count of different file
345 names that are associated with (a.k.a.@: @dfn{links to}) the file's
346 data; this is only useful on NTFS volumes. @code{uid} means display
347 the numerical identifier of the user who owns the file. @code{gid}
348 means display the numerical identifier of the file owner's group. The
349 default value is @code{(links uid gid)} i.e., all the 3 optional
350 attributes are displayed.
351
352 @vindex ls-lisp-emulation
353 The variable @code{ls-lisp-emulation} controls the flavor of the
354 @code{ls} emulation by setting the defaults for the 3 options
355 described above: @code{ls-lisp-ignore-case},
356 @code{ls-lisp-dirs-first}, and @code{ls-lisp-verbosity}. The value of
357 this option can be one of the following symbols:
358
359 @table @code
360 @item GNU
361 @itemx nil
362 Emulate @sc{gnu} systems; this is the default. This sets
363 @code{ls-lisp-ignore-case} and @code{ls-lisp-dirs-first} to
364 @code{nil}, and @code{ls-lisp-verbosity} to @code{(links uid gid)}.
365 @item UNIX
366 Emulate Unix systems. Like @code{GNU}, but sets
367 @code{ls-lisp-verbosity} to @code{(links uid)}.
368 @item MacOS
369 Emulate MacOS@. Sets @code{ls-lisp-ignore-case} to @code{t}, and
370 @code{ls-lisp-dirs-first} and @code{ls-lisp-verbosity} to @code{nil}.
371 @item MS-Windows
372 Emulate MS-Windows. Sets @code{ls-lisp-ignore-case} and
373 @code{ls-lisp-dirs-first} to @code{t}, and @code{ls-lisp-verbosity} to
374 @code{(links)} on Windows NT/2K/XP/2K3 and to @code{nil} on Windows 9X@.
375 Note that the default emulation is @emph{not} @code{MS-Windows}, even
376 on Windows, since many users of Emacs on those platforms prefer the
377 @sc{gnu} defaults.
378 @end table
379
380 @noindent
381 Any other value of @code{ls-lisp-emulation} means the same as @code{GNU}.
382 Customizing this option calls the function @code{ls-lisp-set-options} to
383 update the 3 dependent options as needed. If you change the value of
384 this variable without using customize after @file{ls-lisp.el} is loaded
385 (note that it is preloaded on MS-Windows and MS-DOS), you can call that
386 function manually for the same result.
387
388 @vindex ls-lisp-support-shell-wildcards
389 The variable @code{ls-lisp-support-shell-wildcards} controls how
390 file-name patterns are supported: if it is non-@code{nil} (the
391 default), they are treated as shell-style wildcards; otherwise they
392 are treated as Emacs regular expressions.
393
394 @vindex ls-lisp-format-time-list
395 The variable @code{ls-lisp-format-time-list} defines how to format
396 the date and time of files. @emph{The value of this variable is
397 ignored}, unless Emacs cannot determine the current locale. (However,
398 if the value of @code{ls-lisp-use-localized-time-format} is
399 non-@code{nil}, Emacs obeys @code{ls-lisp-format-time-list} even if
400 the current locale is available; see below.)
401
402 The value of @code{ls-lisp-format-time-list} is a list of 2 strings.
403 The first string is used if the file was modified within the current
404 year, while the second string is used for older files. In each of
405 these two strings you can use @samp{%}-sequences to substitute parts
406 of the time. For example:
407 @lisp
408 ("%b %e %H:%M" "%b %e %Y")
409 @end lisp
410
411 @noindent
412 Note that the strings substituted for these @samp{%}-sequences depend
413 on the current locale. @xref{Time Parsing,,, elisp, The Emacs Lisp
414 Reference Manual}, for more about format time specs.
415
416 @vindex ls-lisp-use-localized-time-format
417 Normally, Emacs formats the file time stamps in either traditional
418 or ISO-style time format. However, if the value of the variable
419 @code{ls-lisp-use-localized-time-format} is non-@code{nil}, Emacs
420 formats file time stamps according to what
421 @code{ls-lisp-format-time-list} specifies. The @samp{%}-sequences in
422 @code{ls-lisp-format-time-list} produce locale-dependent month and day
423 names, which might cause misalignment of columns in Dired display.
424 @end ifnottex
425
426 @node Windows HOME
427 @section HOME and Startup Directories on MS-Windows
428 @cindex HOME directory on MS-Windows
429
430 The Windows equivalent of @code{HOME} is the @dfn{user-specific
431 application data directory}. The actual location depends on the
432 Windows version; typical values are @file{C:\Documents and
433 Settings\@var{username}\Application Data} on Windows 2000/XP/2K3,
434 @file{C:\Users\@var{username}\AppData\Roaming} on Windows
435 Vista/7/2008, and either @file{C:\WINDOWS\Application Data} or
436 @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on Windows
437 9X/ME@. If this directory does not exist or cannot be accessed, Emacs
438 falls back to @file{C:\} as the default value of @code{HOME}.
439
440 You can override this default value of @code{HOME} by explicitly
441 setting the environment variable @env{HOME} to point to any directory
442 on your system. @env{HOME} can be set either from the command shell
443 prompt or from @samp{Properties} dialog of @samp{My Computer}.
444 @code{HOME} can also be set in the system registry,
445 @pxref{MS-Windows Registry}.
446
447 For compatibility with older versions of Emacs@footnote{
448 Older versions of Emacs didn't check the application data directory.
449 }, if there is a file named @file{.emacs} in @file{C:\}, the root
450 directory of drive @file{C:}, and @env{HOME} is set neither in the
451 environment nor in the Registry, Emacs will treat @file{C:\} as the
452 default @code{HOME} location, and will not look in the application
453 data directory, even if it exists. Note that only @file{.emacs} is
454 looked for in @file{C:\}; the older name @file{_emacs} (see below) is
455 not. This use of @file{C:\.emacs} to define @code{HOME} is
456 deprecated.
457
458 Whatever the final place is, Emacs sets the internal value of the
459 @env{HOME} environment variable to point to it, and it will use that
460 location for other files and directories it normally looks for or
461 creates in your home directory.
462
463 You can always find out what Emacs thinks is your home directory's
464 location by typing @kbd{C-x d ~/ @key{RET}}. This should present the
465 list of files in the home directory, and show its full name on the
466 first line. Likewise, to visit your init file, type @kbd{C-x C-f
467 ~/.emacs @key{RET}} (assuming the file's name is @file{.emacs}).
468
469 @cindex init file @file{.emacs} on MS-Windows
470 The home directory is where your init file is stored. It can have
471 any name mentioned in @ref{Init File}.
472
473 @cindex @file{_emacs} init file, MS-Windows
474 Because MS-DOS does not allow file names with leading dots, and
475 older Windows systems made it hard to create files with such names,
476 the Windows port of Emacs supports an init file name @file{_emacs}, if
477 such a file exists in the home directory and @file{.emacs} does not.
478 This name is considered obsolete.
479
480 @node Windows Keyboard
481 @section Keyboard Usage on MS-Windows
482 @cindex keyboard, MS-Windows
483
484 This section describes the Windows-specific features related to
485 keyboard input in Emacs.
486
487 @cindex MS-Windows keyboard shortcuts
488 Many key combinations (known as ``keyboard shortcuts'') that have
489 conventional uses in MS-Windows programs conflict with traditional
490 Emacs key bindings. (These Emacs key bindings were established years
491 before Microsoft was founded.) Examples of conflicts include
492 @kbd{C-c}, @kbd{C-x}, @kbd{C-z}, @kbd{C-a}, and @kbd{W-@key{SPC}}.
493 You can redefine some of them with meanings more like the MS-Windows
494 meanings by enabling CUA Mode (@pxref{CUA Bindings}).
495
496 @iftex
497 @inforef{Windows Keyboard, , emacs}, for information about additional
498 Windows-specific variables in this category.
499 @end iftex
500 @ifnottex
501 @vindex w32-alt-is-meta
502 @cindex @code{Alt} key (MS-Windows)
503 By default, the key labeled @key{Alt} is mapped as the @key{META}
504 key. If you wish it to produce the @code{Alt} modifier instead, set
505 the variable @code{w32-alt-is-meta} to a @code{nil} value.
506
507 @findex w32-register-hot-key
508 @findex w32-unregister-hot-key
509 MS-Windows reserves certain key combinations, such as
510 @kbd{@key{Alt}-@key{TAB}} and a number of Windows key combinations,
511 for its own use. These key combinations are intercepted by the system
512 before Emacs can see them. Also, on Windows 10, all Windows key
513 combinations are reserved by the system in such a way that they are
514 never propagated to applications, even if the system does not
515 currently define a hotkey on the specific combination. You can use
516 the @code{w32-register-hot-key} function to allow a key sequence to be
517 seen by Emacs instead of being grabbed by Windows. When registered as
518 a hot key, the key combination is pulled out of the system's input
519 queue before it is handled by Windows, effectively overriding the
520 special meaning of that key sequence for Windows. The override is
521 only effective when Emacs is active; with other applications on the
522 foreground the keys behave normally.
523
524 The argument to @code{w32-register-hot-key} must be a single key with a
525 single modifier, in vector form that would be acceptable to
526 @code{define-key}. The control and shift modifiers have no effect on the
527 argument. The meta modifier is interpreted as the @key{Alt} key if
528 @code{w32-alt-is-meta} is @code{t} (the default), and the super and hyper
529 modifiers are interpreted according to the bindings of
530 @code{w32-lwindow-modifier} and @code{w32-rwindow-modifier}. Additionally, a
531 modifier with the trailing dash but with no key indicates that all
532 Windows defined hotkeys for that modifier are to be overridden in the
533 favor of Emacs.
534
535 @kindex M-TAB@r{, (MS-Windows)}
536 @cindex @kbd{M-@key{TAB}} vs @kbd{@key{Alt}-@key{TAB}} (MS-Windows)
537 @cindex @kbd{@key{Alt}-@key{TAB}} vs @kbd{M-@key{TAB}} (MS-Windows)
538 For example, @code{(w32-register-hot-key [M-tab])} lets you use
539 @kbd{M-@key{TAB}} normally in Emacs; for instance, to complete the
540 word or symbol at point at top level, or to complete the current
541 search string against previously sought strings during incremental
542 search. @code{(w32-register-hot-key [s-])} with
543 @code{w32-lwindow-modifier} bound to @code{super} disables all the
544 Windows' own Windows key based shortcuts.@footnote{There is one known
545 exception: The combination @kbd{@key{Windows}-@key{L}} that locks the
546 workstation is handled by the system on a lower level. For this
547 reason, @code{w32-register-hot-key} cannot override this key
548 combination - it always locks the computer.}
549
550 Note that @code{w32-register-hot-key} checks the
551 @code{w32-[lr]window-modifier} values at the time of the function
552 call. Thus, you can set @code{w32-lwindow-modifier} as @code{super},
553 then call @code{(w32-register-hot-key [s-r])}, and finally set
554 @code{w32-rwindow-modifier} as @code{super} as well. The result is
555 that the left Windows key together with @key{R} invokes whichever
556 function you have bound for the combination in Emacs, and the right
557 Windows key and @key{R} opens the Windows @code{Run} dialog.
558
559 The hotkey registrations always also include all the shift and
560 control modifier combinations for the given hotkey; that is,
561 registering @kbd{s-@key{a}} as a hotkey gives you @kbd{S-s-@key{a}},
562 @kbd{C-s-@key{a}} and @kbd{C-S-s-@key{a}} as well.
563
564 On Windows 98 and ME, the hotkey registration is more restricted.
565 The desired hotkey must always be fully specified, and
566 @code{w32-phantom-key-code} can be customized to achieve desired
567 results.
568
569 The function @code{w32-unregister-hot-key} reverses the effect of
570 @code{w32-register-hot-key} for its argument key sequence.
571
572 @vindex w32-capslock-is-shiftlock
573 By default, the @key{CapsLock} key only affects normal character
574 keys (it converts lower-case characters to their upper-case
575 variants). However, if you set the variable
576 @code{w32-capslock-is-shiftlock} to a non-@code{nil} value, the
577 @key{CapsLock} key will affect non-character keys as well, as if you
578 pressed the @key{Shift} key while typing the non-character key.
579
580 @vindex w32-enable-caps-lock
581 If the variable @code{w32-enable-caps-lock} is set to a @code{nil}
582 value, the @key{CapsLock} key produces the symbol @code{capslock}
583 instead of the shifted version of they keys. The default value is
584 @code{t}.
585
586 @vindex w32-enable-num-lock
587 @cindex keypad keys (MS-Windows)
588 Similarly, if @code{w32-enable-num-lock} is @code{nil}, the
589 @key{NumLock} key will produce the symbol @code{kp-numlock}. The
590 default is @code{t}, which causes @key{NumLock} to work as expected:
591 toggle the meaning of the keys on the numeric keypad.
592 @end ifnottex
593
594 @vindex w32-apps-modifier
595 The variable @code{w32-apps-modifier} controls the effect of the
596 @key{Apps} key (usually located between the right @key{Alt} and the
597 right @key{Ctrl} keys). Its value can be one of the symbols
598 @code{hyper}, @code{super}, @code{meta}, @code{alt}, @code{control},
599 or @code{shift} for the respective modifier, or @code{nil} to appear
600 as the key @code{apps}. The default is @code{nil}.
601
602 @vindex w32-lwindow-modifier
603 @vindex w32-rwindow-modifier
604 @vindex w32-scroll-lock-modifier
605 The variable @code{w32-lwindow-modifier} determines the effect of
606 the left Windows key (usually labeled with @key{start} and the Windows
607 logo). If its value is @code{nil} (the default), the key will produce
608 the symbol @code{lwindow}. Setting it to one of the symbols
609 @code{hyper}, @code{super}, @code{meta}, @code{alt}, @code{control},
610 or @code{shift} will produce the respective modifier. A similar
611 variable @code{w32-rwindow-modifier} controls the effect of the right
612 Windows key, and @code{w32-scroll-lock-modifier} does the same for the
613 @key{ScrLock} key. If these variables are set to @code{nil}, the
614 right Windows key produces the symbol @code{rwindow} and @key{ScrLock}
615 produces the symbol @code{scroll}.
616
617 @vindex w32-pass-alt-to-system
618 @cindex Windows system menu
619 @cindex @code{Alt} key invokes menu (Windows)
620 Emacs compiled as a native Windows application normally turns off
621 the Windows feature that tapping the @key{Alt} key invokes the Windows
622 menu. The reason is that the @key{Alt} serves as @key{META} in Emacs.
623 When using Emacs, users often press the @key{META} key temporarily and
624 then change their minds; if this has the effect of bringing up the
625 Windows menu, it alters the meaning of subsequent commands. Many
626 users find this frustrating.
627
628 You can re-enable Windows's default handling of tapping the @key{Alt}
629 key by setting @code{w32-pass-alt-to-system} to a non-@code{nil}
630 value.
631
632 @ifnottex
633 @vindex w32-pass-lwindow-to-system
634 @vindex w32-pass-rwindow-to-system
635 The variables @code{w32-pass-lwindow-to-system} and
636 @code{w32-pass-rwindow-to-system} determine whether the respective
637 keys are passed to Windows or swallowed by Emacs. If the value is
638 @code{nil}, the respective key is silently swallowed by Emacs,
639 otherwise it is passed to Windows. The default is @code{t} for both
640 of these variables. Passing each of these keys to Windows produces
641 its normal effect: for example, @kbd{@key{Lwindow}} opens the
642 @code{Start} menu, etc.
643
644 @vindex w32-recognize-altgr
645 @kindex AltGr @r{(MS-Windows)}
646 @cindex AltGr key (MS-Windows)
647 The variable @code{w32-recognize-altgr} controls whether the
648 @key{AltGr} key (if it exists on your keyboard), or its equivalent,
649 the combination of the right @key{Alt} and left @key{Ctrl} keys
650 pressed together, is recognized as the @key{AltGr} key. The default
651 is @code{t}, which means these keys produce @code{AltGr}; setting it
652 to @code{nil} causes @key{AltGr} or the equivalent key combination to
653 be interpreted as the combination of @key{Ctrl} and @key{META}
654 modifiers.
655 @end ifnottex
656
657 @node Windows Mouse
658 @section Mouse Usage on MS-Windows
659 @cindex mouse, and MS-Windows
660
661 This section describes the Windows-specific variables related to
662 the mouse.
663
664 @vindex w32-mouse-button-tolerance
665 @cindex simulation of middle mouse button
666 The variable @code{w32-mouse-button-tolerance} specifies the
667 time interval, in milliseconds, for faking middle mouse button press
668 on 2-button mice. If both mouse buttons are depressed within this
669 time interval, Emacs generates a middle mouse button click event
670 instead of a double click on one of the buttons.
671
672 @vindex w32-pass-extra-mouse-buttons-to-system
673 If the variable @code{w32-pass-extra-mouse-buttons-to-system} is
674 non-@code{nil}, Emacs passes the fourth and fifth mouse buttons to
675 Windows.
676
677 @vindex w32-swap-mouse-buttons
678 The variable @code{w32-swap-mouse-buttons} controls which of the 3
679 mouse buttons generates the @kbd{mouse-2} events. When it is
680 @code{nil} (the default), the middle button generates @kbd{mouse-2}
681 and the right button generates @kbd{mouse-3} events. If this variable
682 is non-@code{nil}, the roles of these two buttons are reversed.
683
684 @node Windows Processes
685 @section Subprocesses on Windows 9X/ME and Windows NT/2K/XP/Vista/7/8/10
686 @cindex subprocesses on MS-Windows
687
688 @cindex DOS applications, running from Emacs
689 Emacs compiled as a native Windows application (as opposed to the DOS
690 version) includes full support for asynchronous subprocesses.
691 In the Windows version, synchronous and asynchronous subprocesses work
692 fine on both
693 Windows 9X/ME and Windows NT/2K/XP/Vista/7/8/10 as long as you run
694 only 32-bit or 64-bit Windows
695 applications. However, when you run a DOS application in a subprocess,
696 you may encounter problems or be unable to run the application at all;
697 and if you run two DOS applications at the same time in two
698 subprocesses, you may have to reboot your system.
699
700 Since the standard command interpreter (and most command line utilities)
701 on Windows 9X are DOS applications, these problems are significant when
702 using that system. But there's nothing we can do about them; only
703 Microsoft can fix them.
704
705 If you run just one DOS application subprocess, the subprocess should
706 work as expected as long as it is ``well-behaved'' and does not perform
707 direct screen access or other unusual actions. If you have a CPU
708 monitor application, your machine will appear to be 100% busy even when
709 the DOS application is idle, but this is only an artifact of the way CPU
710 monitors measure processor load.
711
712 You must terminate the DOS application before you start any other DOS
713 application in a different subprocess. Emacs is unable to interrupt or
714 terminate a DOS subprocess. The only way you can terminate such a
715 subprocess is by giving it a command that tells its program to exit.
716
717 If you attempt to run two DOS applications at the same time in separate
718 subprocesses, the second one that is started will be suspended until the
719 first one finishes, even if either or both of them are asynchronous.
720
721 @cindex kill DOS application
722 If you can go to the first subprocess, and tell it to exit, the second
723 subprocess should continue normally. However, if the second subprocess
724 is synchronous, Emacs itself will be hung until the first subprocess
725 finishes. If it will not finish without user input, then you have no
726 choice but to reboot if you are running on Windows 9X@. If you are
727 running on Windows NT/2K/XP, you can use a process viewer application to kill
728 the appropriate instance of NTVDM instead (this will terminate both DOS
729 subprocesses).
730
731 If you have to reboot Windows 9X in this situation, do not use the
732 @code{Shutdown} command on the @code{Start} menu; that usually hangs the
733 system. Instead, type @kbd{@key{Ctrl}-@key{Alt}-@key{DEL}} and then choose
734 @code{Shutdown}. That usually works, although it may take a few minutes
735 to do its job.
736
737 @vindex w32-quote-process-args
738 The variable @code{w32-quote-process-args} controls how Emacs quotes
739 the process arguments. Non-@code{nil} means quote with the @code{"}
740 character. If the value is a character, Emacs uses that character to escape
741 any quote characters that appear; otherwise it chooses a suitable escape
742 character based on the type of the program.
743
744 @vindex w32-pipe-buffer-size
745 The variable @code{w32-pipe-buffer-size} controls the size of the
746 buffer Emacs requests from the system when it creates pipes for
747 communications with subprocesses. The default value is zero, which
748 lets the OS choose the size. Any valid positive value will request a
749 buffer of that size in bytes. This can be used to tailor
750 communications with subprocesses to programs that exhibit unusual
751 behavior with respect to buffering pipe I/O.
752
753 @ifnottex
754 @findex w32-shell-execute
755 The function @code{w32-shell-execute} can be useful for writing
756 customized commands that run MS-Windows applications registered to
757 handle a certain standard Windows operation for a specific type of
758 document or file. This function is a wrapper around the Windows
759 @code{ShellExecute} API@. See the MS-Windows API documentation for
760 more details.
761 @end ifnottex
762
763 @node Windows Printing
764 @section Printing and MS-Windows
765
766 Printing commands, such as @code{lpr-buffer} (@pxref{Printing}) and
767 @code{ps-print-buffer} (@pxref{PostScript}) work in MS-DOS and
768 MS-Windows by sending the output to one of the printer ports, if a
769 Posix-style @code{lpr} program is unavailable. The same Emacs
770 variables control printing on all systems, but in some cases they have
771 different default values on MS-DOS and MS-Windows.
772
773 Emacs on MS Windows attempts to determine your default printer
774 automatically (using the function @code{default-printer-name}).
775 But in some rare cases this can fail, or you may wish to use a different
776 printer from within Emacs. The rest of this section explains how to
777 tell Emacs which printer to use.
778
779 @vindex printer-name@r{, (MS-DOS/MS-Windows)}
780 If you want to use your local printer, then set the Lisp variable
781 @code{lpr-command} to @code{""} (its default value on Windows) and
782 @code{printer-name} to the name of the printer port---for example,
783 @code{"PRN"}, the usual local printer port, or @code{"LPT2"}, or
784 @code{"COM1"} for a serial printer. You can also set
785 @code{printer-name} to a file name, in which case ``printed'' output
786 is actually appended to that file. If you set @code{printer-name} to
787 @code{"NUL"}, printed output is silently discarded (sent to the system
788 null device).
789
790 You can also use a printer shared by another machine by setting
791 @code{printer-name} to the UNC share name for that printer---for
792 example, @code{"//joes_pc/hp4si"}. (It doesn't matter whether you use
793 forward slashes or backslashes here.) To find out the names of shared
794 printers, run the command @samp{net view} from the command prompt to
795 obtain a list of servers, and @samp{net view @var{server-name}} to see
796 the names of printers (and directories) shared by that server.
797 Alternatively, click the @samp{Network Neighborhood} icon on your
798 desktop, and look for machines that share their printers via the
799 network.
800
801 @cindex @samp{net use}, and printing on MS-Windows
802 @cindex networked printers (MS-Windows)
803 If the printer doesn't appear in the output of @samp{net view}, or
804 if setting @code{printer-name} to the UNC share name doesn't produce a
805 hardcopy on that printer, you can use the @samp{net use} command to
806 connect a local print port such as @code{"LPT2"} to the networked
807 printer. For example, typing @kbd{net use LPT2: \\joes_pc\hp4si}@footnote{
808 Note that the @samp{net use} command requires the UNC share name to be
809 typed with the Windows-style backslashes, while the value of
810 @code{printer-name} can be set with either forward- or backslashes.}
811 causes Windows to @dfn{capture} the @code{LPT2} port and redirect the
812 printed material to the printer connected to the machine @code{joes_pc}.
813 After this command, setting @code{printer-name} to @code{"LPT2"}
814 should produce the hardcopy on the networked printer.
815
816 With some varieties of Windows network software, you can instruct
817 Windows to capture a specific printer port such as @code{"LPT2"}, and
818 redirect it to a networked printer via the @w{@code{Control
819 Panel->Printers}} applet instead of @samp{net use}.
820
821 If you set @code{printer-name} to a file name, it's best to use an
822 absolute file name. Emacs changes the working directory according to
823 the default directory of the current buffer, so if the file name in
824 @code{printer-name} is relative, you will end up with several such
825 files, each one in the directory of the buffer from which the printing
826 was done.
827
828 If the value of @code{printer-name} is correct, but printing does
829 not produce the hardcopy on your printer, it is possible that your
830 printer does not support printing plain text (some cheap printers omit
831 this functionality). In that case, try the PostScript print commands,
832 described below.
833
834 @findex print-buffer @r{(MS-DOS)}
835 @findex print-region @r{(MS-DOS)}
836 @vindex lpr-headers-switches @r{(MS-DOS)}
837 The commands @code{print-buffer} and @code{print-region} call the
838 @code{pr} program, or use special switches to the @code{lpr} program, to
839 produce headers on each printed page. MS-DOS and MS-Windows don't
840 normally have these programs, so by default, the variable
841 @code{lpr-headers-switches} is set so that the requests to print page
842 headers are silently ignored. Thus, @code{print-buffer} and
843 @code{print-region} produce the same output as @code{lpr-buffer} and
844 @code{lpr-region}, respectively. If you do have a suitable @code{pr}
845 program (for example, from GNU Coreutils), set
846 @code{lpr-headers-switches} to @code{nil}; Emacs will then call
847 @code{pr} to produce the page headers, and print the resulting output as
848 specified by @code{printer-name}.
849
850 @vindex print-region-function @r{(MS-DOS)}
851 @cindex lpr usage under MS-DOS
852 @vindex lpr-command @r{(MS-DOS)}
853 @vindex lpr-switches @r{(MS-DOS)}
854 Finally, if you do have an @code{lpr} work-alike, you can set the
855 variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use
856 @code{lpr} for printing, as on other systems. (If the name of the
857 program isn't @code{lpr}, set @code{lpr-command} to the appropriate value.)
858 The variable @code{lpr-switches} has its standard meaning
859 when @code{lpr-command} is not @code{""}. If the variable
860 @code{printer-name} has a string value, it is used as the value for the
861 @code{-P} option to @code{lpr}, as on Unix.
862
863 @findex ps-print-buffer @r{(MS-DOS)}
864 @findex ps-spool-buffer @r{(MS-DOS)}
865 @vindex ps-printer-name @r{(MS-DOS)}
866 @vindex ps-lpr-command @r{(MS-DOS)}
867 @vindex ps-lpr-switches @r{(MS-DOS)}
868 A parallel set of variables, @code{ps-lpr-command},
869 @code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript
870 Variables}), defines how PostScript files should be printed. These
871 variables are used in the same way as the corresponding variables
872 described above for non-PostScript printing. Thus, the value of
873 @code{ps-printer-name} is used as the name of the device (or file) to
874 which PostScript output is sent, just as @code{printer-name} is used
875 for non-PostScript printing. (There are two distinct sets of
876 variables in case you have two printers attached to two different
877 ports, and only one of them is a PostScript printer.)
878
879 @cindex Ghostscript, use for PostScript printing
880 The default value of the variable @code{ps-lpr-command} is @code{""},
881 which causes PostScript output to be sent to the printer port specified
882 by @code{ps-printer-name}; but @code{ps-lpr-command} can also be set to
883 the name of a program which will accept PostScript files. Thus, if you
884 have a non-PostScript printer, you can set this variable to the name of
885 a PostScript interpreter program (such as Ghostscript). Any switches
886 that need to be passed to the interpreter program are specified using
887 @code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a
888 string, it will be added to the list of switches as the value for the
889 @code{-P} option. This is probably only useful if you are using
890 @code{lpr}, so when using an interpreter typically you would set
891 @code{ps-printer-name} to something other than a string so it is
892 ignored.)
893
894 For example, to use Ghostscript for printing on the system's default
895 printer, put this in your @file{.emacs} file:
896
897 @example
898 (setq ps-printer-name t)
899 (setq ps-lpr-command "D:/gs6.01/bin/gswin32c.exe")
900 (setq ps-lpr-switches '("-q" "-dNOPAUSE" "-dBATCH"
901 "-sDEVICE=mswinpr2"
902 "-sPAPERSIZE=a4"))
903 @end example
904
905 @noindent
906 (This assumes that Ghostscript is installed in the
907 @file{D:/gs6.01} directory.)
908
909 @node Windows Fonts
910 @section Specifying Fonts on MS-Windows
911 @cindex font specification (MS Windows)
912
913 Starting with Emacs 23, fonts are specified by their name, size
914 and optional properties. The format for specifying fonts comes from the
915 fontconfig library used in modern Free desktops:
916
917 @example
918 [Family[-PointSize]][:Option1=Value1[:Option2=Value2[...]]]
919 @end example
920
921 The old XLFD based format is also supported for backwards compatibility.
922
923 @cindex font backend selection (MS-Windows)
924 Emacs 23 and later supports a number of font backends. Currently,
925 the @code{gdi} and @code{uniscribe} backends are supported on Windows.
926 The @code{gdi} font backend is available on all versions of Windows,
927 and supports all fonts that are natively supported by Windows. The
928 @code{uniscribe} font backend is available on Windows 2000 and later,
929 and supports TrueType and OpenType fonts. Some languages requiring
930 complex layout can only be properly supported by the Uniscribe
931 backend. By default, both backends are enabled if supported, with
932 @code{uniscribe} taking priority over @code{gdi}. To override that
933 and use the GDI backend even if Uniscribe is available, invoke Emacs
934 with the @kbd{-xrm Emacs.fontBackend:gdi} command-line argument, or
935 add a @code{Emacs.fontBackend} resource with the value @code{gdi} in
936 the Registry under either the
937 @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} or the
938 @samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs} key (@pxref{Resources}).
939
940 @cindex font properties (MS Windows)
941 @noindent
942 Optional properties common to all font backends on MS-Windows are:
943
944 @table @code
945
946 @vindex font-weight-table @r{(MS-Windows)}
947 @item weight
948 Specifies the weight of the font. Special values @code{light},
949 @code{medium}, @code{demibold}, @code{bold}, and @code{black} can be specified
950 without @code{weight=} (e.g., @kbd{Courier New-12:bold}). Otherwise,
951 the weight should be a numeric value between 100 and 900, or one of the
952 named weights in @code{font-weight-table}. If unspecified, a regular font
953 is assumed.
954
955 @vindex font-slant-table @r{(MS-Windows)}
956 @item slant
957 Specifies whether the font is italic. Special values
958 @code{roman}, @code{italic} and @code{oblique} can be specified
959 without @code{slant=} (e.g., @kbd{Courier New-12:italic}).
960 Otherwise, the slant should be a numeric value, or one of the named
961 slants in @code{font-slant-table}. On Windows, any slant above 150 is
962 treated as italics, and anything below as roman.
963
964 @item family
965 Specifies the font family, but normally this will be specified
966 at the start of the font name.
967
968 @item pixelsize
969 Specifies the font size in pixels. This can be used instead
970 of the point size specified after the family name.
971
972 @item adstyle
973 Specifies additional style information for the font.
974 On MS-Windows, the values @code{mono}, @code{sans}, @code{serif},
975 @code{script} and @code{decorative} are recognized. These are most useful
976 as a fallback with the font family left unspecified.
977
978 @vindex w32-charset-info-alist
979 @item registry
980 Specifies the character set registry that the font is
981 expected to cover. Most TrueType and OpenType fonts will be Unicode fonts
982 that cover several national character sets, but you can narrow down the
983 selection of fonts to those that support a particular character set by
984 using a specific registry from @code{w32-charset-info-alist} here.
985
986 @item spacing
987 Specifies how the font is spaced. The @code{p} spacing specifies
988 a proportional font, and @code{m} or @code{c} specify a monospaced font.
989
990 @item foundry
991 Not used on Windows, but for informational purposes and to
992 prevent problems with code that expects it to be set, is set internally to
993 @code{raster} for bitmapped fonts, @code{outline} for scalable fonts,
994 or @code{unknown} if the type cannot be determined as one of those.
995 @end table
996
997 @cindex font properties (MS Windows gdi backend)
998 Options specific to @code{GDI} fonts:
999
1000 @table @code
1001
1002 @cindex font scripts (MS Windows)
1003 @cindex font Unicode subranges (MS Windows)
1004 @item script
1005 Specifies a Unicode subrange the font should support.
1006
1007 The following scripts are recognized on Windows: @code{latin}, @code{greek},
1008 @code{coptic}, @code{cyrillic}, @code{armenian}, @code{hebrew}, @code{arabic},
1009 @code{syriac}, @code{nko}, @code{thaana}, @code{devanagari}, @code{bengali},
1010 @code{gurmukhi}, @code{gujarati}, @code{oriya}, @code{tamil}, @code{telugu},
1011 @code{kannada}, @code{malayam}, @code{sinhala}, @code{thai}, @code{lao},
1012 @code{tibetan}, @code{myanmar}, @code{georgian}, @code{hangul},
1013 @code{ethiopic}, @code{cherokee}, @code{canadian-aboriginal}, @code{ogham},
1014 @code{runic}, @code{khmer}, @code{mongolian}, @code{symbol}, @code{braille},
1015 @code{han}, @code{ideographic-description}, @code{cjk-misc}, @code{kana},
1016 @code{bopomofo}, @code{kanbun}, @code{yi}, @code{byzantine-musical-symbol},
1017 @code{musical-symbol}, and @code{mathematical}.
1018
1019 @cindex font antialiasing (MS Windows)
1020 @item antialias
1021 Specifies the antialiasing method. The value @code{none} means no
1022 antialiasing, @code{standard} means use standard antialiasing,
1023 @code{subpixel} means use subpixel antialiasing (known as Cleartype on
1024 Windows), and @code{natural} means use subpixel antialiasing with
1025 adjusted spacing between letters. If unspecified, the font will use
1026 the system default antialiasing.
1027 @end table
1028
1029 @node Windows Misc
1030 @section Miscellaneous Windows-specific features
1031
1032 This section describes miscellaneous Windows-specific features.
1033
1034 @vindex w32-use-visible-system-caret
1035 @cindex screen reader software, MS-Windows
1036 The variable @code{w32-use-visible-system-caret} is a flag that
1037 determines whether to make the system caret visible. The default when
1038 no screen reader software is in use is @code{nil}, which means Emacs
1039 draws its own cursor to indicate the position of point. A
1040 non-@code{nil} value means Emacs will indicate point location with the
1041 system caret; this facilitates use of screen reader software, and is
1042 the default when such software is detected when running Emacs.
1043 When this variable is non-@code{nil}, other variables affecting the
1044 cursor display have no effect.
1045
1046 @iftex
1047 @inforef{Windows Misc, , emacs}, for information about additional
1048 Windows-specific variables in this category.
1049 @end iftex
1050
1051 @ifnottex
1052 @vindex w32-grab-focus-on-raise
1053 @cindex frame focus policy, MS-Windows
1054 The variable @code{w32-grab-focus-on-raise}, if set to a
1055 non-@code{nil} value causes a frame to grab focus when it is raised.
1056 The default is @code{t}, which fits well with the Windows default
1057 click-to-focus policy.
1058 @end ifnottex
1059
1060 @ifnottex
1061 @include msdos-xtra.texi
1062 @end ifnottex