aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMichael Albinus2016-12-09 10:03:05 +0100
committerMichael Albinus2016-12-09 10:03:05 +0100
commit57a77f833e37abe2f7936585e9915b6947e3564a (patch)
tree0dd014b26b8ca07167ace7cb051c37f07434ae44 /doc
parent8f611e5e2309ae3f7f1753f0d2f7a60ca6fc2657 (diff)
downloademacs-57a77f833e37abe2f7936585e9915b6947e3564a.tar.gz
emacs-57a77f833e37abe2f7936585e9915b6947e3564a.zip
Document file-name-quote, file-name-unquote and file-name-quoted-p
* doc/lispref/files.texi (File Name Expansion): * etc/NEWS: Mention file-name-quote, file-name-unquote and file-name-quoted-p. * lisp/files.el (file-name-non-special): Revert using file-name-quote, file-name-unquote and file-name-quoted-p.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/files.texi41
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 26db93cd8fd..906cd562612 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -2402,6 +2402,47 @@ through the immediately preceding @samp{/}).
2402 2402
2403@end defun 2403@end defun
2404 2404
2405 Sometimes, it is not desired to expand file names. In such cases,
2406the file name can be quoted to suppress the expansion, and to handle
2407the file name literally. Quoting happens by prefixing the file name
2408with @samp{/:}.
2409
2410@defmac file-name-quote name
2411This macro adds the quotation prefix @samp{/:} to the file @var{name}.
2412For a local file @var{name}, it prefixes @var{name} with @samp{/:}.
2413If @var{name} is a remote file name, the local part of @var{name} is
2414quoted. If @var{name} is already a quoted file name, @var{name} is
2415returned unchanged.
2416
2417@example
2418@group
2419(substitute-in-file-name (file-name-quote "bar/~/foo"))
2420 @result{} "/:bar/~/foo"
2421@end group
2422
2423@group
2424(substitute-in-file-name (file-name-quote "/ssh:host:bar/~/foo"))
2425 @result{} "/ssh:host:/:bar/~/foo"
2426@end group
2427@end example
2428
2429The macro cannot be used to suppress file name handlers from magic
2430file names (@pxref{Magic File Names}).
2431@end defmac
2432
2433@defmac file-name-unquote name
2434This macro removes the quotation prefix @samp{/:} from the file
2435@var{name}, if any. If @var{name} is a remote file name, the local
2436part of @var{name} is unquoted.
2437@end defmac
2438
2439@defmac file-name-quoted-p name
2440This macro returns non-@code{nil}, when @var{name} is quoted with the
2441prefix @samp{/:}. If @var{name} is a remote file name, the local part
2442of @var{name} is checked.
2443@end defmac
2444
2445
2405@node Unique File Names 2446@node Unique File Names
2406@subsection Generating Unique File Names 2447@subsection Generating Unique File Names
2407@cindex unique file names 2448@cindex unique file names