The find-file-noselect
function uses two important subroutines
which are sometimes useful in user Lisp code: create-file-buffer
and after-find-file
. This section explains how to use them.
Please note: create-file-buffer
does not
associate the new buffer with a file and does not select the buffer.
It also does not use the default major mode.
(create-file-buffer "foo") => #<buffer foo> (create-file-buffer "foo") => #<buffer foo<2>> (create-file-buffer "foo") => #<buffer foo<3>>
This function is used by find-file-noselect
.
It uses generate-new-buffer
(see section Creating Buffers).
find-file-noselect
and by the default revert function (see section Reverting).
If reading the file got an error because the file does not exist, but
its directory does exist, the caller should pass a non-nil
value
for error. In that case, after-find-file
issues a warning:
`(New File)'. For more serious errors, the caller should usually not
call after-find-file
.
If warn is non-nil
, then this function issues a warning
if an auto-save file exists and is more recent than the visited file.
The last thing after-find-file
does is call all the functions
in the list find-file-hooks
.
Go to the first, previous, next, last section, table of contents.