how Emacs displays glyphs and characters which aren't supported by the
native font built into the DOS display.
+@cindex cursor shape on MS-DOS
+ When Emacs starts, it changes the cursor shape to a solid box. This
+is for compatibility with the Unix version, where the box cursor is the
+default. This default shape can be changed to a bar by specifying the
+@code{cursor-type} parameter in the variable @code{default-frame-alist}
+(@pxref{Creating Frames}). The MS-DOS terminal doesn't support a
+vertical-bar cursor, so the bar cursor is horizontal, and the
+@code{@var{width}} parameter, if specified by the frame parameters,
+actually determines its height. As an extension, the bar cursor
+specification can include the starting scan line of the cursor as well
+as its width, like this:
+
+@example
+ '(cursor-type bar @var{width} . @var{start})
+@end example
+
+@noindent
+In addition, if the @var{width} parameter is negative, the cursor bar
+begins at the top of the character cell.
+
@cindex frames on MS-DOS
Multiple frames (@pxref{Frames}) are supported on MS-DOS, but they all
overlap, so you only see a single frame at any given moment. That
turn on support for long file names. If you do that, Emacs doesn't
truncate file names or convert them to lower case; instead, it uses the
file names that you specify, verbatim. To enable long file name
-support, set the environment variable @code{LFN} to @samp{y} before
+support, set the environment variable @env{LFN} to @samp{y} before
starting Emacs. Unfortunately, Windows NT doesn't allow DOS programs to
access long file names, so Emacs built for MS-DOS will only see their
short 8+3 aliases.
-@cindex @code{HOME} directory under MS-DOS
+@cindex @env{HOME} directory under MS-DOS
MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
-that the directory where it is installed is the value of @code{HOME}
+that the directory where it is installed is the value of @env{HOME}
environment variable. That is, if your Emacs binary,
@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then
-Emacs acts as if @code{HOME} were set to @samp{c:/utils/emacs}. In
+Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In
particular, that is where Emacs looks for the init file @file{_emacs}.
With this in mind, you can use @samp{~} in file names as an alias for
-the home directory, as you would in Unix. You can also set @code{HOME}
+the home directory, as you would in Unix. You can also set @env{HOME}
variable in the environment before starting Emacs; its value will then
override the above default behavior.
handles conversion of international character codes does this conversion
also (@pxref{Coding Systems}).
-@cindex cursor location, under MS-DOS
-@cindex point location, under MS-DOS
+@cindex cursor location, on MS-DOS
+@cindex point location, on MS-DOS
One consequence of this special format-conversion of most files is
that character positions as reported by Emacs (@pxref{Position Info}) do
not agree with the file size information known to the operating system.
-@vindex file-name-buffer-file-type-alist
- Some kinds of files should not be converted, because their contents
-are not really text. Therefore, Emacs on MS-DOS distinguishes certain
-files as @dfn{binary files}, and reads and writes them verbatim. (This
-distinction is not part of MS-DOS; it is made by Emacs only.) These
-include executable programs, compressed archives, etc. Emacs uses the
-file name to decide whether to treat a file as binary: the variable
-@code{file-name-buffer-file-type-alist} defines the file-name patterns
-that indicate binary files. Note that if a file name matches one of the
-patterns for binary files in @code{file-name-buffer-file-type-alist},
-Emacs uses the @code{no-conversion} coding system (@pxref{Coding
-Systems}) which turns off @emph{all} coding-system conversions, not only
-the EOL conversion.
-
In addition, if Emacs recognizes from a file's contents that it uses
newline rather than carriage-return linefeed as its line separator, it
-does not perform conversion when reading or writing that file. Thus,
+does not perform EOL conversion when reading or writing that file. Thus,
you can read and edit files from Unix or GNU systems on MS-DOS with no
special effort, and they will be left with their Unix-style EOLs.
-@findex find-file-text
-@findex find-file-binary
- You can visit a file and specify whether to treat a file as text or
-binary using the commands @code{find-file-text} and
-@code{find-file-binary}. End-of-line conversion is part of the general
-coding system conversion mechanism, so another way to control whether to
-treat a file as text or binary is with the commands for specifying a
-coding system (@pxref{Specify Coding}). For example,
-@kbd{C-x @key{RET} c undecided-unix @key{RET} C-x C-f foobar.txt}
-visits the file @file{foobar.txt} without converting the EOLs.
-
The mode line indicates whether end-of-line translation was used for
-the current buffer. Normally a colon appears after the coding system
-letter near the beginning of the mode line. If MS-DOS end-of-line
-translation is in use for the buffer, this character changes to a
-backslash.
+the current buffer. If MS-DOS end-of-line translation is in use for the
+buffer, a backslash @samp{\} is displayed after the coding system
+mnemonic near the beginning of the mode line (@pxref{Mode Line}). If no
+EOL translation was performed, the string @samp{(Unix)} is displayed
+instead of the backslash, to alert you that the file's EOL format is not
+the usual carriage-return linefeed.
+
+@cindex DOS-to-Unix conversion of files
+@pindex dos2unix
+ End-of-line conversion is part of the general coding system conversion
+mechanism, so the way to control whether to treat a text file as
+DOS-style or Unix-style is with the commands for specifying a coding
+system (@pxref{Specify Coding}). For example, @kbd{C-x @key{RET} c unix
+@key{RET} C-x C-f foobar.txt} visits the file @file{foobar.txt} without
+converting the EOLs; if that file has carriage-return linefeed pairs at
+the end of its lines, Emacs will display @samp{^M} at the end of each
+line. Similarly, you can force Emacs to save a buffer with specific EOL
+format with the @kbd{C-x @key{RET} f} command. For example, to save a
+buffer with Unix EOL format, type @kbd{C-x @key{RET} f unix @key{RET}
+C-x C-s}. Thus, visiting a file with DOS EOL conversion, then saving it
+with Unix EOL format effectively converts the file to Unix text style,
+like the popular program @code{dos2unix} does.
@cindex untranslated file system
@findex add-untranslated-filesystem
one argument, which should be a string just like the one that was used
previously with @code{add-untranslated-filesystem}.
+ Designating a file system as untranslated does @strong{not} disable
+code conversions as specified by the coding systems set up by your
+language environment, it only affects the EOL conversions, by forcing
+Emacs to create new files with Unix-style newline-only EOLs.
+
+@vindex file-name-buffer-file-type-alist
+@cindex binary files, on MS-DOS/MS-Windows
+ Some kinds of files should not be converted at all, because their
+contents are not really text. Therefore, Emacs on MS-DOS distinguishes
+certain files as @dfn{binary files}. (This distinction is not part of
+MS-DOS; it is made by Emacs only.) Binary files include executable
+programs, compressed archives, etc. Emacs uses the file name to decide
+whether to treat a file as binary: the variable
+@code{file-name-buffer-file-type-alist} defines the file-name patterns
+that indicate binary files. If a file name matches one of the patterns
+for binary files (those whose associations are of the type
+@code{(@var{pattern} . t)}, Emacs reads and writes that file using the
+@code{no-conversion} coding system (@pxref{Coding Systems}) which turns
+off @emph{all} coding-system conversions, not only the EOL conversion.
+@code{file-name-buffer-file-type-alist} also includes file-name patterns
+for files which are known to be DOS-style text files with
+carriage-return linefeed EOL format, such as @file{CONFIG.SYS}; Emacs
+always writes those files with DOS-style EOLs.
+
+ If a file which belongs to an untranslated file system matches one of
+the file-name patterns in @code{file-name-buffer-file-type-alist}, the
+EOL conversion is determined by @code{file-name-buffer-file-type-alist}.
+
+@findex find-file-text
+@findex find-file-binary
+ You can visit a file and specify whether to treat it as text or binary
+using the commands @code{find-file-text} and @code{find-file-binary}.
+@code{find-file-text} specifies DOS EOL conversions, but leaves the
+other coding conversions unspecified (Emacs determines the required
+conversions via the usual defaults and coding-detection mechanisms). On
+the other hand, @code{find-file-binary} turns off @emph{all}
+coding-system conversions.
+
+@findex find-file-literally@r{, and binary files}
+ The @code{find-file-text} and @code{find-file-binary} commands are
+only available when Emacs runs on MS-DOS or MS-Windows. The command
+@code{find-file-literally}, which is available on all platforms,
+produces the same effect as @code{find-file-binary}.
+
@node MS-DOS Printing
@section Printing and MS-DOS
Printing commands, such as @code{lpr-buffer} (@pxref{Hardcopy}) and
-@code{ps-print-buffer} (@pxref{Postscript}) can work in MS-DOS and
+@code{ps-print-buffer} (@pxref{PostScript}) can work in MS-DOS and
MS-Windows by sending the output to one of the printer ports, if a
Unix-style @code{lpr} program is unavailable. This behaviour is
controlled by the same variables that control printing with @code{lpr}
-on Unix (@pxref{Hardcopy}, @pxref{Postscript Variables}), but the
+on Unix (@pxref{Hardcopy}, @pxref{PostScript Variables}), but the
defaults for these variables on MS-DOS and MS-Windows are not the same
as the defaults on Unix.
-@vindex printer-name
+@vindex printer-name @r{(MS-DOS)}
If you want to use your local printer, printing on it in the usual DOS
manner, then set the Lisp variable @code{lpr-command} to @code{""} (its
default value) and @code{printer-name} to the name of the printer
@code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward
slashes or backslashes here.) To find out the names of shared printers,
run the command @samp{net view} at a DOS command prompt to obtain a list
-of servers, and @samp{net view server-name} to see the names of printers
+of servers, and @samp{net view @var{server-name}} to see the names of printers
(and directories) shared by that server.
If you set @code{printer-name} to a file name, it's best to use an
@findex ps-print-buffer @r{(MS-DOS)}
@findex ps-spool-buffer @r{(MS-DOS)}
-@vindex ps-printer-name
+@vindex ps-printer-name @r{(MS-DOS)}
@vindex ps-lpr-command @r{(MS-DOS)}
@vindex ps-lpr-switches @r{(MS-DOS)}
A parallel set of variables, @code{ps-lpr-command},
-@code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{Postscript
+@code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript
Variables}), defines how PostScript files should be printed. These
variables are used in the same way as the corresponding variables
described above for non-PostScript printing. Thus, the value of
ignored.)
For example, to use Ghostscript for printing on an Epson printer
-connected to @samp{LPT2} port, put this on your @file{.emacs} file:
+connected to the @samp{LPT2} port, put this in your @file{_emacs} file:
@example
(setq ps-printer-name t) ; Ghostscript doesn't understand -P
your init file.
@cindex language environment, automatic selection on @r{MS-DOS}
- Multibyte Emacs supports only certain DOS codepages, those that encode
-a single ISO 8859 character set, and it knows which ISO character set
-based on the codepage number. Emacs automatically creates a coding
-system to support reading and writing files that use the current
-codepage, and uses this coding system by default. The name of this
-coding system is @code{cp@var{nnn}}, where @var{nnn} is the codepage
-number.@footnote{The standard Emacs coding systems for ISO 8859 are not
-quite right for the purpose, because typically the DOS codepage does not
-match the standard ISO character codes. For example, the
-letter @samp{@,{c}} (@samp{c} with cedilla) has code 231 in the standard
-Latin-1 character set, but the corresponding DOS codepage 850 uses code
-135 for this glyph.}
+ Multibyte Emacs supports only certain DOS codepages: those which can
+display Far-Eastern scripts, like the Japanese codepage 932, and those
+that encode a single ISO 8859 character set.
+
+ The Far-Eastern codepages can directly display one of the MULE
+character sets for these countries, so Emacs simply sets up to use the
+appropriate terminal coding system that is supported by the codepage.
+The special features described in the rest of this section mostly
+pertain to codepages that encode ISO 8859 character sets.
+
+ For the codepages which correspond to one of the ISO character sets,
+Emacs knows the character set name based on the codepage number. Emacs
+automatically creates a coding system to support reading and writing
+files that use the current codepage, and uses this coding system by
+default. The name of this coding system is @code{cp@var{nnn}}, where
+@var{nnn} is the codepage number.@footnote{The standard Emacs coding
+systems for ISO 8859 are not quite right for the purpose, because
+typically the DOS codepage does not match the standard ISO character
+codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has
+code 231 in the standard Latin-1 character set, but the corresponding
+DOS codepage 850 uses code 135 for this glyph.}
@cindex mode line @r{(MS-DOS)}
All the @code{cp@var{nnn}} coding systems use the letter @samp{D} (for
system and the default coding system for file I/O are set to the proper
@code{cp@var{nnn}} coding system at startup, it is normal for the mode
line on MS-DOS to begin with @samp{-DD\-}. @xref{Mode Line}.
+Far-Eastern DOS terminals do not use the @code{cp@var{nnn}} coding
+systems, and thus their initial mode line looks like on Unix.
Since the codepage number also indicates which script you are using,
Emacs automatically runs @code{set-language-environment} to select the
@cindex printing under MS-DOS
Printing commands, such as @code{lpr-buffer} (@pxref{Hardcopy}) and
-@code{ps-print-buffer} (@pxref{Postscript}), work in MS-DOS by sending
+@code{ps-print-buffer} (@pxref{PostScript}), work in MS-DOS by sending
the output to one of the printer ports. @xref{MS-DOS Printing}.
When you run a subprocess synchronously on MS-DOS, make sure the