comparison lispref/files.texi @ 70624:97f1ae99fe30

(Visiting Functions, Reading from Files, Saving Buffers): Mention code and EOL conversions by file I/O primitives and subroutines.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 12 May 2006 17:56:20 +0000
parents 08c09d92fecc
children 9a270d0b2af7
comparison
equal deleted inserted replaced
70623:2ed5d4bbedbf 70624:97f1ae99fe30
134 cases, unless the optional argument @var{nowarn} is non-@code{nil}. For 134 cases, unless the optional argument @var{nowarn} is non-@code{nil}. For
135 example, if it needs to create a buffer, and there is no file named 135 example, if it needs to create a buffer, and there is no file named
136 @var{filename}, it displays the message @samp{(New file)} in the echo 136 @var{filename}, it displays the message @samp{(New file)} in the echo
137 area, and leaves the buffer empty. 137 area, and leaves the buffer empty.
138 138
139 Reading the file(s) into their respective buffers involves decoding
140 the files' contents (@pxref{Coding Systems}), including end-of-line
141 conversion.
142
139 The @code{find-file-noselect} function normally calls 143 The @code{find-file-noselect} function normally calls
140 @code{after-find-file} after reading the file (@pxref{Subroutines of 144 @code{after-find-file} after reading the file (@pxref{Subroutines of
141 Visiting}). That function sets the buffer major mode, parses local 145 Visiting}). That function sets the buffer major mode, parses local
142 variables, warns the user if there exists an auto-save file more recent 146 variables, warns the user if there exists an auto-save file more recent
143 than the file just visited, and finishes by running the functions in 147 than the file just visited, and finishes by running the functions in
393 You might wish to save the file modes value returned by 397 You might wish to save the file modes value returned by
394 @code{backup-buffer} and use that (if non-@code{nil}) to set the mode 398 @code{backup-buffer} and use that (if non-@code{nil}) to set the mode
395 bits of the file that you write. This is what @code{save-buffer} 399 bits of the file that you write. This is what @code{save-buffer}
396 normally does. @xref{Making Backups,, Making Backup Files}. 400 normally does. @xref{Making Backups,, Making Backup Files}.
397 401
398 The hook functions in @code{write-file-functions} are also responsible for 402 The hook functions in @code{write-file-functions} are also responsible
399 encoding the data (if desired): they must choose a suitable coding 403 for encoding the data (if desired): they must choose a suitable coding
400 system (@pxref{Lisp and Coding Systems}), perform the encoding 404 system and end-of-line conversion (@pxref{Lisp and Coding Systems}),
401 (@pxref{Explicit Encoding}), and set @code{last-coding-system-used} to 405 perform the encoding (@pxref{Explicit Encoding}), and set
402 the coding system that was used (@pxref{Encoding and I/O}). 406 @code{last-coding-system-used} to the coding system that was used
407 (@pxref{Encoding and I/O}).
403 408
404 If you set this hook locally in a buffer, it is assumed to be 409 If you set this hook locally in a buffer, it is assumed to be
405 associated with the file or the way the contents of the buffer were 410 associated with the file or the way the contents of the buffer were
406 obtained. Thus the variable is marked as a permanent local, so that 411 obtained. Thus the variable is marked as a permanent local, so that
407 changing the major mode does not alter a buffer-local value. On the 412 changing the major mode does not alter a buffer-local value. On the
494 against the defined file formats, and converts the file contents if 499 against the defined file formats, and converts the file contents if
495 appropriate. @xref{Format Conversion}. It also calls the functions in 500 appropriate. @xref{Format Conversion}. It also calls the functions in
496 the list @code{after-insert-file-functions}; see @ref{Saving 501 the list @code{after-insert-file-functions}; see @ref{Saving
497 Properties}. Normally, one of the functions in the 502 Properties}. Normally, one of the functions in the
498 @code{after-insert-file-functions} list determines the coding system 503 @code{after-insert-file-functions} list determines the coding system
499 (@pxref{Coding Systems}) used for decoding the file's contents. 504 (@pxref{Coding Systems}) used for decoding the file's contents,
505 including end-of-line conversion.
500 506
501 If @var{visit} is non-@code{nil}, this function additionally marks the 507 If @var{visit} is non-@code{nil}, this function additionally marks the
502 buffer as unmodified and sets up various fields in the buffer so that it 508 buffer as unmodified and sets up various fields in the buffer so that it
503 is visiting the file @var{filename}: these include the buffer's visited 509 is visiting the file @var{filename}: these include the buffer's visited
504 file name and its last save file modtime. This feature is used by 510 file name and its last save file modtime. This feature is used by