aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2000-06-22 14:51:22 +0000
committerEli Zaretskii2000-06-22 14:51:22 +0000
commit1ca54e6826f79e943dc8f737fbd2f31af287696c (patch)
tree88156033aea5de4a9d95ddcc9fe908cb8307ffd3
parentbb746ea696eceb06c11b4ceac1b9859e490c53b3 (diff)
downloademacs-1ca54e6826f79e943dc8f737fbd2f31af287696c.tar.gz
emacs-1ca54e6826f79e943dc8f737fbd2f31af287696c.zip
(Text and Binary): Separate description of EOL
conversions from the issues related to binary files.
-rw-r--r--man/msdog.texi103
1 files changed, 70 insertions, 33 deletions
diff --git a/man/msdog.texi b/man/msdog.texi
index a584a2e796d..e5eba8a9576 100644
--- a/man/msdog.texi
+++ b/man/msdog.texi
@@ -146,7 +146,7 @@ is for compatibility with the Unix version, where the box cursor is the
146default. This default shape can be changed to a bar by specifying the 146default. This default shape can be changed to a bar by specifying the
147@code{cursor-type} parameter in the variable @code{default-frame-alist} 147@code{cursor-type} parameter in the variable @code{default-frame-alist}
148(@pxref{Creating Frames}). The MS-DOS terminal doesn't support a 148(@pxref{Creating Frames}). The MS-DOS terminal doesn't support a
149vertical-bar cursor, so the bar cursor is horizontal, and the its 149vertical-bar cursor, so the bar cursor is horizontal, and the
150@code{@var{width}} parameter, if specified by the frame parameters, 150@code{@var{width}} parameter, if specified by the frame parameters,
151actually determines its height. As an extension, the bar cursor 151actually determines its height. As an extension, the bar cursor
152specification can include the starting scan line of the cursor as well 152specification can include the starting scan line of the cursor as well
@@ -290,48 +290,41 @@ carriage-return linefeed when writing files. The same mechanism that
290handles conversion of international character codes does this conversion 290handles conversion of international character codes does this conversion
291also (@pxref{Coding Systems}). 291also (@pxref{Coding Systems}).
292 292
293@cindex cursor location, under MS-DOS 293@cindex cursor location, on MS-DOS
294@cindex point location, under MS-DOS 294@cindex point location, on MS-DOS
295 One consequence of this special format-conversion of most files is 295 One consequence of this special format-conversion of most files is
296that character positions as reported by Emacs (@pxref{Position Info}) do 296that character positions as reported by Emacs (@pxref{Position Info}) do
297not agree with the file size information known to the operating system. 297not agree with the file size information known to the operating system.
298 298
299@vindex file-name-buffer-file-type-alist
300 Some kinds of files should not be converted, because their contents
301are not really text. Therefore, Emacs on MS-DOS distinguishes certain
302files as @dfn{binary files}, and reads and writes them verbatim. (This
303distinction is not part of MS-DOS; it is made by Emacs only.) These
304include executable programs, compressed archives, etc. Emacs uses the
305file name to decide whether to treat a file as binary: the variable
306@code{file-name-buffer-file-type-alist} defines the file-name patterns
307that indicate binary files. Note that if a file name matches one of the
308patterns for binary files in @code{file-name-buffer-file-type-alist},
309Emacs uses the @code{no-conversion} coding system (@pxref{Coding
310Systems}) which turns off @emph{all} coding-system conversions, not only
311the EOL conversion.
312
313 In addition, if Emacs recognizes from a file's contents that it uses 299 In addition, if Emacs recognizes from a file's contents that it uses
314newline rather than carriage-return linefeed as its line separator, it 300newline rather than carriage-return linefeed as its line separator, it
315does not perform conversion when reading or writing that file. Thus, 301does not perform EOL conversion when reading or writing that file. Thus,
316you can read and edit files from Unix or GNU systems on MS-DOS with no 302you can read and edit files from Unix or GNU systems on MS-DOS with no
317special effort, and they will be left with their Unix-style EOLs. 303special effort, and they will be left with their Unix-style EOLs.
318 304
319@findex find-file-text
320@findex find-file-binary
321 You can visit a file and specify whether to treat a file as text or
322binary using the commands @code{find-file-text} and
323@code{find-file-binary}. End-of-line conversion is part of the general
324coding system conversion mechanism, so another way to control whether to
325treat a file as text or binary is with the commands for specifying a
326coding system (@pxref{Specify Coding}). For example,
327@kbd{C-x @key{RET} c undecided-unix @key{RET} C-x C-f foobar.txt}
328visits the file @file{foobar.txt} without converting the EOLs.
329
330 The mode line indicates whether end-of-line translation was used for 305 The mode line indicates whether end-of-line translation was used for
331the current buffer. Normally a colon appears after the coding system 306the current buffer. If MS-DOS end-of-line translation is in use for the
332letter near the beginning of the mode line. If MS-DOS end-of-line 307buffer, a backslash @samp{\} is displayed after the coding system
333translation is in use for the buffer, this character changes to a 308mnemonic near the beginning of the mode line (@pxref{Mode Line}). If no
334backslash. 309EOL translation was performed, the string @samp{(Unix)} is displayed
310instead of the backslash, to alert you that the file's EOL format is not
311the usual carriage-return linefeed.
312
313@cindex DOS-to-Unix conversion of files
314@pindex dos2unix
315 End-of-line conversion is part of the general coding system conversion
316mechanism, so the way to control whether to treat a text file as
317DOS-style or Unix-style is with the commands for specifying a coding
318system (@pxref{Specify Coding}). For example, @kbd{C-x @key{RET} c unix
319@key{RET} C-x C-f foobar.txt} visits the file @file{foobar.txt} without
320converting the EOLs; if that file has carriage-return linefeed pairs at
321the end of its lines, Emacs will display @samp{^M} at the end of each
322line. Similarly, you can force Emacs to save a buffer with specific EOL
323format with the @kbd{C-x @key{RET} f} command. For example, to save a
324buffer with Unix EOL format, type @kbd{C-x @key{RET} f unix @key{RET}
325C-x C-s}. Thus, visiting a file with DOS EOL conversion, then saving it
326with Unix EOL format effectively converts the file to Unix text style,
327like the popular program @code{dos2unix} does.
335 328
336@cindex untranslated file system 329@cindex untranslated file system
337@findex add-untranslated-filesystem 330@findex add-untranslated-filesystem
@@ -369,6 +362,50 @@ the function @code{remove-untranslated-filesystem}. This function takes
369one argument, which should be a string just like the one that was used 362one argument, which should be a string just like the one that was used
370previously with @code{add-untranslated-filesystem}. 363previously with @code{add-untranslated-filesystem}.
371 364
365 Designating a file system as untranslated does @strong{not} disable
366code conversions as specified by the coding systems set up by your
367language environment, it only affects the EOL conversions, by forcing
368Emacs to create new files with Unix-style newline-only EOLs.
369
370@vindex file-name-buffer-file-type-alist
371@cindex binary files, on MS-DOS/MS-Windows
372 Some kinds of files should not be converted at all, because their
373contents are not really text. Therefore, Emacs on MS-DOS distinguishes
374certain files as @dfn{binary files}. (This distinction is not part of
375MS-DOS; it is made by Emacs only.) Binary files include executable
376programs, compressed archives, etc. Emacs uses the file name to decide
377whether to treat a file as binary: the variable
378@code{file-name-buffer-file-type-alist} defines the file-name patterns
379that indicate binary files. If a file name matches one of the patterns
380for binary files (those whose associations are of the type
381@code{(@var{pattern} . t)}, Emacs reads and writes that file using the
382@code{no-conversion} coding system (@pxref{Coding Systems}) which turns
383off @emph{all} coding-system conversions, not only the EOL conversion.
384@code{file-name-buffer-file-type-alist} also includes file-name patterns
385for files which are known to be DOS-style text files with
386carriage-return linefeed EOL format, such as @file{CONFIG.SYS}; Emacs
387always writes those files with DOS-style EOLs.
388
389 If a file which belongs to an untranslated file system matches one of
390the file-name patterns in @code{file-name-buffer-file-type-alist}, the
391EOL conversion is determined by @code{file-name-buffer-file-type-alist}.
392
393@findex find-file-text
394@findex find-file-binary
395 You can visit a file and specify whether to treat it as text or binary
396using the commands @code{find-file-text} and @code{find-file-binary}.
397@code{find-file-text} specifies DOS EOL conversions, but leaves the
398other coding conversions unspecified (Emacs determines the required
399conversions via the usual defaults and coding-detection mechanisms). On
400the other hand, @code{find-file-binary} turns off @emph{all}
401coding-system conversions.
402
403@findex find-file-literally@r{, and binary files}
404 The @code{find-file-text} and @code{find-file-binary} commands are
405only available when Emacs runs on MS-DOS or MS-Windows. The command
406@code{find-file-literally}, which is available on all platforms,
407produces the same effect as @code{find-file-binary}.
408
372@node MS-DOS Printing 409@node MS-DOS Printing
373@section Printing and MS-DOS 410@section Printing and MS-DOS
374 411