aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2004-07-02 23:43:50 +0000
committerRichard M. Stallman2004-07-02 23:43:50 +0000
commit83f411a2d2e259b3f3d26b3a627cf268b83b6946 (patch)
treec8f987bc6787a884276a115097de67e829636afe
parent8addb6ebbaecbad78010d66475d6ae5418cb0416 (diff)
downloademacs-83f411a2d2e259b3f3d26b3a627cf268b83b6946.tar.gz
emacs-83f411a2d2e259b3f3d26b3a627cf268b83b6946.zip
(Saving Buffers): Cleanup write-contents-function.
(Magic File Names): Cleanup file-remote-p.
-rw-r--r--lispref/files.texi47
1 files changed, 23 insertions, 24 deletions
diff --git a/lispref/files.texi b/lispref/files.texi
index 3fb9460da8a..4fe2d8567d3 100644
--- a/lispref/files.texi
+++ b/lispref/files.texi
@@ -415,17 +415,17 @@ Even though this is not a normal hook, you can use @code{add-hook} and
415 415
416@c Emacs 19 feature 416@c Emacs 19 feature
417@defvar write-contents-functions 417@defvar write-contents-functions
418This works just like @code{write-file-functions}, but it is intended for 418This works just like @code{write-file-functions}, but it is intended
419hooks that pertain to the contents of the file, as opposed to hooks that 419for hooks that pertain to the buffer's contents, not to the particular
420pertain to the file's name or location. Such hooks are usually set up by 420visited file or its location. Such hooks are usually set up by major
421major modes, as buffer-local bindings for this variable. If any of the 421modes, as buffer-local bindings for this variable. This variable
422functions in this hook returns non-@code{nil}, the file is considered 422automatically becomes buffer-local whenever it is set; switching to a
423already written and the rest are not called and neither are the functions 423new major mode always resets this variable, but calling
424in @code{write-file-functions}. 424@code{set-visited-file-name} does not.
425 425
426This variable automatically becomes buffer-local whenever it is set; 426If any of the functions in this hook returns non-@code{nil}, the file
427switching to a new major mode always resets this variable, but 427is considered already written and the rest are not called and neither
428calling @code{set-visited-file-name} does not. 428are the functions in @code{write-file-functions}.
429@end defvar 429@end defvar
430 430
431@defopt before-save-hook 431@defopt before-save-hook
@@ -2646,23 +2646,22 @@ of the local copy file.
2646@end defun 2646@end defun
2647 2647
2648@defun file-remote-p filename 2648@defun file-remote-p filename
2649This function tests whether @var{filename} is a remote file. The 2649This function tests whether @var{filename} is a remote file. If
2650return value is an identifier of the remote system, if @var{filename} 2650@var{filename} is local (not remote), the return value is @code{nil}.
2651is indeed remote. Besides the host name, the identifier may comprise 2651If @var{filename} is indeed remote, the return value is a string that
2652a user name and a method used to access that system. 2652identifies the remote system.
2653 2653
2654To illustrate, for the filename @code{/ssh:user@@host:/some/file}, the 2654This identifier string may include a host name, a user name, and
2655identifier is @code{/ssh:user@@host:}. 2655characters designating the method used to access the remote system.
2656 2656For example, the remote identifier string for the filename
2657If @var{filename} is local (not remote), then the return value is 2657@code{/ssh:user@@host:/some/file} is @code{/ssh:user@@host:}.
2658@code{nil}.
2659 2658
2660If @code{file-remote-p} returns the same identifier for two different 2659If @code{file-remote-p} returns the same identifier for two different
2661filenames, then the file handler is the same, and also the files can 2660filenames, that means they are stored on the same file system and can
2662be accessed locally with respect to each other. This means, for 2661be accessed locally with respect to each other. This means, for
2663example, that it is possible to start a (remote) process accessing 2662example, that it is possible to start a remote process accessing both
2664both files at the same time. Implementors of file handlers need to 2663files at the same time. Implementors of file handlers need to ensure
2665ensure this. 2664this principle is valid.
2666@end defun 2665@end defun
2667 2666
2668@defun unhandled-file-name-directory filename 2667@defun unhandled-file-name-directory filename