diff options
| author | Richard M. Stallman | 2006-05-14 22:50:09 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-05-14 22:50:09 +0000 |
| commit | f31263a46c452eacee8cc326d81112792bc0d6e4 (patch) | |
| tree | eccaa58ed4a20e0d991ef7d10dc8516d1df46ef8 | |
| parent | 85cc6738ed6d07b13ad749de80e47170a1df0d7a (diff) | |
| download | emacs-f31263a46c452eacee8cc326d81112792bc0d6e4.tar.gz emacs-f31263a46c452eacee8cc326d81112792bc0d6e4.zip | |
(Visiting Functions): Rewrite in find-file-noselect.
| -rw-r--r-- | lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | lispref/files.texi | 44 |
2 files changed, 25 insertions, 23 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index da050cc4004..52cfa33acfe 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2006-05-14 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * files.texi (Visiting Functions): Rewrite in find-file-noselect. | ||
| 4 | |||
| 1 | 2006-05-13 Eli Zaretskii <eliz@gnu.org> | 5 | 2006-05-13 Eli Zaretskii <eliz@gnu.org> |
| 2 | 6 | ||
| 3 | * buffers.texi (Current Buffer): Document that with-temp-buffer | 7 | * buffers.texi (Current Buffer): Document that with-temp-buffer |
diff --git a/lispref/files.texi b/lispref/files.texi index d23b5efdd67..0d944771a2e 100644 --- a/lispref/files.texi +++ b/lispref/files.texi | |||
| @@ -114,21 +114,24 @@ When @code{find-file} is called interactively, it prompts for | |||
| 114 | @end deffn | 114 | @end deffn |
| 115 | 115 | ||
| 116 | @defun find-file-noselect filename &optional nowarn rawfile wildcards | 116 | @defun find-file-noselect filename &optional nowarn rawfile wildcards |
| 117 | This function is the guts of all the file-visiting functions. It finds | 117 | This function is the guts of all the file-visiting functions. It |
| 118 | or creates a buffer visiting the file @var{filename}, and returns it. | 118 | returns a buffer visiting the file @var{filename}. You may make the |
| 119 | It uses an existing buffer if there is one, and otherwise creates a new | 119 | buffer current or display it in a window if you wish, but this |
| 120 | buffer and reads the file into it. You may make the buffer current or | 120 | function does not do so. |
| 121 | display it in a window if you wish, but this function does not do so. | 121 | |
| 122 | 122 | The function returns an existing buffer if there is one; otherwise it | |
| 123 | If @var{wildcards} is non-@code{nil}, | 123 | creates a new buffer and reads the file into it. When |
| 124 | then @code{find-file-noselect} expands wildcard | 124 | @code{find-file-noselect} uses an existing buffer, it first verifies |
| 125 | characters in @var{filename} and visits all the matching files. | 125 | that the file has not changed since it was last visited or saved in |
| 126 | 126 | that buffer. If the file has changed, this function asks the user | |
| 127 | When @code{find-file-noselect} uses an existing buffer, it first | 127 | whether to reread the changed file. If the user says @samp{yes}, any |
| 128 | verifies that the file has not changed since it was last visited or | 128 | edits previously made in the buffer are lost. |
| 129 | saved in that buffer. If the file has changed, then this function asks | 129 | |
| 130 | the user whether to reread the changed file. If the user says | 130 | Reading the file involves decoding the file's contents (@pxref{Coding |
| 131 | @samp{yes}, any changes previously made in the buffer are lost. | 131 | Systems}), including end-of-line conversion, and format conversion |
| 132 | (@pxref{Format Conversion}). If @var{wildcards} is non-@code{nil}, | ||
| 133 | then @code{find-file-noselect} expands wildcard characters in | ||
| 134 | @var{filename} and visits all the matching files. | ||
| 132 | 135 | ||
| 133 | This function displays warning or advisory messages in various peculiar | 136 | This function displays warning or advisory messages in various peculiar |
| 134 | cases, unless the optional argument @var{nowarn} is non-@code{nil}. For | 137 | cases, unless the optional argument @var{nowarn} is non-@code{nil}. For |
| @@ -136,10 +139,6 @@ 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 | 139 | @var{filename}, it displays the message @samp{(New file)} in the echo |
| 137 | area, and leaves the buffer empty. | 140 | area, and leaves the buffer empty. |
| 138 | 141 | ||
| 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 | |||
| 143 | The @code{find-file-noselect} function normally calls | 142 | The @code{find-file-noselect} function normally calls |
| 144 | @code{after-find-file} after reading the file (@pxref{Subroutines of | 143 | @code{after-find-file} after reading the file (@pxref{Subroutines of |
| 145 | Visiting}). That function sets the buffer major mode, parses local | 144 | Visiting}). That function sets the buffer major mode, parses local |
| @@ -149,10 +148,9 @@ than the file just visited, and finishes by running the functions in | |||
| 149 | 148 | ||
| 150 | If the optional argument @var{rawfile} is non-@code{nil}, then | 149 | If the optional argument @var{rawfile} is non-@code{nil}, then |
| 151 | @code{after-find-file} is not called, and the | 150 | @code{after-find-file} is not called, and the |
| 152 | @code{find-file-not-found-functions} are not run in case of failure. What's | 151 | @code{find-file-not-found-functions} are not run in case of failure. |
| 153 | more, a non-@code{nil} @var{rawfile} value suppresses coding system | 152 | What's more, a non-@code{nil} @var{rawfile} value suppresses coding |
| 154 | conversion (@pxref{Coding Systems}) and format conversion (@pxref{Format | 153 | system conversion and format conversion. |
| 155 | Conversion}). | ||
| 156 | 154 | ||
| 157 | The @code{find-file-noselect} function usually returns the buffer that | 155 | The @code{find-file-noselect} function usually returns the buffer that |
| 158 | is visiting the file @var{filename}. But, if wildcards are actually | 156 | is visiting the file @var{filename}. But, if wildcards are actually |