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