]> code.delx.au - gnu-emacs/blob - man/msdog-xtra.texi
(Abbrevs): A @node line without explicit Prev, Next, and Up links.
[gnu-emacs] / man / msdog-xtra.texi
1 @c This file is included either in emacs-xtra.texi (when producing the
2 @c printed version) or in the main Emacs manual (for the on-line version).
3 @node MS-DOS
4 @section Emacs and MS-DOS
5 @cindex MS-DOG
6 @cindex MS-DOS peculiarities
7
8 This section briefly describes the peculiarities of using Emacs on
9 the MS-DOS ``operating system'' (also known as ``MS-DOG'').
10 Information about Emacs and Microsoft's current operating system
11 Windows (also known as ``Losedows) is in the main Emacs manual
12 (@pxref{Microsoft Systems,,, emacs, the Emacs Manual}).
13
14 If you build Emacs for MS-DOS, the binary will also run on Windows
15 3.X, Windows NT, Windows 9X/ME, Windows 2000, or OS/2 as a DOS
16 application; all of this chapter applies for all of those systems, if
17 you use an Emacs that was built for MS-DOS.
18
19 @xref{Text and Binary,,,emacs, the Emacs Manual}, for information
20 about Emacs' special handling of text files under MS-DOS (and
21 Windows).
22
23 @menu
24 * Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS.
25 * Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS.
26 * Display: MS-DOS Display. Fonts, frames and display size on MS-DOS.
27 * Files: MS-DOS File Names. File name conventions on MS-DOS.
28 * Printing: MS-DOS Printing. Printing specifics on MS-DOS.
29 * I18N: MS-DOS and MULE. Support for internationalization on MS-DOS.
30 * Processes: MS-DOS Processes. Running subprocesses on MS-DOS.
31 @end menu
32
33 @node MS-DOS Keyboard
34 @subsection Keyboard Usage on MS-DOS
35
36 @kindex DEL @r{(MS-DOS)}
37 @kindex BS @r{(MS-DOS)}
38 The key that is called @key{DEL} in Emacs (because that's how it is
39 designated on most workstations) is known as @key{BS} (backspace) on a
40 PC. That is why the PC-specific terminal initialization remaps the
41 @key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act
42 as @kbd{C-d} for the same reasons.
43
44 @kindex C-g @r{(MS-DOS)}
45 @kindex C-BREAK @r{(MS-DOS)}
46 @cindex quitting on MS-DOS
47 Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit
48 character, just like @kbd{C-g}. This is because Emacs cannot detect
49 that you have typed @kbd{C-g} until it is ready for more input. As a
50 consequence, you cannot use @kbd{C-g} to stop a running command
51 (@pxref{Quitting,,,emacs, the Emacs Manual}). By contrast,
52 @kbd{C-@key{BREAK}} @emph{is} detected as soon as you type it (as
53 @kbd{C-g} is on other systems), so it can be used to stop a running
54 command and for emergency escape (@pxref{Emergency Escape,,,emacs, the
55 Emacs Manual}).
56
57 @cindex Meta (under MS-DOS)
58 @cindex Hyper (under MS-DOS)
59 @cindex Super (under MS-DOS)
60 @vindex dos-super-key
61 @vindex dos-hyper-key
62 The PC keyboard maps use the left @key{ALT} key as the @key{META} key.
63 You have two choices for emulating the @key{SUPER} and @key{HYPER} keys:
64 choose either the right @key{CTRL} key or the right @key{ALT} key by
65 setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1
66 or 2 respectively. If neither @code{dos-super-key} nor
67 @code{dos-hyper-key} is 1, then by default the right @key{ALT} key is
68 also mapped to the @key{META} key. However, if the MS-DOS international
69 keyboard support program @file{KEYB.COM} is installed, Emacs will
70 @emph{not} map the right @key{ALT} to @key{META}, since it is used for
71 accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard
72 layouts; in this case, you may only use the left @key{ALT} as @key{META}
73 key.
74
75 @kindex C-j @r{(MS-DOS)}
76 @vindex dos-keypad-mode
77 The variable @code{dos-keypad-mode} is a flag variable that controls
78 what key codes are returned by keys in the numeric keypad. You can also
79 define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the
80 following line into your @file{_emacs} file:
81
82 @smallexample
83 ;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.}
84 (define-key function-key-map [kp-enter] [?\C-j])
85 @end smallexample
86
87 @node MS-DOS Mouse
88 @subsection Mouse Usage on MS-DOS
89
90 @cindex mouse support under MS-DOS
91 Emacs on MS-DOS supports a mouse (on the default terminal only).
92 The mouse commands work as documented, including those that use menus
93 and the menu bar (@pxref{Menu Bar,,,emacs, the Emacs Manual}). Scroll
94 bars don't work in MS-DOS Emacs. PC mice usually have only two
95 buttons; these act as @kbd{Mouse-1} and @kbd{Mouse-2}, but if you
96 press both of them together, that has the effect of @kbd{Mouse-3}. If
97 the mouse does have 3 buttons, Emacs detects that at startup, and all
98 the 3 buttons function normally, as on X.
99
100 Help strings for menu-bar and pop-up menus are displayed in the echo
101 area when the mouse pointer moves across the menu items. Highlighting
102 of mouse-sensitive text (@pxref{Mouse References,,,emacs, the Emacs
103 Manual}) is also supported.
104
105 @cindex mouse, set number of buttons
106 @findex msdos-set-mouse-buttons
107 Some versions of mouse drivers don't report the number of mouse
108 buttons correctly. For example, mice with a wheel report that they
109 have 3 buttons, but only 2 of them are passed to Emacs; the clicks on
110 the wheel, which serves as the middle button, are not passed. In
111 these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command
112 to tell Emacs how many mouse buttons to expect. You could make such a
113 setting permanent by adding this fragment to your @file{_emacs} init
114 file:
115
116 @example
117 ;; @r{Treat the mouse like a 2-button mouse.}
118 (msdos-set-mouse-buttons 2)
119 @end example
120
121 @cindex Windows clipboard support
122 Emacs built for MS-DOS supports clipboard operations when it runs on
123 Windows. Commands that put text on the kill ring, or yank text from
124 the ring, check the Windows clipboard first, just as Emacs does on the
125 X Window System (@pxref{Mouse Commands,,,emacs, the Emacs Manual}).
126 Only the primary selection and the cut buffer are supported by MS-DOS
127 Emacs on Windows; the secondary selection always appears as empty.
128
129 Due to the way clipboard access is implemented by Windows, the
130 length of text you can put into the clipboard is limited by the amount
131 of free DOS memory that is available to Emacs. Usually, up to 620KB of
132 text can be put into the clipboard, but this limit depends on the system
133 configuration and is lower if you run Emacs as a subprocess of
134 another program. If the killed text does not fit, Emacs outputs a
135 message saying so, and does not put the text into the clipboard.
136
137 Null characters also cannot be put into the Windows clipboard. If the
138 killed text includes null characters, Emacs does not put such text into
139 the clipboard, and displays in the echo area a message to that effect.
140
141 @vindex dos-display-scancodes
142 The variable @code{dos-display-scancodes}, when non-@code{nil},
143 directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of
144 each keystroke; this feature serves as a complement to the
145 @code{view-lossage} command, for debugging.
146
147 @node MS-DOS Display
148 @subsection Display on MS-DOS
149 @cindex faces under MS-DOS
150 @cindex fonts, emulating under MS-DOS
151
152 Display on MS-DOS cannot use font variants, like bold or italic, but
153 it does support multiple faces, each of which can specify a foreground
154 and a background color. Therefore, you can get the full functionality
155 of Emacs packages that use fonts (such as @code{font-lock}, Enriched
156 Text mode, and others) by defining the relevant faces to use different
157 colors. Use the @code{list-colors-display} command (@pxref{Frame
158 Parameters,,,emacs, the Emacs Manual}) and the
159 @code{list-faces-display} command (@pxref{Faces,,,emacs, the Emacs
160 Manual}) to see what colors and faces are available and what they look
161 like.
162
163 @xref{MS-DOS and MULE}, later in this chapter, for information on
164 how Emacs displays glyphs and characters that aren't supported by the
165 native font built into the DOS display.
166
167 @cindex cursor shape on MS-DOS
168 When Emacs starts, it changes the cursor shape to a solid box. This
169 is for compatibility with other systems, where the box cursor is the
170 default in Emacs. This default shape can be changed to a bar by
171 specifying the @code{cursor-type} parameter in the variable
172 @code{default-frame-alist} (@pxref{Creating Frames,,,emacs, the Emacs
173 Manual}). The MS-DOS terminal doesn't support a vertical-bar cursor,
174 so the bar cursor is horizontal, and the @code{@var{width}} parameter,
175 if specified by the frame parameters, actually determines its height.
176 For this reason, the @code{bar} and @code{hbar} cursor types produce
177 the same effect on MS-DOS. As an extension, the bar cursor
178 specification can include the starting scan line of the cursor as well
179 as its width, like this:
180
181 @example
182 '(cursor-type bar @var{width} . @var{start})
183 @end example
184
185 @noindent
186 In addition, if the @var{width} parameter is negative, the cursor bar
187 begins at the top of the character cell.
188
189 @cindex frames on MS-DOS
190 The MS-DOS terminal can only display a single frame at a time. The
191 Emacs frame facilities work on MS-DOS much as they do on text-only
192 terminals (@pxref{Frames,,,emacs, the Emacs Manual}). When you run
193 Emacs from a DOS window on MS-Windows, you can make the visible frame
194 smaller than the full screen, but Emacs still cannot display more than
195 a single frame at a time.
196
197 @cindex frame size under MS-DOS
198 @findex mode4350
199 @findex mode25
200 The @code{mode4350} command switches the display to 43 or 50
201 lines, depending on your hardware; the @code{mode25} command switches
202 to the default 80x25 screen size.
203
204 By default, Emacs only knows how to set screen sizes of 80 columns by
205 25, 28, 35, 40, 43 or 50 rows. However, if your video adapter has
206 special video modes that will switch the display to other sizes, you can
207 have Emacs support those too. When you ask Emacs to switch the frame to
208 @var{n} rows by @var{m} columns dimensions, it checks if there is a
209 variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so,
210 uses its value (which must be an integer) as the video mode to switch
211 to. (Emacs switches to that video mode by calling the BIOS @code{Set
212 Video Mode} function with the value of
213 @code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.)
214 For example, suppose your adapter will switch to 66x80 dimensions when
215 put into video mode 85. Then you can make Emacs support this screen
216 size by putting the following into your @file{_emacs} file:
217
218 @example
219 (setq screen-dimensions-66x80 85)
220 @end example
221
222 Since Emacs on MS-DOS can only set the frame size to specific
223 supported dimensions, it cannot honor every possible frame resizing
224 request. When an unsupported size is requested, Emacs chooses the next
225 larger supported size beyond the specified size. For example, if you
226 ask for 36x80 frame, you will get 40x80 instead.
227
228 The variables @code{screen-dimensions-@var{n}x@var{m}} are used only
229 when they exactly match the specified size; the search for the next
230 larger supported size ignores them. In the above example, even if your
231 VGA supports 38x80 dimensions and you define a variable
232 @code{screen-dimensions-38x80} with a suitable value, you will still get
233 40x80 screen when you ask for a 36x80 frame. If you want to get the
234 38x80 size in this case, you can do it by setting the variable named
235 @code{screen-dimensions-36x80} with the same video mode value as
236 @code{screen-dimensions-38x80}.
237
238 Changing frame dimensions on MS-DOS has the effect of changing all the
239 other frames to the new dimensions.
240
241 @node MS-DOS File Names
242 @subsection File Names on MS-DOS
243 @cindex file names under MS-DOS
244 @cindex init file, default name under MS-DOS
245
246 On MS-DOS, file names are case-insensitive and limited to eight
247 characters, plus optionally a period and three more characters. Emacs
248 knows enough about these limitations to handle file names that were
249 meant for other operating systems. For instance, leading dots
250 @samp{.} in file names are invalid in MS-DOS, so Emacs transparently
251 converts them to underscores @samp{_}; thus your default init file
252 (@pxref{Init File,,,emacs, the Emacs Manual}) is called @file{_emacs}
253 on MS-DOS. Excess characters before or after the period are generally
254 ignored by MS-DOS itself; thus, if you visit the file
255 @file{LongFileName.EvenLongerExtension}, you will silently get
256 @file{longfile.eve}, but Emacs will still display the long file name
257 on the mode line. Other than that, it's up to you to specify file
258 names which are valid under MS-DOS; the transparent conversion as
259 described above only works on file names built into Emacs.
260
261 @cindex backup file names on MS-DOS
262 The above restrictions on the file names on MS-DOS make it almost
263 impossible to construct the name of a backup file (@pxref{Backup
264 Names,,,emacs, the Emacs Manual}) without losing some of the original
265 file name characters. For example, the name of a backup file for
266 @file{docs.txt} is @file{docs.tx~} even if single backup is used.
267
268 @cindex file names under Windows 95/NT
269 @cindex long file names in DOS box under Windows 95/NT
270 If you run Emacs as a DOS application under Windows 9X, Windows ME, or
271 Windows 2000, you can turn on support for long file names. If you do
272 that, Emacs doesn't truncate file names or convert them to lower case;
273 instead, it uses the file names that you specify, verbatim. To enable
274 long file name support, set the environment variable @env{LFN} to
275 @samp{y} before starting Emacs. Unfortunately, Windows NT doesn't allow
276 DOS programs to access long file names, so Emacs built for MS-DOS will
277 only see their short 8+3 aliases.
278
279 @cindex @env{HOME} directory under MS-DOS
280 MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
281 that the directory where it is installed is the value of the @env{HOME}
282 environment variable. That is, if your Emacs binary,
283 @file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then
284 Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In
285 particular, that is where Emacs looks for the init file @file{_emacs}.
286 With this in mind, you can use @samp{~} in file names as an alias for
287 the home directory, as you would on GNU or Unix. You can also set
288 @env{HOME} variable in the environment before starting Emacs; its
289 value will then override the above default behavior.
290
291 Emacs on MS-DOS handles the directory name @file{/dev} specially,
292 because of a feature in the emulator libraries of DJGPP that pretends
293 I/O devices have names in that directory. We recommend that you avoid
294 using an actual directory named @file{/dev} on any disk.
295
296 @node MS-DOS Printing
297 @subsection Printing and MS-DOS
298
299 Printing commands, such as @code{lpr-buffer}
300 (@pxref{Printing,,,emacs, the Emacs Manual}) and
301 @code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual})
302 can work on MS-DOS by sending the output to one of the printer ports,
303 if a Posix-style @code{lpr} program is unavailable. The same Emacs
304 variables control printing on all systems, but in some cases they have
305 different default values on MS-DOS.
306
307 @xref{MS-Windows Printing,,,emacs, the Emacs Manual}, for details.
308
309 Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even
310 though they are connected to a Windows machine which uses a different
311 encoding for the same locale. For example, in the Latin-1 locale, DOS
312 uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and
313 MULE}. When you print to such printers from Windows, you can use the
314 @kbd{C-x RET c} (@code{universal-coding-system-argument}) command before
315 @kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS
316 codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET
317 M-x lpr-region RET} will print the region while converting it to the
318 codepage 850 encoding. You may need to create the @code{cp@var{nnn}}
319 coding system with @kbd{M-x codepage-setup}.
320
321 @vindex dos-printer
322 @vindex dos-ps-printer
323 For backwards compatibility, the value of @code{dos-printer}
324 (@code{dos-ps-printer}), if it has a value, overrides the value of
325 @code{printer-name} (@code{ps-printer-name}), on MS-DOS.
326
327
328 @node MS-DOS and MULE
329 @subsection International Support on MS-DOS
330 @cindex international support @r{(MS-DOS)}
331
332 Emacs on MS-DOS supports the same international character sets as it
333 does on GNU, Unix and other platforms (@pxref{International,,,emacs,
334 the Emacs Manual}), including coding systems for converting between
335 the different character sets. However, due to incompatibilities
336 between MS-DOS/MS-Windows and other systems, there are several
337 DOS-specific aspects of this support that you should be aware of.
338 This section describes these aspects.
339
340 The description below is largely specific to the MS-DOS port of
341 Emacs, especially where it talks about practical implications for
342 Emacs users. For other operating systems, see the @file{code-pages.el}
343 package, which implements support for MS-DOS- and MS-Windows-specific
344 encodings for all platforms other than MS-DOS.
345
346 @table @kbd
347 @item M-x dos-codepage-setup
348 Set up Emacs display and coding systems as appropriate for the current
349 DOS codepage.
350
351 @item M-x codepage-setup
352 Create a coding system for a certain DOS codepage.
353 @end table
354
355 @cindex codepage, MS-DOS
356 @cindex DOS codepages
357 MS-DOS is designed to support one character set of 256 characters at
358 any given time, but gives you a variety of character sets to choose
359 from. The alternative character sets are known as @dfn{DOS codepages}.
360 Each codepage includes all 128 @acronym{ASCII} characters, but the other 128
361 characters (codes 128 through 255) vary from one codepage to another.
362 Each DOS codepage is identified by a 3-digit number, such as 850, 862,
363 etc.
364
365 In contrast to X, which lets you use several fonts at the same time,
366 MS-DOS normally doesn't allow use of several codepages in a single
367 session. MS-DOS was designed to load a single codepage at system
368 startup, and require you to reboot in order to change
369 it@footnote{Normally, one particular codepage is burnt into the
370 display memory, while other codepages can be installed by modifying
371 system configuration files, such as @file{CONFIG.SYS}, and rebooting.
372 While there is third-party software that allows changing the codepage
373 without rebooting, we describe here how a stock MS-DOS system
374 behaves.}. Much the same limitation applies when you run DOS
375 executables on other systems such as MS-Windows.
376
377 @cindex unibyte operation @r{(MS-DOS)}
378 If you invoke Emacs on MS-DOS with the @samp{--unibyte} option
379 (@pxref{Initial Options,,,emacs, the Emacs Manual}), Emacs does not
380 perform any conversion of non-@acronym{ASCII} characters. Instead, it
381 reads and writes any non-@acronym{ASCII} characters verbatim, and
382 sends their 8-bit codes to the display verbatim. Thus, unibyte Emacs
383 on MS-DOS supports the current codepage, whatever it may be, but
384 cannot even represent any other characters.
385
386 @vindex dos-codepage
387 For multibyte operation on MS-DOS, Emacs needs to know which
388 characters the chosen DOS codepage can display. So it queries the
389 system shortly after startup to get the chosen codepage number, and
390 stores the number in the variable @code{dos-codepage}. Some systems
391 return the default value 437 for the current codepage, even though the
392 actual codepage is different. (This typically happens when you use the
393 codepage built into the display hardware.) You can specify a different
394 codepage for Emacs to use by setting the variable @code{dos-codepage} in
395 your init file.
396
397 @cindex language environment, automatic selection on @r{MS-DOS}
398 Multibyte Emacs supports only certain DOS codepages: those which can
399 display Far-Eastern scripts, like the Japanese codepage 932, and those
400 that encode a single ISO 8859 character set.
401
402 The Far-Eastern codepages can directly display one of the MULE
403 character sets for these countries, so Emacs simply sets up to use the
404 appropriate terminal coding system that is supported by the codepage.
405 The special features described in the rest of this section mostly
406 pertain to codepages that encode ISO 8859 character sets.
407
408 For the codepages which correspond to one of the ISO character sets,
409 Emacs knows the character set name based on the codepage number. Emacs
410 automatically creates a coding system to support reading and writing
411 files that use the current codepage, and uses this coding system by
412 default. The name of this coding system is @code{cp@var{nnn}}, where
413 @var{nnn} is the codepage number.@footnote{The standard Emacs coding
414 systems for ISO 8859 are not quite right for the purpose, because
415 typically the DOS codepage does not match the standard ISO character
416 codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has
417 code 231 in the standard Latin-1 character set, but the corresponding
418 DOS codepage 850 uses code 135 for this glyph.}
419
420 @cindex mode line @r{(MS-DOS)}
421 All the @code{cp@var{nnn}} coding systems use the letter @samp{D}
422 (for ``DOS'') as their mode-line mnemonic. Since both the terminal
423 coding system and the default coding system for file I/O are set to
424 the proper @code{cp@var{nnn}} coding system at startup, it is normal
425 for the mode line on MS-DOS to begin with @samp{-DD\-}. @xref{Mode
426 Line,,,emacs, the Emacs Manual}. Far-Eastern DOS terminals do not use
427 the @code{cp@var{nnn}} coding systems, and thus their initial mode
428 line looks like the Emacs default.
429
430 Since the codepage number also indicates which script you are using,
431 Emacs automatically runs @code{set-language-environment} to select the
432 language environment for that script (@pxref{Language
433 Environments,,,emacs, the Emacs Manual}).
434
435 If a buffer contains a character belonging to some other ISO 8859
436 character set, not the one that the chosen DOS codepage supports, Emacs
437 displays it using a sequence of @acronym{ASCII} characters. For example, if the
438 current codepage doesn't have a glyph for the letter @samp{@`o} (small
439 @samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where
440 the braces serve as a visual indication that this is a single character.
441 (This may look awkward for some non-Latin characters, such as those from
442 Greek or Hebrew alphabets, but it is still readable by a person who
443 knows the language.) Even though the character may occupy several
444 columns on the screen, it is really still just a single character, and
445 all Emacs commands treat it as one.
446
447 @cindex IBM graphics characters (MS-DOS)
448 @cindex box-drawing characters (MS-DOS)
449 @cindex line-drawing characters (MS-DOS)
450 Not all characters in DOS codepages correspond to ISO 8859
451 characters---some are used for other purposes, such as box-drawing
452 characters and other graphics. Emacs maps these characters to two
453 special character sets called @code{eight-bit-control} and
454 @code{eight-bit-graphic}, and displays them as their IBM glyphs.
455 However, you should be aware that other systems might display these
456 characters differently, so you should avoid them in text that might be
457 copied to a different operating system, or even to another DOS machine
458 that uses a different codepage.
459
460 @vindex dos-unsupported-character-glyph
461 Emacs supports many other characters sets aside from ISO 8859, but it
462 cannot display them on MS-DOS. So if one of these multibyte characters
463 appears in a buffer, Emacs on MS-DOS displays them as specified by the
464 @code{dos-unsupported-character-glyph} variable; by default, this glyph
465 is an empty triangle. Use the @kbd{C-u C-x =} command to display the
466 actual code and character set of such characters. @xref{Position
467 Info,,,emacs, the Emacs Manual}.
468
469 @findex codepage-setup
470 By default, Emacs defines a coding system to support the current
471 codepage. To define a coding system for some other codepage (e.g., to
472 visit a file written on a DOS machine in another country), use the
473 @kbd{M-x codepage-setup} command. It prompts for the 3-digit code of
474 the codepage, with completion, then creates the coding system for the
475 specified codepage. You can then use the new coding system to read and
476 write files, but you must specify it explicitly for the file command
477 when you want to use it (@pxref{Text Coding,,,emacs, the Emacs Manual}).
478
479 These coding systems are also useful for visiting a file encoded using
480 a DOS codepage, using Emacs running on some other operating system.
481
482 @cindex MS-Windows codepages
483 MS-Windows provides its own codepages, which are different from the
484 DOS codepages for the same locale. For example, DOS codepage 850
485 supports the same character set as Windows codepage 1252; DOS codepage
486 855 supports the same character set as Windows codepage 1251, etc.
487 The MS-Windows version of Emacs uses the current codepage for display
488 when invoked with the @samp{-nw} option. Support for codepages in the
489 Windows port of Emacs is part of the @file{code-pages.el} package.
490
491 @node MS-DOS Processes
492 @subsection Subprocesses on MS-DOS
493
494 @cindex compilation under MS-DOS
495 @cindex inferior processes under MS-DOS
496 @findex compile @r{(MS-DOS)}
497 @findex grep @r{(MS-DOS)}
498 Because MS-DOS is a single-process ``operating system,''
499 asynchronous subprocesses are not available. In particular, Shell
500 mode and its variants do not work. Most Emacs features that use
501 asynchronous subprocesses also don't work on MS-DOS, including
502 Shell mode and GUD. When in doubt, try and see; commands that
503 don't work output an error message saying that asynchronous processes
504 aren't supported.
505
506 Compilation under Emacs with @kbd{M-x compile}, searching files with
507 @kbd{M-x grep} and displaying differences between files with @kbd{M-x
508 diff} do work, by running the inferior processes synchronously. This
509 means you cannot do any more editing until the inferior process
510 finishes.
511
512 Spell checking also works, by means of special support for synchronous
513 invocation of the @code{ispell} program. This is slower than the
514 asynchronous invocation on other platforms
515
516 Instead of the Shell mode, which doesn't work on MS-DOS, you can use
517 the @kbd{M-x eshell} command. This invokes the Eshell package that
518 implements a Posix-like shell entirely in Emacs Lisp.
519
520 By contrast, Emacs compiled as a native Windows application
521 @strong{does} support asynchronous subprocesses. @xref{Windows
522 Processes,,,emacs, the Emacs Manual}.
523
524 @cindex printing under MS-DOS
525 Printing commands, such as @code{lpr-buffer}
526 (@pxref{Printing,,,emacs, the Emacs Manual}) and
527 @code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}),
528 work in MS-DOS by sending the output to one of the printer ports.
529 @xref{MS-DOS Printing,,,emacs, the Emacs Manual}.
530
531 When you run a subprocess synchronously on MS-DOS, make sure the
532 program terminates and does not try to read keyboard input. If the
533 program does not terminate on its own, you will be unable to terminate
534 it, because MS-DOS provides no general way to terminate a process.
535 Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these
536 cases.
537
538 Accessing files on other machines is not supported on MS-DOS. Other
539 network-oriented commands such as sending mail, Web browsing, remote
540 login, etc., don't work either, unless network access is built into
541 MS-DOS with some network redirector.
542
543 @cindex directory listing on MS-DOS
544 @vindex dired-listing-switches @r{(MS-DOS)}
545 Dired on MS-DOS uses the @code{ls-lisp} package where other
546 platforms use the system @code{ls} command. Therefore, Dired on
547 MS-DOS supports only some of the possible options you can mention in
548 the @code{dired-listing-switches} variable. The options that work are
549 @samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S},
550 @samp{-s}, @samp{-t}, and @samp{-u}.