diff options
| author | Michael Albinus | 2017-09-05 15:32:03 +0200 |
|---|---|---|
| committer | Michael Albinus | 2017-09-05 15:32:03 +0200 |
| commit | 8d251607e08e1ea4df201928b5bee21782a6526e (patch) | |
| tree | 28cc94f73465a75e1f2ba1ef82cef3807d84ce54 | |
| parent | c09116e64012534ee244c22f1ba4f2e106f6ed91 (diff) | |
| download | emacs-8d251607e08e1ea4df201928b5bee21782a6526e.tar.gz emacs-8d251607e08e1ea4df201928b5bee21782a6526e.zip | |
Doc precisment about remote link targets
* doc/lispref/files.texi (Truenames): Explain handling of
targets of `file-truename' and `make-symbolic-link', which
look like a remote file name.
* etc/NEWS: Precise examples for symlinks which look like
remote file names. MUSTBENEW of `write-region' is not
propagated to file name handlers.
| -rw-r--r-- | doc/lispref/files.texi | 12 | ||||
| -rw-r--r-- | etc/NEWS | 38 |
2 files changed, 35 insertions, 15 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 06466c9bba8..d04be63d7ec 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -1116,8 +1116,11 @@ file name component immediately preceding @samp{..} will be | |||
| 1116 | simplified away before @code{file-truename} is called. To | 1116 | simplified away before @code{file-truename} is called. To |
| 1117 | eliminate the need for a call to @code{expand-file-name}, | 1117 | eliminate the need for a call to @code{expand-file-name}, |
| 1118 | @code{file-truename} handles @samp{~} in the same way that | 1118 | @code{file-truename} handles @samp{~} in the same way that |
| 1119 | @code{expand-file-name} does. @xref{File Name Expansion,, Functions | 1119 | @code{expand-file-name} does. |
| 1120 | that Expand Filenames}. | 1120 | |
| 1121 | If the target of a symbolic links has remote file name syntax, | ||
| 1122 | @code{file-truename} returns it quoted. @xref{File Name Expansion,, | ||
| 1123 | Functions that Expand Filenames}. | ||
| 1121 | @end defun | 1124 | @end defun |
| 1122 | 1125 | ||
| 1123 | @defun file-chase-links filename &optional limit | 1126 | @defun file-chase-links filename &optional limit |
| @@ -1736,10 +1739,15 @@ is treated only as a string; it need not name an existing file. | |||
| 1736 | If @var{ok-if-already-exists} is an integer, indicating interactive | 1739 | If @var{ok-if-already-exists} is an integer, indicating interactive |
| 1737 | use, then leading @samp{~} is expanded and leading @samp{/:} is | 1740 | use, then leading @samp{~} is expanded and leading @samp{/:} is |
| 1738 | stripped in the @var{target} string. | 1741 | stripped in the @var{target} string. |
| 1742 | |||
| 1739 | If @var{target} is a relative file name, the resulting symbolic link | 1743 | If @var{target} is a relative file name, the resulting symbolic link |
| 1740 | is interpreted relative to the directory containing the symbolic link. | 1744 | is interpreted relative to the directory containing the symbolic link. |
| 1741 | @xref{Relative File Names}. | 1745 | @xref{Relative File Names}. |
| 1742 | 1746 | ||
| 1747 | If both @var{target} and @var{newname} have remote file name syntax, | ||
| 1748 | and if both remote identifications are equal, the symbolic link points | ||
| 1749 | to the local file name part of @var{target}. | ||
| 1750 | |||
| 1743 | This function is not available on systems that don't support symbolic | 1751 | This function is not available on systems that don't support symbolic |
| 1744 | links. | 1752 | links. |
| 1745 | @end deffn | 1753 | @end deffn |
| @@ -1210,23 +1210,35 @@ The following changes are involved. | |||
| 1210 | --- | 1210 | --- |
| 1211 | *** 'file-attributes' and 'file-symlink-p' no longer prepend "/:" to | 1211 | *** 'file-attributes' and 'file-symlink-p' no longer prepend "/:" to |
| 1212 | symbolic links whose targets begin with "/" and contain ":". For | 1212 | symbolic links whose targets begin with "/" and contain ":". For |
| 1213 | example, if a symbolic link "x" has a target "/y:z", (file-symlink-p | 1213 | example, if a symbolic link "x" has a target "/y:z:", '(file-symlink-p |
| 1214 | "x") now returns "/y:z" rather than "/:/y:z". | 1214 | "x")' now returns "/y:z:" rather than "/:/y:z:". |
| 1215 | 1215 | ||
| 1216 | --- | 1216 | --- |
| 1217 | *** 'make-symbolic-link' no longer looks for file name handlers when | 1217 | *** 'make-symbolic-link' no longer looks for file name handlers of |
| 1218 | creating a local symbolic link. For example, (make-symbolic-link | 1218 | target when creating a symbolic link. For example, |
| 1219 | "/y:z" "x") now creates a symlink to "/y:z" instead of failing. | 1219 | '(make-symbolic-link "/y:z:" "x")' now creates a symbolic link to |
| 1220 | "/y:z:" instead of failing. | ||
| 1221 | |||
| 1222 | +++ | ||
| 1223 | *** 'make-symbolic-link' removes the remote part of a link target if | ||
| 1224 | target and newname have the same remote part. For example, | ||
| 1225 | '(make-symbolic-link "/x:y:a" "/x:y:b")' creates a link with the | ||
| 1226 | literal string "a"; and '(make-symbolic-link "/x:y:a" "/x:z:b")' | ||
| 1227 | creates a link with the literal string "/x:y:a" instead of failing. | ||
| 1220 | 1228 | ||
| 1221 | +++ | 1229 | +++ |
| 1222 | *** 'make-symbolic-link' now expands a link target with leading "~" | 1230 | *** 'make-symbolic-link' now expands a link target with leading "~" |
| 1223 | only when the optional third arg is an integer, as when invoked | 1231 | only when the optional third arg is an integer, as when invoked |
| 1224 | interactively. For example, (make-symbolic-link "~y" "x") now creates | 1232 | interactively. For example, '(make-symbolic-link "~y" "x")' now |
| 1225 | a link with target the literal string "~y"; to get the old behavior, | 1233 | creates a link with target the literal string "~y"; to get the old |
| 1226 | use (make-symbolic-link (expand-file-name "~y") "x"). To avoid this | 1234 | behavior, use '(make-symbolic-link (expand-file-name "~y") "x")'. To |
| 1227 | expansion in interactive use, you can now prefix the link target with | 1235 | avoid this expansion in interactive use, you can now prefix the link |
| 1228 | "/:". For example, (make-symbolic-link "/:~y" "x" 1) now creates a | 1236 | target with "/:". For example, '(make-symbolic-link "/:~y" "x" 1)' |
| 1229 | link to literal "~y". | 1237 | now creates a link to literal "~y". |
| 1238 | |||
| 1239 | +++ | ||
| 1240 | ** 'file-truename' returns a quoted file name if the target of a | ||
| 1241 | symbolic link has remote file name syntax. | ||
| 1230 | 1242 | ||
| 1231 | +++ | 1243 | +++ |
| 1232 | ** Module functions are now implemented slightly differently; in | 1244 | ** Module functions are now implemented slightly differently; in |
| @@ -1235,8 +1247,8 @@ Code that depends on undocumented internals of the module system might | |||
| 1235 | break. | 1247 | break. |
| 1236 | 1248 | ||
| 1237 | --- | 1249 | --- |
| 1238 | ** The arguments LOCKNAME and MUSTBENEW of 'write-region' are | 1250 | ** The argument LOCKNAME of 'write-region' is propagated to file name |
| 1239 | propagated to file name handlers now. | 1251 | handlers now. |
| 1240 | 1252 | ||
| 1241 | --- | 1253 | --- |
| 1242 | ** When built against recent versions of GTK+, Emacs always uses | 1254 | ** When built against recent versions of GTK+, Emacs always uses |