diff options
| author | Michael Albinus | 2016-12-09 10:03:05 +0100 |
|---|---|---|
| committer | Michael Albinus | 2016-12-09 10:03:05 +0100 |
| commit | 57a77f833e37abe2f7936585e9915b6947e3564a (patch) | |
| tree | 0dd014b26b8ca07167ace7cb051c37f07434ae44 /doc | |
| parent | 8f611e5e2309ae3f7f1753f0d2f7a60ca6fc2657 (diff) | |
| download | emacs-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.texi | 41 |
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, | ||
| 2406 | the file name can be quoted to suppress the expansion, and to handle | ||
| 2407 | the file name literally. Quoting happens by prefixing the file name | ||
| 2408 | with @samp{/:}. | ||
| 2409 | |||
| 2410 | @defmac file-name-quote name | ||
| 2411 | This macro adds the quotation prefix @samp{/:} to the file @var{name}. | ||
| 2412 | For a local file @var{name}, it prefixes @var{name} with @samp{/:}. | ||
| 2413 | If @var{name} is a remote file name, the local part of @var{name} is | ||
| 2414 | quoted. If @var{name} is already a quoted file name, @var{name} is | ||
| 2415 | returned 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 | |||
| 2429 | The macro cannot be used to suppress file name handlers from magic | ||
| 2430 | file names (@pxref{Magic File Names}). | ||
| 2431 | @end defmac | ||
| 2432 | |||
| 2433 | @defmac file-name-unquote name | ||
| 2434 | This macro removes the quotation prefix @samp{/:} from the file | ||
| 2435 | @var{name}, if any. If @var{name} is a remote file name, the local | ||
| 2436 | part of @var{name} is unquoted. | ||
| 2437 | @end defmac | ||
| 2438 | |||
| 2439 | @defmac file-name-quoted-p name | ||
| 2440 | This macro returns non-@code{nil}, when @var{name} is quoted with the | ||
| 2441 | prefix @samp{/:}. If @var{name} is a remote file name, the local part | ||
| 2442 | of @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 |