diff options
author | Glenn Morris <rgm@gnu.org> | 2011-02-19 11:40:59 -0800 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2011-02-19 11:40:59 -0800 |
commit | 26436329ea89c6f66508da4627d48b2084670e91 (patch) | |
tree | 103a3f037559d2771c985f3fe90741009c72d288 /doc/lispref/files.texi | |
parent | cb7baa852403f61ca63e9620041b6a9ace80f50e (diff) | |
parent | 572a4cc332f6e85ca4cd9ee8723f66c8e2c84e38 (diff) | |
download | emacs-26436329ea89c6f66508da4627d48b2084670e91.tar.gz |
Merge from emacs-23; up to r100491
Diffstat (limited to 'doc/lispref/files.texi')
-rw-r--r-- | doc/lispref/files.texi | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 46ebced7a32..3697f18badd 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -113,6 +113,26 @@ When @code{find-file} is called interactively, it prompts for @var{filename} in the minibuffer. @end deffn +@deffn Command find-file-literally filename +This command visits @var{filename}, like @code{find-file} does, but it +does not perform any format conversions (@pxref{Format Conversion}), +character code conversions (@pxref{Coding Systems}), or end-of-line +conversions (@pxref{Coding System Basics, End of line conversion}). +The buffer visiting the file is made unibyte, and its major mode is +Fundamental mode, regardless of the file name. File local variable +specifications in the file (@pxref{File Local Variables}) are +ignored, and automatic decompression and adding a newline at the end +of the file due to @code{require-final-newline} (@pxref{Saving +Buffers, require-final-newline}) are also disabled. + +Note that if Emacs already has a buffer visiting the same file +non-literally, it will not visit the same file literally, but instead +just switch to the existing buffer. If you want to be sure of +accessing a file's contents literally, you should create a temporary +buffer and then read the file contents into it using +@code{insert-file-contents-literally} (@pxref{Reading from Files}). +@end deffn + @defun find-file-noselect filename &optional nowarn rawfile wildcards This function is the guts of all the file-visiting functions. It returns a buffer visiting the file @var{filename}. You may make the @@ -224,6 +244,16 @@ This is not a normal hook because the values of the functions are used, and in many cases only some of the functions are called. @end defvar +@defvar find-file-literally +This buffer-local variable, if set to a non-@code{nil} value, makes +@code{save-buffer} behave as if the buffer were visiting its file +literally, i.e. without conversions of any kind. The command +@code{find-file-literally} sets this variable's local value, but other +equivalent functions and commands can do that as well, e.g.@: to avoid +automatic addition of a newline at the end of the file. This variable +us permanent local, so it is unaffected by changes of major modes. +@end defvar + @node Subroutines of Visiting @comment node-name, next, previous, up @subsection Subroutines of Visiting |