diff options
| author | Eli Zaretskii | 2000-06-22 14:51:22 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2000-06-22 14:51:22 +0000 |
| commit | 1ca54e6826f79e943dc8f737fbd2f31af287696c (patch) | |
| tree | 88156033aea5de4a9d95ddcc9fe908cb8307ffd3 | |
| parent | bb746ea696eceb06c11b4ceac1b9859e490c53b3 (diff) | |
| download | emacs-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.texi | 103 |
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 | |||
| 146 | default. This default shape can be changed to a bar by specifying the | 146 | default. 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 |
| 149 | vertical-bar cursor, so the bar cursor is horizontal, and the its | 149 | vertical-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, |
| 151 | actually determines its height. As an extension, the bar cursor | 151 | actually determines its height. As an extension, the bar cursor |
| 152 | specification can include the starting scan line of the cursor as well | 152 | specification 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 | |||
| 290 | handles conversion of international character codes does this conversion | 290 | handles conversion of international character codes does this conversion |
| 291 | also (@pxref{Coding Systems}). | 291 | also (@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 |
| 296 | that character positions as reported by Emacs (@pxref{Position Info}) do | 296 | that character positions as reported by Emacs (@pxref{Position Info}) do |
| 297 | not agree with the file size information known to the operating system. | 297 | not 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 | ||
| 301 | are not really text. Therefore, Emacs on MS-DOS distinguishes certain | ||
| 302 | files as @dfn{binary files}, and reads and writes them verbatim. (This | ||
| 303 | distinction is not part of MS-DOS; it is made by Emacs only.) These | ||
| 304 | include executable programs, compressed archives, etc. Emacs uses the | ||
| 305 | file 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 | ||
| 307 | that indicate binary files. Note that if a file name matches one of the | ||
| 308 | patterns for binary files in @code{file-name-buffer-file-type-alist}, | ||
| 309 | Emacs uses the @code{no-conversion} coding system (@pxref{Coding | ||
| 310 | Systems}) which turns off @emph{all} coding-system conversions, not only | ||
| 311 | the 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 |
| 314 | newline rather than carriage-return linefeed as its line separator, it | 300 | newline rather than carriage-return linefeed as its line separator, it |
| 315 | does not perform conversion when reading or writing that file. Thus, | 301 | does not perform EOL conversion when reading or writing that file. Thus, |
| 316 | you can read and edit files from Unix or GNU systems on MS-DOS with no | 302 | you can read and edit files from Unix or GNU systems on MS-DOS with no |
| 317 | special effort, and they will be left with their Unix-style EOLs. | 303 | special 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 | ||
| 322 | binary using the commands @code{find-file-text} and | ||
| 323 | @code{find-file-binary}. End-of-line conversion is part of the general | ||
| 324 | coding system conversion mechanism, so another way to control whether to | ||
| 325 | treat a file as text or binary is with the commands for specifying a | ||
| 326 | coding system (@pxref{Specify Coding}). For example, | ||
| 327 | @kbd{C-x @key{RET} c undecided-unix @key{RET} C-x C-f foobar.txt} | ||
| 328 | visits 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 |
| 331 | the current buffer. Normally a colon appears after the coding system | 306 | the current buffer. If MS-DOS end-of-line translation is in use for the |
| 332 | letter near the beginning of the mode line. If MS-DOS end-of-line | 307 | buffer, a backslash @samp{\} is displayed after the coding system |
| 333 | translation is in use for the buffer, this character changes to a | 308 | mnemonic near the beginning of the mode line (@pxref{Mode Line}). If no |
| 334 | backslash. | 309 | EOL translation was performed, the string @samp{(Unix)} is displayed |
| 310 | instead of the backslash, to alert you that the file's EOL format is not | ||
| 311 | the 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 | ||
| 316 | mechanism, so the way to control whether to treat a text file as | ||
| 317 | DOS-style or Unix-style is with the commands for specifying a coding | ||
| 318 | system (@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 | ||
| 320 | converting the EOLs; if that file has carriage-return linefeed pairs at | ||
| 321 | the end of its lines, Emacs will display @samp{^M} at the end of each | ||
| 322 | line. Similarly, you can force Emacs to save a buffer with specific EOL | ||
| 323 | format with the @kbd{C-x @key{RET} f} command. For example, to save a | ||
| 324 | buffer with Unix EOL format, type @kbd{C-x @key{RET} f unix @key{RET} | ||
| 325 | C-x C-s}. Thus, visiting a file with DOS EOL conversion, then saving it | ||
| 326 | with Unix EOL format effectively converts the file to Unix text style, | ||
| 327 | like 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 | |||
| 369 | one argument, which should be a string just like the one that was used | 362 | one argument, which should be a string just like the one that was used |
| 370 | previously with @code{add-untranslated-filesystem}. | 363 | previously with @code{add-untranslated-filesystem}. |
| 371 | 364 | ||
| 365 | Designating a file system as untranslated does @strong{not} disable | ||
| 366 | code conversions as specified by the coding systems set up by your | ||
| 367 | language environment, it only affects the EOL conversions, by forcing | ||
| 368 | Emacs 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 | ||
| 373 | contents are not really text. Therefore, Emacs on MS-DOS distinguishes | ||
| 374 | certain files as @dfn{binary files}. (This distinction is not part of | ||
| 375 | MS-DOS; it is made by Emacs only.) Binary files include executable | ||
| 376 | programs, compressed archives, etc. Emacs uses the file name to decide | ||
| 377 | whether to treat a file as binary: the variable | ||
| 378 | @code{file-name-buffer-file-type-alist} defines the file-name patterns | ||
| 379 | that indicate binary files. If a file name matches one of the patterns | ||
| 380 | for 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 | ||
| 383 | off @emph{all} coding-system conversions, not only the EOL conversion. | ||
| 384 | @code{file-name-buffer-file-type-alist} also includes file-name patterns | ||
| 385 | for files which are known to be DOS-style text files with | ||
| 386 | carriage-return linefeed EOL format, such as @file{CONFIG.SYS}; Emacs | ||
| 387 | always writes those files with DOS-style EOLs. | ||
| 388 | |||
| 389 | If a file which belongs to an untranslated file system matches one of | ||
| 390 | the file-name patterns in @code{file-name-buffer-file-type-alist}, the | ||
| 391 | EOL 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 | ||
| 396 | using the commands @code{find-file-text} and @code{find-file-binary}. | ||
| 397 | @code{find-file-text} specifies DOS EOL conversions, but leaves the | ||
| 398 | other coding conversions unspecified (Emacs determines the required | ||
| 399 | conversions via the usual defaults and coding-detection mechanisms). On | ||
| 400 | the other hand, @code{find-file-binary} turns off @emph{all} | ||
| 401 | coding-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 | ||
| 405 | only available when Emacs runs on MS-DOS or MS-Windows. The command | ||
| 406 | @code{find-file-literally}, which is available on all platforms, | ||
| 407 | produces 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 | ||