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