Mercurial > emacs
annotate man/msdog.texi @ 35299:ff1e51ba81cb
(define-ccl-program): Fix docstring.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 15 Jan 2001 00:38:41 +0000 |
parents | 94d46968a93f |
children | 86e871a073b6 |
rev | line source |
---|---|
24095 | 1 @c This is part of the Emacs manual. |
34200
551b6c1b5ee5
Update due to inclusion of macos.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
31060
diff
changeset
|
2 @c Copyright (C) 1985,86,87,93,94,95,1997,2000 Free Software Foundation, Inc. |
24095 | 3 @c See file emacs.texi for copying conditions. |
34200
551b6c1b5ee5
Update due to inclusion of macos.texi.
Eli Zaretskii <eliz@gnu.org>
parents:
31060
diff
changeset
|
4 @node MS-DOS, Manifesto, Mac OS, Top |
24095 | 5 @appendix Emacs and MS-DOS |
6 @cindex MS-DOG | |
7 @cindex MS-DOS peculiarities | |
8 | |
9 This section briefly describes the peculiarities of using Emacs under | |
10 the MS-DOS ``operating system'' (also known as ``MS-DOG''). If you | |
11 build Emacs for MS-DOS, the binary will also run on Windows 3.X, Windows | |
12 NT, Windows 9X, or OS/2 as a DOS application; the information in this | |
13 chapter applies for all of those systems, if you use an Emacs that was | |
14 built for MS-DOS. | |
15 | |
16 Note that it is possible to build Emacs specifically for Windows NT or | |
17 Windows 9X. If you do that, most of this chapter does not apply; | |
18 instead, you get behavior much closer to what is documented in the rest | |
19 of the manual, including support for long file names, multiple frames, | |
20 scroll bars, mouse menus, and subprocesses. However, the section on | |
21 text files and binary files does still apply. There are also two | |
22 sections at the end of this chapter which apply specifically for Windows | |
23 NT and 9X. | |
24 | |
25 @menu | |
26 * Input: MS-DOS Input. Keyboard and mouse usage on MS-DOS. | |
27 * Display: MS-DOS Display. Fonts, frames and display size on MS-DOS. | |
28 * Files: MS-DOS File Names. File name conventions on MS-DOS. | |
29 * Text and Binary:: Text files on MS-DOS use CRLF to separate lines. | |
30 * Printing: MS-DOS Printing. How to specify the printer on MS-DOS. | |
31 * I18N: MS-DOS and MULE. Support for internationalization on MS-DOS. | |
32 * Processes: MS-DOS Processes. Running subprocesses on MS-DOS. | |
33 * Windows Processes:: Running subprocesses on Windows. | |
34 * Windows System Menu:: Controlling what the ALT key does. | |
35 @end menu | |
36 | |
37 @node MS-DOS Input | |
38 @section Keyboard and Mouse on MS-DOS | |
39 | |
40 @cindex Meta (under MS-DOS) | |
41 @cindex Hyper (under MS-DOS) | |
42 @cindex Super (under MS-DOS) | |
43 @vindex dos-super-key | |
44 @vindex dos-hyper-key | |
45 The PC keyboard maps use the left @key{ALT} key as the @key{META} key. | |
46 You have two choices for emulating the @key{SUPER} and @key{HYPER} keys: | |
47 choose either the right @key{CTRL} key or the right @key{ALT} key by | |
48 setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1 | |
49 or 2 respectively. If neither @code{dos-super-key} nor | |
50 @code{dos-hyper-key} is 1, then by default the right @key{ALT} key is | |
51 also mapped to the @key{META} key. However, if the MS-DOS international | |
52 keyboard support program @file{KEYB.COM} is installed, Emacs will | |
53 @emph{not} map the right @key{ALT} to @key{META}, since it is used for | |
54 accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard | |
55 layouts; in this case, you may only use the left @key{ALT} as @key{META} | |
56 key. | |
57 | |
58 @kindex C-j @r{(MS-DOS)} | |
59 @vindex dos-keypad-mode | |
60 The variable @code{dos-keypad-mode} is a flag variable that controls | |
61 what key codes are returned by keys in the numeric keypad. You can also | |
62 define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the | |
63 following line into your @file{_emacs} file: | |
64 | |
65 @smallexample | |
66 ;; Make the Enter key from the Numeric keypad act as C-j. | |
67 (define-key function-key-map [kp-enter] [?\C-j]) | |
68 @end smallexample | |
69 | |
70 @kindex DEL @r{(MS-DOS)} | |
71 @kindex BS @r{(MS-DOS)} | |
72 The key that is called @key{DEL} in Emacs (because that's how it is | |
73 designated on most workstations) is known as @key{BS} (backspace) on a | |
74 PC. That is why the PC-specific terminal initialization remaps the | |
75 @key{BS} key to act as @key{DEL}; the @key{DEL} key is remapped to act | |
76 as @kbd{C-d} for the same reasons. | |
77 | |
78 @kindex C-g @r{(MS-DOS)} | |
79 @kindex C-BREAK @r{(MS-DOS)} | |
80 @cindex quitting on MS-DOS | |
81 Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit | |
82 character, just like @kbd{C-g}. This is because Emacs cannot detect | |
83 that you have typed @kbd{C-g} until it is ready for more input. As a | |
84 consequence, you cannot use @kbd{C-g} to stop a running command | |
85 (@pxref{Quitting}). By contrast, @kbd{C-@key{BREAK}} @emph{is} detected | |
86 as soon as you type it (as @kbd{C-g} is on other systems), so it can be | |
87 used to stop a running command and for emergency escape | |
88 (@pxref{Emergency Escape}). | |
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}). Scroll bars don't work in | |
94 MS-DOS Emacs. PC mice usually have only two buttons; these act as | |
95 @kbd{Mouse-1} and @kbd{Mouse-2}, but if you press both of them | |
30534
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
96 together, that has the effect of @kbd{Mouse-3}. If the mouse does have |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
97 3 buttons, Emacs detects that at startup, and all the 3 buttons function |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
98 normally, as on X. |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
99 |
31057
40ac457814bc
Document support for help strings and mouse highlight.
Eli Zaretskii <eliz@gnu.org>
parents:
30534
diff
changeset
|
100 Help strings for menu-bar and pop-up menus are displayed in the echo |
40ac457814bc
Document support for help strings and mouse highlight.
Eli Zaretskii <eliz@gnu.org>
parents:
30534
diff
changeset
|
101 area when the mouse pointer moves across the menu items. |
40ac457814bc
Document support for help strings and mouse highlight.
Eli Zaretskii <eliz@gnu.org>
parents:
30534
diff
changeset
|
102 Highlighting of mouse-sensitive text (@pxref{Mouse References}) is also |
40ac457814bc
Document support for help strings and mouse highlight.
Eli Zaretskii <eliz@gnu.org>
parents:
30534
diff
changeset
|
103 supported. |
40ac457814bc
Document support for help strings and mouse highlight.
Eli Zaretskii <eliz@gnu.org>
parents:
30534
diff
changeset
|
104 |
30534
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
105 @cindex mouse, set number of buttons |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
106 @findex msdos-set-mouse-buttons |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
107 Some versions of mouse drivers don't report the number of mouse |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
108 buttons correctly. For example, mice with a wheel report that they have |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
109 3 buttons, but only 2 of them are passed to Emacs; the clicks on the |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
110 wheel, which serves as the middle button, are not passed. In these |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
111 cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command to set |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
112 the notion of number of buttons used by Emacs. This command prompts for |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
113 the number of buttons, and forces Emacs to behave as if your mouse had |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
114 that number of buttons. You could make such a setting permanent by |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
115 adding this fragment to your @file{_emacs} init file: |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
116 |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
117 @example |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
118 ;; Force Emacs to behave as if the mouse had |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
119 ;; only 2 buttons |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
120 (msdos-set-mouse-buttons 2) |
cddd0f1a86b1
(MS-DOS Input): Document msdos-set-mouse-buttons.
Eli Zaretskii <eliz@gnu.org>
parents:
29853
diff
changeset
|
121 @end example |
24095 | 122 |
123 @cindex Windows clipboard support | |
124 Emacs built for MS-DOS supports clipboard operations when it runs on | |
125 Windows. Commands that put text on the kill ring, or yank text from the | |
35188
94d46968a93f
Don't say "X Windows". From Colin Walters <walters@cis.ohio-state.edu>.
Eli Zaretskii <eliz@gnu.org>
parents:
34293
diff
changeset
|
126 ring, check the Windows clipboard first, just as Emacs does on the X |
94d46968a93f
Don't say "X Windows". From Colin Walters <walters@cis.ohio-state.edu>.
Eli Zaretskii <eliz@gnu.org>
parents:
34293
diff
changeset
|
127 Window System (@pxref{Mouse Commands}). Only the primary selection and |
94d46968a93f
Don't say "X Windows". From Colin Walters <walters@cis.ohio-state.edu>.
Eli Zaretskii <eliz@gnu.org>
parents:
34293
diff
changeset
|
128 the cut buffer are supported by MS-DOS Emacs on Windows; the secondary |
94d46968a93f
Don't say "X Windows". From Colin Walters <walters@cis.ohio-state.edu>.
Eli Zaretskii <eliz@gnu.org>
parents:
34293
diff
changeset
|
129 selection always appears as empty. |
24095 | 130 |
131 Due to the way clipboard access is implemented by Windows, the | |
132 length of text you can put into the clipboard is limited by the amount | |
133 of free DOS memory that is available to Emacs. Usually, up to 620KB of | |
134 text can be put into the clipboard, but this limit depends on the system | |
135 configuration and is lower if you run Emacs as a subprocess of | |
136 another program. If the killed text does not fit, Emacs prints a | |
137 message saying so, and does not put the text into the clipboard. | |
138 | |
139 Null characters also cannot be put into the Windows clipboard. If the | |
140 killed text includes null characters, Emacs does not put such text into | |
141 the clipboard, and prints in the echo area a message to that effect. | |
142 | |
143 @vindex dos-display-scancodes | |
144 The variable @code{dos-display-scancodes}, when non-@code{nil}, | |
145 directs Emacs to display the ASCII value and the keyboard scan code of | |
146 each keystroke; this feature serves as a complement to the | |
147 @code{view-lossage} command, for debugging. | |
148 | |
149 @node MS-DOS Display | |
150 @section Display on MS-DOS | |
151 @cindex faces under MS-DOS | |
152 @cindex fonts, emulating under MS-DOS | |
153 | |
154 Display on MS-DOS cannot use font variants, like bold or italic, | |
155 but it does support | |
156 multiple faces, each of which can specify a foreground and a background | |
157 color. Therefore, you can get the full functionality of Emacs packages | |
158 that use fonts (such as @code{font-lock}, Enriched Text mode, and | |
159 others) by defining the relevant faces to use different colors. Use the | |
160 @code{list-colors-display} command (@pxref{Frame Parameters}) and the | |
161 @code{list-faces-display} command (@pxref{Faces}) to see what colors and | |
162 faces are available and what they look like. | |
163 | |
164 The section @ref{MS-DOS and MULE}, later in this chapter, describes | |
165 how Emacs displays glyphs and characters which aren't supported by the | |
166 native font built into the DOS display. | |
167 | |
28093
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
168 @cindex cursor shape on MS-DOS |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
169 When Emacs starts, it changes the cursor shape to a solid box. This |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
170 is for compatibility with the Unix version, where the box cursor is the |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
171 default. This default shape can be changed to a bar by specifying the |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
172 @code{cursor-type} parameter in the variable @code{default-frame-alist} |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
173 (@pxref{Creating Frames}). The MS-DOS terminal doesn't support a |
29853
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
174 vertical-bar cursor, so the bar cursor is horizontal, and the |
28093
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
175 @code{@var{width}} parameter, if specified by the frame parameters, |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
176 actually determines its height. As an extension, the bar cursor |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
177 specification can include the starting scan line of the cursor as well |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
178 as its width, like this: |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
179 |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
180 @example |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
181 '(cursor-type bar @var{width} . @var{start}) |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
182 @end example |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
183 |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
184 @noindent |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
185 In addition, if the @var{width} parameter is negative, the cursor bar |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
186 begins at the top of the character cell. |
3e652235df91
(MS-DOS Display) Explain the differences in cursor type control
Eli Zaretskii <eliz@gnu.org>
parents:
27213
diff
changeset
|
187 |
24095 | 188 @cindex frames on MS-DOS |
189 Multiple frames (@pxref{Frames}) are supported on MS-DOS, but they all | |
190 overlap, so you only see a single frame at any given moment. That | |
191 single visible frame occupies the entire screen. When you run Emacs | |
192 from MS-Windows DOS box, you can make the visible frame smaller than | |
193 the full screen, but Emacs still cannot display more than a single | |
194 frame at a time. | |
195 | |
196 @cindex frame size under MS-DOS | |
197 @findex mode4350 | |
198 @findex mode25 | |
199 The @code{mode4350} command switches the display to 43 or 50 | |
200 lines, depending on your hardware; the @code{mode25} command switches | |
201 to the default 80x25 screen size. | |
202 | |
203 By default, Emacs only knows how to set screen sizes of 80 columns by | |
204 25, 28, 35, 40, 43 or 50 rows. However, if your video adapter has | |
205 special video modes that will switch the display to other sizes, you can | |
206 have Emacs support those too. When you ask Emacs to switch the frame to | |
207 @var{n} rows by @var{m} columns dimensions, it checks if there is a | |
208 variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so, | |
209 uses its value (which must be an integer) as the video mode to switch | |
210 to. (Emacs switches to that video mode by calling the BIOS @code{Set | |
211 Video Mode} function with the value of | |
212 @code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.) | |
213 For example, suppose your adapter will switch to 66x80 dimensions when | |
214 put into video mode 85. Then you can make Emacs support this screen | |
215 size by putting the following into your @file{_emacs} file: | |
216 | |
217 @example | |
218 (setq screen-dimensions-66x80 85) | |
219 @end example | |
220 | |
221 Since Emacs on MS-DOS can only set the frame size to specific | |
222 supported dimensions, it cannot honor every possible frame resizing | |
223 request. When an unsupported size is requested, Emacs chooses the next | |
224 larger supported size beyond the specified size. For example, if you | |
225 ask for 36x80 frame, you will get 40x80 instead. | |
226 | |
227 The variables @code{screen-dimensions-@var{n}x@var{m}} are used only | |
228 when they exactly match the specified size; the search for the next | |
229 larger supported size ignores them. In the above example, even if your | |
230 VGA supports 38x80 dimensions and you define a variable | |
231 @code{screen-dimensions-38x80} with a suitable value, you will still get | |
232 40x80 screen when you ask for a 36x80 frame. If you want to get the | |
233 38x80 size in this case, you can do it by setting the variable named | |
234 @code{screen-dimensions-36x80} with the same video mode value as | |
235 @code{screen-dimensions-38x80}. | |
236 | |
237 Changing frame dimensions on MS-DOS has the effect of changing all the | |
238 other frames to the new dimensions. | |
239 | |
240 @node MS-DOS File Names | |
241 @section File Names on MS-DOS | |
242 @cindex file names under MS-DOS | |
243 @cindex init file, default name under MS-DOS | |
244 | |
245 MS-DOS normally uses a backslash, @samp{\}, to separate name units | |
246 within a file name, instead of the slash used on other systems. Emacs | |
247 on MS-DOS permits use of either slash or backslash, and also knows | |
248 about drive letters in file names. | |
249 | |
250 On MS-DOS, file names are case-insensitive and limited to eight | |
251 characters, plus optionally a period and three more characters. Emacs | |
252 knows enough about these limitations to handle file names that were | |
253 meant for other operating systems. For instance, leading dots @samp{.} | |
254 in file names are invalid in MS-DOS, so Emacs transparently converts | |
255 them to underscores @samp{_}; thus your default init file (@pxref{Init | |
256 File}) is called @file{_emacs} on MS-DOS. Excess characters before or | |
257 after the period are generally ignored by MS-DOS itself; thus, if you | |
258 visit the file @file{LongFileName.EvenLongerExtension}, you will | |
259 silently get @file{longfile.eve}, but Emacs will still display the long | |
260 file name on the mode line. Other than that, it's up to you to specify | |
261 file names which are valid under MS-DOS; the transparent conversion as | |
262 described above only works on file names built into Emacs. | |
263 | |
264 @cindex backup file names on MS-DOS | |
265 The above restrictions on the file names on MS-DOS make it almost | |
266 impossible to construct the name of a backup file (@pxref{Backup | |
267 Names}) without losing some of the original file name characters. For | |
268 example, the name of a backup file for @file{docs.txt} is | |
269 @file{docs.tx~} even if single backup is used. | |
270 | |
271 @cindex file names under Windows 95/NT | |
272 @cindex long file names in DOS box under Windows 95/NT | |
273 If you run Emacs as a DOS application under Windows 9X, you can | |
274 turn on support for long file names. If you do that, Emacs doesn't | |
275 truncate file names or convert them to lower case; instead, it uses the | |
276 file names that you specify, verbatim. To enable long file name | |
29107 | 277 support, set the environment variable @env{LFN} to @samp{y} before |
24095 | 278 starting Emacs. Unfortunately, Windows NT doesn't allow DOS programs to |
279 access long file names, so Emacs built for MS-DOS will only see their | |
280 short 8+3 aliases. | |
281 | |
29107 | 282 @cindex @env{HOME} directory under MS-DOS |
24095 | 283 MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends |
29107 | 284 that the directory where it is installed is the value of @env{HOME} |
24095 | 285 environment variable. That is, if your Emacs binary, |
286 @file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then | |
29107 | 287 Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In |
24095 | 288 particular, that is where Emacs looks for the init file @file{_emacs}. |
289 With this in mind, you can use @samp{~} in file names as an alias for | |
29107 | 290 the home directory, as you would in Unix. You can also set @env{HOME} |
24095 | 291 variable in the environment before starting Emacs; its value will then |
292 override the above default behavior. | |
293 | |
294 Emacs on MS-DOS handles the directory name @file{/dev} specially, | |
295 because of a feature in the emulator libraries of DJGPP that pretends | |
296 I/O devices have names in that directory. We recommend that you avoid | |
297 using an actual directory named @file{/dev} on any disk. | |
298 | |
299 @node Text and Binary | |
300 @section Text Files and Binary Files | |
301 @cindex text and binary files on MS-DOS/MS-Windows | |
302 | |
303 GNU Emacs uses newline characters to separate text lines. This is the | |
304 convention used on Unix, on which GNU Emacs was developed, and on GNU | |
305 systems since they are modeled on Unix. | |
306 | |
307 @cindex end-of-line conversion on MS-DOS/MS-Windows | |
308 MS-DOS and MS-Windows normally use carriage-return linefeed, a | |
309 two-character sequence, to separate text lines. (Linefeed is the same | |
310 character as newline.) Therefore, convenient editing of typical files | |
311 with Emacs requires conversion of these end-of-line (EOL) sequences. | |
312 And that is what Emacs normally does: it converts carriage-return | |
313 linefeed into newline when reading files, and converts newline into | |
314 carriage-return linefeed when writing files. The same mechanism that | |
315 handles conversion of international character codes does this conversion | |
316 also (@pxref{Coding Systems}). | |
317 | |
29853
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
318 @cindex cursor location, on MS-DOS |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
319 @cindex point location, on MS-DOS |
24095 | 320 One consequence of this special format-conversion of most files is |
321 that character positions as reported by Emacs (@pxref{Position Info}) do | |
322 not agree with the file size information known to the operating system. | |
323 | |
324 In addition, if Emacs recognizes from a file's contents that it uses | |
325 newline rather than carriage-return linefeed as its line separator, it | |
29853
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
326 does not perform EOL conversion when reading or writing that file. Thus, |
24095 | 327 you can read and edit files from Unix or GNU systems on MS-DOS with no |
328 special effort, and they will be left with their Unix-style EOLs. | |
329 | |
29853
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
330 The mode line indicates whether end-of-line translation was used for |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
331 the current buffer. If MS-DOS end-of-line translation is in use for the |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
332 buffer, a backslash @samp{\} is displayed after the coding system |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
333 mnemonic near the beginning of the mode line (@pxref{Mode Line}). If no |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
334 EOL translation was performed, the string @samp{(Unix)} is displayed |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
335 instead of the backslash, to alert you that the file's EOL format is not |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
336 the usual carriage-return linefeed. |
24095 | 337 |
29853
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
338 @cindex DOS-to-Unix conversion of files |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
339 @pindex dos2unix |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
340 End-of-line conversion is part of the general coding system conversion |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
341 mechanism, so the way to control whether to treat a text file as |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
342 DOS-style or Unix-style is with the commands for specifying a coding |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
343 system (@pxref{Specify Coding}). For example, @kbd{C-x @key{RET} c unix |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
344 @key{RET} C-x C-f foobar.txt} visits the file @file{foobar.txt} without |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
345 converting the EOLs; if that file has carriage-return linefeed pairs at |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
346 the end of its lines, Emacs will display @samp{^M} at the end of each |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
347 line. Similarly, you can force Emacs to save a buffer with specific EOL |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
348 format with the @kbd{C-x @key{RET} f} command. For example, to save a |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
349 buffer with Unix EOL format, type @kbd{C-x @key{RET} f unix @key{RET} |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
350 C-x C-s}. Thus, visiting a file with DOS EOL conversion, then saving it |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
351 with Unix EOL format effectively converts the file to Unix text style, |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
352 like the popular program @code{dos2unix} does. |
24095 | 353 |
354 @cindex untranslated file system | |
355 @findex add-untranslated-filesystem | |
356 When you use NFS or Samba to access file systems that reside on | |
357 computers using Unix or GNU systems, Emacs should not perform | |
358 end-of-line translation on any files in these file systems--not even | |
359 when you create a new file. To request this, designate these file | |
360 systems as @dfn{untranslated} file systems by calling the function | |
361 @code{add-untranslated-filesystem}. It takes one argument: the file | |
362 system name, including a drive letter and optionally a directory. For | |
363 example, | |
364 | |
365 @example | |
366 (add-untranslated-filesystem "Z:") | |
367 @end example | |
368 | |
369 @noindent | |
370 designates drive Z as an untranslated file system, and | |
371 | |
372 @example | |
373 (add-untranslated-filesystem "Z:\\foo") | |
374 @end example | |
375 | |
376 @noindent | |
377 designates directory @file{\foo} on drive Z as an untranslated file | |
378 system. | |
379 | |
380 Most often you would use @code{add-untranslated-filesystem} in your | |
381 @file{_emacs} file, or in @file{site-start.el} so that all the users at | |
382 your site get the benefit of it. | |
383 | |
384 @findex remove-untranslated-filesystem | |
385 To countermand the effect of @code{add-untranslated-filesystem}, use | |
386 the function @code{remove-untranslated-filesystem}. This function takes | |
387 one argument, which should be a string just like the one that was used | |
388 previously with @code{add-untranslated-filesystem}. | |
389 | |
29853
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
390 Designating a file system as untranslated does @strong{not} disable |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
391 code conversions as specified by the coding systems set up by your |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
392 language environment, it only affects the EOL conversions, by forcing |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
393 Emacs to create new files with Unix-style newline-only EOLs. |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
394 |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
395 @vindex file-name-buffer-file-type-alist |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
396 @cindex binary files, on MS-DOS/MS-Windows |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
397 Some kinds of files should not be converted at all, because their |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
398 contents are not really text. Therefore, Emacs on MS-DOS distinguishes |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
399 certain files as @dfn{binary files}. (This distinction is not part of |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
400 MS-DOS; it is made by Emacs only.) Binary files include executable |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
401 programs, compressed archives, etc. Emacs uses the file name to decide |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
402 whether to treat a file as binary: the variable |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
403 @code{file-name-buffer-file-type-alist} defines the file-name patterns |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
404 that indicate binary files. If a file name matches one of the patterns |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
405 for binary files (those whose associations are of the type |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
406 @code{(@var{pattern} . t)}, Emacs reads and writes that file using the |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
407 @code{no-conversion} coding system (@pxref{Coding Systems}) which turns |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
408 off @emph{all} coding-system conversions, not only the EOL conversion. |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
409 @code{file-name-buffer-file-type-alist} also includes file-name patterns |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
410 for files which are known to be DOS-style text files with |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
411 carriage-return linefeed EOL format, such as @file{CONFIG.SYS}; Emacs |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
412 always writes those files with DOS-style EOLs. |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
413 |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
414 If a file which belongs to an untranslated file system matches one of |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
415 the file-name patterns in @code{file-name-buffer-file-type-alist}, the |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
416 EOL conversion is determined by @code{file-name-buffer-file-type-alist}. |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
417 |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
418 @findex find-file-text |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
419 @findex find-file-binary |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
420 You can visit a file and specify whether to treat it as text or binary |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
421 using the commands @code{find-file-text} and @code{find-file-binary}. |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
422 @code{find-file-text} specifies DOS EOL conversions, but leaves the |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
423 other coding conversions unspecified (Emacs determines the required |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
424 conversions via the usual defaults and coding-detection mechanisms). On |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
425 the other hand, @code{find-file-binary} turns off @emph{all} |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
426 coding-system conversions. |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
427 |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
428 @findex find-file-literally@r{, and binary files} |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
429 The @code{find-file-text} and @code{find-file-binary} commands are |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
430 only available when Emacs runs on MS-DOS or MS-Windows. The command |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
431 @code{find-file-literally}, which is available on all platforms, |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
432 produces the same effect as @code{find-file-binary}. |
d49e929bbdf6
(Text and Binary): Separate description of EOL
Eli Zaretskii <eliz@gnu.org>
parents:
29107
diff
changeset
|
433 |
24095 | 434 @node MS-DOS Printing |
435 @section Printing and MS-DOS | |
436 | |
437 Printing commands, such as @code{lpr-buffer} (@pxref{Hardcopy}) and | |
27213 | 438 @code{ps-print-buffer} (@pxref{PostScript}) can work in MS-DOS and |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
439 MS-Windows by sending the output to one of the printer ports, if a |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
440 Unix-style @code{lpr} program is unavailable. This behaviour is |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
441 controlled by the same variables that control printing with @code{lpr} |
27213 | 442 on Unix (@pxref{Hardcopy}, @pxref{PostScript Variables}), but the |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
443 defaults for these variables on MS-DOS and MS-Windows are not the same |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
444 as the defaults on Unix. |
24095 | 445 |
24723 | 446 @vindex printer-name @r{(MS-DOS)} |
24095 | 447 If you want to use your local printer, printing on it in the usual DOS |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
448 manner, then set the Lisp variable @code{lpr-command} to @code{""} (its |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
449 default value) and @code{printer-name} to the name of the printer |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
450 port---for example, @code{"PRN"}, the usual local printer port (that's |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
451 the default), or @code{"LPT2"}, or @code{"COM1"} for a serial printer. |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
452 You can also set @code{printer-name} to a file name, in which case |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
453 ``printed'' output is actually appended to that file. If you set |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
454 @code{printer-name} to @code{"NUL"}, printed output is silently |
24095 | 455 discarded (sent to the system null device). |
456 | |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
457 On MS-Windows, when the Windows network software is installed, you can |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
458 also use a printer shared by another machine by setting |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
459 @code{printer-name} to the UNC share name for that printer--for example, |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
460 @code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
461 slashes or backslashes here.) To find out the names of shared printers, |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
462 run the command @samp{net view} at a DOS command prompt to obtain a list |
24731 | 463 of servers, and @samp{net view @var{server-name}} to see the names of printers |
34293
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
464 (and directories) shared by that server. Alternatively, click the |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
465 @samp{Network Neighborhood} icon on your desktop, and look for machines |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
466 which share their printers via the network. |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
467 |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
468 Some printers expect DOS codepage encoding of non-ASCII text, even |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
469 though they are connected to a Windows machine which uses a different |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
470 encoding for the same locale. For example, in the Latin-1 locale, DOS |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
471 uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
472 MULE}. When you print to such printers from Windows, you can use the |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
473 @kbd{C-x RET c} (@code{universal-coding-system-argument}) command before |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
474 @kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
475 codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
476 M-x lpr-region RET} will print the region while converting it to the |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
477 codepage 850 encoding. You may need to create the @code{cp@var{nnn}} |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
478 coding system with @kbd{M-x codepage-setup}. |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
479 |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
480 If you set @code{printer-name} to a file name, it's best to use an |
24095 | 481 absolute file name. Emacs changes the working directory according to |
482 the default directory of the current buffer, so if the file name in | |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
483 @code{printer-name} is relative, you will end up with several such |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
484 files, each one in the directory of the buffer from which the printing |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
485 was done. |
24095 | 486 |
487 @findex print-buffer @r{(MS-DOS)} | |
488 @findex print-region @r{(MS-DOS)} | |
489 @vindex lpr-headers-switches @r{(MS-DOS)} | |
490 The commands @code{print-buffer} and @code{print-region} call the | |
491 @code{pr} program, or use special switches to the @code{lpr} program, to | |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
492 produce headers on each printed page. MS-DOS and MS-Windows don't |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
493 normally have these programs, so by default, the variable |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
494 @code{lpr-headers-switches} is set so that the requests to print page |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
495 headers are silently ignored. Thus, @code{print-buffer} and |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
496 @code{print-region} produce the same output as @code{lpr-buffer} and |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
497 @code{lpr-region}, respectively. If you do have a suitable @code{pr} |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
498 program (for example, from GNU Textutils), set |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
499 @code{lpr-headers-switches} to @code{nil}; Emacs will then call |
24095 | 500 @code{pr} to produce the page headers, and print the resulting output as |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
501 specified by @code{printer-name}. |
24095 | 502 |
503 @vindex print-region-function @r{(MS-DOS)} | |
504 @cindex lpr usage under MS-DOS | |
505 @vindex lpr-command @r{(MS-DOS)} | |
506 @vindex lpr-switches @r{(MS-DOS)} | |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
507 Finally, if you do have an @code{lpr} work-alike, you can set the |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
508 variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
509 @code{lpr} for printing, as on other systems. (If the name of the |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
510 program isn't @code{lpr}, set @code{lpr-command} to specify where to |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
511 find it.) The variable @code{lpr-switches} has its standard meaning |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
512 when @code{lpr-command} is not @code{""}. If the variable |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
513 @code{printer-name} has a string value, it is used as the value for the |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
514 @code{-P} option to @code{lpr}, as on Unix. |
24095 | 515 |
516 @findex ps-print-buffer @r{(MS-DOS)} | |
517 @findex ps-spool-buffer @r{(MS-DOS)} | |
24715 | 518 @vindex ps-printer-name @r{(MS-DOS)} |
24095 | 519 @vindex ps-lpr-command @r{(MS-DOS)} |
520 @vindex ps-lpr-switches @r{(MS-DOS)} | |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
521 A parallel set of variables, @code{ps-lpr-command}, |
27213 | 522 @code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript |
24564 | 523 Variables}), defines how PostScript files should be printed. These |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
524 variables are used in the same way as the corresponding variables |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
525 described above for non-PostScript printing. Thus, the value of |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
526 @code{ps-printer-name} is used as the name of the device (or file) to |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
527 which PostScript output is sent, just as @code{printer-name} is used for |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
528 non-PostScript printing. (There are two distinct sets of variables in |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
529 case you have two printers attached to two different ports, and only one |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
530 of them is a PostScript printer.) |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
531 |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
532 The default value of the variable @code{ps-lpr-command} is @code{""}, |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
533 which causes PostScript output to be sent to the printer port specified |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
534 by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
535 the name of a program which will accept PostScript files. Thus, if you |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
536 have a non-PostScript printer, you can set this variable to the name of |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
537 a PostScript interpreter program (such as Ghostscript). Any switches |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
538 that need to be passed to the interpreter program are specified using |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
539 @code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
540 string, it will be added to the list of switches as the value for the |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
541 @code{-P} option. This is probably only useful if you are using |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
542 @code{lpr}, so when using an interpreter typically you would set |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
543 @code{ps-printer-name} to something other than a string so it is |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
544 ignored.) |
24095 | 545 |
546 For example, to use Ghostscript for printing on an Epson printer | |
24715 | 547 connected to the @samp{LPT2} port, put this in your @file{_emacs} file: |
24095 | 548 |
549 @example | |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
550 (setq ps-printer-name t) ; Ghostscript doesn't understand -P |
24095 | 551 (setq ps-lpr-command "c:/gs/gs386") |
552 (setq ps-lpr-switches '("-q" "-dNOPAUSE" | |
553 "-sDEVICE=epson" | |
554 "-r240x72" | |
555 "-sOutputFile=LPT2" | |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
556 "-Ic:/gs")) |
24095 | 557 @end example |
558 | |
559 @noindent | |
560 (This assumes that Ghostscript is installed in the @file{"c:/gs"} | |
561 directory.) | |
562 | |
24096
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
563 @vindex dos-printer |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
564 @vindex dos-ps-printer |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
565 For backwards compatibility, the value of @code{dos-printer} |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
566 (@code{dos-ps-printer}), if it has a value, overrides the value of |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
567 @code{printer-name} (@code{ps-printer-name}), on MS-DOS and MS-Windows |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
568 only. |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
569 |
083c21910c49
(MS-DOS Printing): Rewrite section.
Andrew Innes <andrewi@gnu.org>
parents:
24095
diff
changeset
|
570 |
24095 | 571 @node MS-DOS and MULE |
572 @section International Support on MS-DOS | |
573 @cindex international support @r{(MS-DOS)} | |
574 | |
575 Emacs on MS-DOS supports the same international character sets as it | |
576 does on Unix and other platforms (@pxref{International}), including | |
577 coding systems for converting between the different character sets. | |
578 However, due to incompatibilities between MS-DOS/MS-Windows and Unix, | |
579 there are several DOS-specific aspects of this support that users should | |
580 be aware of. This section describes these aspects. | |
581 | |
582 @table @kbd | |
583 @item M-x dos-codepage-setup | |
584 Set up Emacs display and coding systems as appropriate for the current | |
585 DOS codepage. | |
586 | |
587 @item M-x codepage-setup | |
588 Create a coding system for a certain DOS codepage. | |
589 @end table | |
590 | |
591 @cindex codepage, MS-DOS | |
592 @cindex DOS codepages | |
593 MS-DOS is designed to support one character set of 256 characters at | |
594 any given time, but gives you a variety of character sets to choose | |
595 from. The alternative character sets are known as @dfn{DOS codepages}. | |
596 Each codepage includes all 128 ASCII characters, but the other 128 | |
597 characters (codes 128 through 255) vary from one codepage to another. | |
598 Each DOS codepage is identified by a 3-digit number, such as 850, 862, | |
599 etc. | |
600 | |
35188
94d46968a93f
Don't say "X Windows". From Colin Walters <walters@cis.ohio-state.edu>.
Eli Zaretskii <eliz@gnu.org>
parents:
34293
diff
changeset
|
601 In contrast to X, which lets you use several fonts at the same time, |
94d46968a93f
Don't say "X Windows". From Colin Walters <walters@cis.ohio-state.edu>.
Eli Zaretskii <eliz@gnu.org>
parents:
34293
diff
changeset
|
602 MS-DOS doesn't allow use of several codepages in a single session. |
24095 | 603 Instead, MS-DOS loads a single codepage at system startup, and you must |
604 reboot MS-DOS to change it@footnote{Normally, one particular codepage is | |
605 burnt into the display memory, while other codepages can be installed by | |
606 modifying system configuration files, such as @file{CONFIG.SYS}, and | |
607 rebooting.}. Much the same limitation applies when you run DOS | |
608 executables on other systems such as MS-Windows. | |
609 | |
610 @cindex unibyte operation @r{(MS-DOS)} | |
611 If you invoke Emacs on MS-DOS with the @samp{--unibyte} option | |
612 (@pxref{Initial Options}), Emacs does not perform any conversion of | |
613 non-ASCII characters. Instead, it reads and writes any non-ASCII | |
614 characters verbatim, and sends their 8-bit codes to the display | |
615 verbatim. Thus, unibyte Emacs on MS-DOS supports the current codepage, | |
616 whatever it may be, but cannot even represent any other characters. | |
617 | |
618 @vindex dos-codepage | |
619 For multibyte operation on MS-DOS, Emacs needs to know which | |
620 characters the chosen DOS codepage can display. So it queries the | |
621 system shortly after startup to get the chosen codepage number, and | |
622 stores the number in the variable @code{dos-codepage}. Some systems | |
623 return the default value 437 for the current codepage, even though the | |
624 actual codepage is different. (This typically happens when you use the | |
625 codepage built into the display hardware.) You can specify a different | |
626 codepage for Emacs to use by setting the variable @code{dos-codepage} in | |
627 your init file. | |
628 | |
629 @cindex language environment, automatic selection on @r{MS-DOS} | |
24615
393b5f9a3631
Fix wording for the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
24594
diff
changeset
|
630 Multibyte Emacs supports only certain DOS codepages: those which can |
24594
2105eae5069b
Describe Far-Eastern DOS terminal support.
Eli Zaretskii <eliz@gnu.org>
parents:
24564
diff
changeset
|
631 display Far-Eastern scripts, like the Japanese codepage 932, and those |
2105eae5069b
Describe Far-Eastern DOS terminal support.
Eli Zaretskii <eliz@gnu.org>
parents:
24564
diff
changeset
|
632 that encode a single ISO 8859 character set. |
2105eae5069b
Describe Far-Eastern DOS terminal support.
Eli Zaretskii <eliz@gnu.org>
parents:
24564
diff
changeset
|
633 |
2105eae5069b
Describe Far-Eastern DOS terminal support.
Eli Zaretskii <eliz@gnu.org>
parents:
24564
diff
changeset
|
634 The Far-Eastern codepages can directly display one of the MULE |
2105eae5069b
Describe Far-Eastern DOS terminal support.
Eli Zaretskii <eliz@gnu.org>
parents:
24564
diff
changeset
|
635 character sets for these countries, so Emacs simply sets up to use the |
2105eae5069b
Describe Far-Eastern DOS terminal support.
Eli Zaretskii <eliz@gnu.org>
parents:
24564
diff
changeset
|
636 appropriate terminal coding system that is supported by the codepage. |
2105eae5069b
Describe Far-Eastern DOS terminal support.
Eli Zaretskii <eliz@gnu.org>
parents:
24564
diff
changeset
|
637 The special features described in the rest of this section mostly |
2105eae5069b
Describe Far-Eastern DOS terminal support.
Eli Zaretskii <eliz@gnu.org>
parents:
24564
diff
changeset
|
638 pertain to codepages that encode ISO 8859 character sets. |
2105eae5069b
Describe Far-Eastern DOS terminal support.
Eli Zaretskii <eliz@gnu.org>
parents:
24564
diff
changeset
|
639 |
2105eae5069b
Describe Far-Eastern DOS terminal support.
Eli Zaretskii <eliz@gnu.org>
parents:
24564
diff
changeset
|
640 For the codepages which correspond to one of the ISO character sets, |
24615
393b5f9a3631
Fix wording for the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
24594
diff
changeset
|
641 Emacs knows the character set name based on the codepage number. Emacs |
393b5f9a3631
Fix wording for the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
24594
diff
changeset
|
642 automatically creates a coding system to support reading and writing |
393b5f9a3631
Fix wording for the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
24594
diff
changeset
|
643 files that use the current codepage, and uses this coding system by |
393b5f9a3631
Fix wording for the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
24594
diff
changeset
|
644 default. The name of this coding system is @code{cp@var{nnn}}, where |
393b5f9a3631
Fix wording for the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
24594
diff
changeset
|
645 @var{nnn} is the codepage number.@footnote{The standard Emacs coding |
393b5f9a3631
Fix wording for the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
24594
diff
changeset
|
646 systems for ISO 8859 are not quite right for the purpose, because |
393b5f9a3631
Fix wording for the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
24594
diff
changeset
|
647 typically the DOS codepage does not match the standard ISO character |
393b5f9a3631
Fix wording for the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
24594
diff
changeset
|
648 codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has |
393b5f9a3631
Fix wording for the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
24594
diff
changeset
|
649 code 231 in the standard Latin-1 character set, but the corresponding |
393b5f9a3631
Fix wording for the last change.
Eli Zaretskii <eliz@gnu.org>
parents:
24594
diff
changeset
|
650 DOS codepage 850 uses code 135 for this glyph.} |
24095 | 651 |
652 @cindex mode line @r{(MS-DOS)} | |
653 All the @code{cp@var{nnn}} coding systems use the letter @samp{D} (for | |
654 ``DOS'') as their mode-line mnemonic. Since both the terminal coding | |
655 system and the default coding system for file I/O are set to the proper | |
656 @code{cp@var{nnn}} coding system at startup, it is normal for the mode | |
657 line on MS-DOS to begin with @samp{-DD\-}. @xref{Mode Line}. | |
24594
2105eae5069b
Describe Far-Eastern DOS terminal support.
Eli Zaretskii <eliz@gnu.org>
parents:
24564
diff
changeset
|
658 Far-Eastern DOS terminals do not use the @code{cp@var{nnn}} coding |
2105eae5069b
Describe Far-Eastern DOS terminal support.
Eli Zaretskii <eliz@gnu.org>
parents:
24564
diff
changeset
|
659 systems, and thus their initial mode line looks like on Unix. |
24095 | 660 |
661 Since the codepage number also indicates which script you are using, | |
662 Emacs automatically runs @code{set-language-environment} to select the | |
663 language environment for that script (@pxref{Language Environments}). | |
664 | |
665 If a buffer contains a character belonging to some other ISO 8859 | |
666 character set, not the one that the chosen DOS codepage supports, Emacs | |
667 displays it using a sequence of ASCII characters. For example, if the | |
668 current codepage doesn't have a glyph for the letter @samp{@`o} (small | |
669 @samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where | |
670 the braces serve as a visual indication that this is a single character. | |
671 (This may look awkward for some non-Latin characters, such as those from | |
672 Greek or Hebrew alphabets, but it is still readable by a person who | |
673 knows the language.) Even though the character may occupy several | |
674 columns on the screen, it is really still just a single character, and | |
675 all Emacs commands treat it as one. | |
676 | |
677 @vindex dos-unsupported-character-glyph | |
678 Not all characters in DOS codepages correspond to ISO 8859 | |
679 characters---some are used for other purposes, such as box-drawing | |
680 characters and other graphics. Emacs cannot represent these characters | |
681 internally, so when you read a file that uses these characters, they are | |
682 converted into a particular character code, specified by the variable | |
683 @code{dos-unsupported-character-glyph}. | |
684 | |
685 Emacs supports many other characters sets aside from ISO 8859, but it | |
686 cannot display them on MS-DOS. So if one of these multibyte characters | |
24113
fd1968847853
(MS-DOS and MULE): dos-unsupported-character-glyph is
Eli Zaretskii <eliz@gnu.org>
parents:
24096
diff
changeset
|
687 appears in a buffer, Emacs on MS-DOS displays them as specified by the |
fd1968847853
(MS-DOS and MULE): dos-unsupported-character-glyph is
Eli Zaretskii <eliz@gnu.org>
parents:
24096
diff
changeset
|
688 @code{dos-unsupported-character-glyph} variable; by default, this glyph |
fd1968847853
(MS-DOS and MULE): dos-unsupported-character-glyph is
Eli Zaretskii <eliz@gnu.org>
parents:
24096
diff
changeset
|
689 is an empty triangle. Use the @kbd{C-u C-x =} command to display the |
fd1968847853
(MS-DOS and MULE): dos-unsupported-character-glyph is
Eli Zaretskii <eliz@gnu.org>
parents:
24096
diff
changeset
|
690 actual code and character set of such characters. @xref{Position Info}. |
24095 | 691 |
692 @findex codepage-setup | |
693 By default, Emacs defines a coding system to support the current | |
694 codepage. To define a coding system for some other codepage (e.g., to | |
695 visit a file written on a DOS machine in another country), use the | |
696 @kbd{M-x codepage-setup} command. It prompts for the 3-digit code of | |
697 the codepage, with completion, then creates the coding system for the | |
698 specified codepage. You can then use the new coding system to read and | |
699 write files, but you must specify it explicitly for the file command | |
700 when you want to use it (@pxref{Specify Coding}). | |
701 | |
702 These coding systems are also useful for visiting a file encoded using | |
703 a DOS codepage, using Emacs running on some other operating system. | |
704 | |
34293
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
705 @cindex MS-Windows codepages |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
706 MS-Windows features its own codepages, which are different from the |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
707 DOS codepages for the same locale. For example, DOS codepage 850 |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
708 supports the same character set as Windows codepage 1252; DOS codepage |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
709 855 supports the same character set as Windows codepage 1251, etc. |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
710 The MS-Windows version of Emacs uses the current codepage for display |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
711 when invoked with the @samp{-nw} option. |
4338fab68f06
Explain how to print on Windows to a printer that expecs DOS codepage
Eli Zaretskii <eliz@gnu.org>
parents:
34200
diff
changeset
|
712 |
24095 | 713 @node MS-DOS Processes |
714 @section Subprocesses on MS-DOS | |
715 | |
716 @cindex compilation under MS-DOS | |
717 @cindex inferior processes under MS-DOS | |
718 @findex compile @r{(MS-DOS)} | |
719 @findex grep @r{(MS-DOS)} | |
720 Because MS-DOS is a single-process ``operating system,'' | |
721 asynchronous subprocesses are not available. In particular, Shell | |
722 mode and its variants do not work. Most Emacs features that use | |
723 asynchronous subprocesses also don't work on MS-DOS, including | |
31060
d24cddac1e33
Document that ispell works, and mention Eshell as an alternative
Eli Zaretskii <eliz@gnu.org>
parents:
31057
diff
changeset
|
724 Shell mode and GUD. When in doubt, try and see; commands that |
24095 | 725 don't work print an error message saying that asynchronous processes |
726 aren't supported. | |
727 | |
728 Compilation under Emacs with @kbd{M-x compile}, searching files with | |
729 @kbd{M-x grep} and displaying differences between files with @kbd{M-x | |
730 diff} do work, by running the inferior processes synchronously. This | |
731 means you cannot do any more editing until the inferior process | |
732 finishes. | |
733 | |
31060
d24cddac1e33
Document that ispell works, and mention Eshell as an alternative
Eli Zaretskii <eliz@gnu.org>
parents:
31057
diff
changeset
|
734 Spell checking also works, by means of special support for synchronous |
d24cddac1e33
Document that ispell works, and mention Eshell as an alternative
Eli Zaretskii <eliz@gnu.org>
parents:
31057
diff
changeset
|
735 invocation of the @code{ispell} program. This is slower than the |
d24cddac1e33
Document that ispell works, and mention Eshell as an alternative
Eli Zaretskii <eliz@gnu.org>
parents:
31057
diff
changeset
|
736 asynchronous invocation on Unix. |
d24cddac1e33
Document that ispell works, and mention Eshell as an alternative
Eli Zaretskii <eliz@gnu.org>
parents:
31057
diff
changeset
|
737 |
d24cddac1e33
Document that ispell works, and mention Eshell as an alternative
Eli Zaretskii <eliz@gnu.org>
parents:
31057
diff
changeset
|
738 Instead of the Shell mode, which doesn't work on MS-DOS, you can use |
d24cddac1e33
Document that ispell works, and mention Eshell as an alternative
Eli Zaretskii <eliz@gnu.org>
parents:
31057
diff
changeset
|
739 the @kbd{M-x eshell} command. This invokes the Eshell package that |
d24cddac1e33
Document that ispell works, and mention Eshell as an alternative
Eli Zaretskii <eliz@gnu.org>
parents:
31057
diff
changeset
|
740 implements a Unix-like shell entirely in Emacs Lisp. |
d24cddac1e33
Document that ispell works, and mention Eshell as an alternative
Eli Zaretskii <eliz@gnu.org>
parents:
31057
diff
changeset
|
741 |
24095 | 742 By contrast, Emacs compiled as native Windows application |
743 @strong{does} support asynchronous subprocesses. @xref{Windows | |
744 Processes}. | |
745 | |
746 @cindex printing under MS-DOS | |
747 Printing commands, such as @code{lpr-buffer} (@pxref{Hardcopy}) and | |
27213 | 748 @code{ps-print-buffer} (@pxref{PostScript}), work in MS-DOS by sending |
24095 | 749 the output to one of the printer ports. @xref{MS-DOS Printing}. |
750 | |
751 When you run a subprocess synchronously on MS-DOS, make sure the | |
752 program terminates and does not try to read keyboard input. If the | |
753 program does not terminate on its own, you will be unable to terminate | |
754 it, because MS-DOS provides no general way to terminate a process. | |
755 Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these | |
756 cases. | |
757 | |
758 Accessing files on other machines is not supported on MS-DOS. Other | |
759 network-oriented commands such as sending mail, Web browsing, remote | |
760 login, etc., don't work either, unless network access is built into | |
761 MS-DOS with some network redirector. | |
762 | |
763 @cindex directory listing on MS-DOS | |
764 @vindex dired-listing-switches @r{(MS-DOS)} | |
765 Dired on MS-DOS uses the @code{ls-lisp} package where other | |
766 platforms use the system @code{ls} command. Therefore, Dired on | |
767 MS-DOS supports only some of the possible options you can mention in | |
768 the @code{dired-listing-switches} variable. The options that work are | |
769 @samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S}, | |
770 @samp{-s}, @samp{-t}, and @samp{-u}. | |
771 | |
772 @node Windows Processes | |
773 @section Subprocesses on Windows 95 and NT | |
774 | |
775 Emacs compiled as a native Windows application (as opposed to the DOS | |
776 version) includes full support for asynchronous subprocesses. | |
777 In the Windows version, synchronous and asynchronous subprocesses work | |
778 fine on both | |
779 Windows 95 and Windows NT as long as you run only 32-bit Windows | |
780 applications. However, when you run a DOS application in a subprocess, | |
781 you may encounter problems or be unable to run the application at all; | |
782 and if you run two DOS applications at the same time in two | |
783 subprocesses, you may have to reboot your system. | |
784 | |
785 Since the standard command interpreter (and most command line utilities) | |
786 on Windows 95 are DOS applications, these problems are significant when | |
787 using that system. But there's nothing we can do about them; only | |
788 Microsoft can fix them. | |
789 | |
790 If you run just one DOS application subprocess, the subprocess should | |
791 work as expected as long as it is ``well-behaved'' and does not perform | |
792 direct screen access or other unusual actions. If you have a CPU | |
793 monitor application, your machine will appear to be 100% busy even when | |
794 the DOS application is idle, but this is only an artifact of the way CPU | |
795 monitors measure processor load. | |
796 | |
797 You must terminate the DOS application before you start any other DOS | |
798 application in a different subprocess. Emacs is unable to interrupt or | |
799 terminate a DOS subprocess. The only way you can terminate such a | |
800 subprocess is by giving it a command that tells its program to exit. | |
801 | |
802 If you attempt to run two DOS applications at the same time in separate | |
803 subprocesses, the second one that is started will be suspended until the | |
804 first one finishes, even if either or both of them are asynchronous. | |
805 | |
806 If you can go to the first subprocess, and tell it to exit, the second | |
807 subprocess should continue normally. However, if the second subprocess | |
808 is synchronous, Emacs itself will be hung until the first subprocess | |
809 finishes. If it will not finish without user input, then you have no | |
810 choice but to reboot if you are running on Windows 95. If you are | |
811 running on Windows NT, you can use a process viewer application to kill | |
812 the appropriate instance of ntvdm instead (this will terminate both DOS | |
813 subprocesses). | |
814 | |
815 If you have to reboot Windows 95 in this situation, do not use the | |
816 @code{Shutdown} command on the @code{Start} menu; that usually hangs the | |
817 system. Instead, type @kbd{CTL-ALT-@key{DEL}} and then choose | |
818 @code{Shutdown}. That usually works, although it may take a few minutes | |
819 to do its job. | |
820 | |
821 @node Windows System Menu | |
822 @section Using the System Menu on Windows | |
823 | |
824 Emacs compiled as a native Windows application normally turns off the | |
825 Windows feature that tapping the @key{ALT} | |
826 key invokes the Windows menu. The reason is that the @key{ALT} also | |
827 serves as @key{META} in Emacs. When using Emacs, users often press the | |
828 @key{META} key temporarily and then change their minds; if this has the | |
829 effect of bringing up the Windows menu, it alters the meaning of | |
830 subsequent commands. Many users find this frustrating. | |
831 | |
832 @vindex w32-pass-alt-to-system | |
833 You can reenable Windows's default handling of tapping the @key{ALT} key | |
834 by setting @code{w32-pass-alt-to-system} to a non-@code{nil} value. | |
835 |