diff options
| author | Juanma Barranquero | 2014-03-26 16:57:13 +0100 |
|---|---|---|
| committer | Juanma Barranquero | 2014-03-26 16:57:13 +0100 |
| commit | 16adf2e6eb1ddf0b32ebea2d5ce8fa1e4c226614 (patch) | |
| tree | 29b782fd6e7c44a834dd09442a551520e30bcbd6 /doc/lispref | |
| parent | 5af73b0fe8975eeb47fb270819b4143c18d71caa (diff) | |
| parent | 196716cf35f81bea108c3b75362e92c86ed1c016 (diff) | |
| download | emacs-16adf2e6eb1ddf0b32ebea2d5ce8fa1e4c226614.tar.gz emacs-16adf2e6eb1ddf0b32ebea2d5ce8fa1e4c226614.zip | |
Merge from emacs-24; up to 2014-03-23T23:14:52Z!yamaoka@jpl.org
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/ChangeLog | 13 | ||||
| -rw-r--r-- | doc/lispref/files.texi | 54 | ||||
| -rw-r--r-- | doc/lispref/markers.texi | 10 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 9 |
4 files changed, 69 insertions, 17 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 71af1bc66a0..fdc266472e0 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2014-03-26 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * files.texi (Kinds of Files): Improve documentation of | ||
| 4 | file-symlink-p. (Bug#17073) Add cross-references. | ||
| 5 | |||
| 6 | 2014-03-26 Barry O'Reilly <gundaetiapo@gmail.com> | ||
| 7 | |||
| 8 | * markers.texi (Moving Marker Positions): The 2014-03-02 doc | ||
| 9 | change mentioning undo's inability to handle relocated markers no | ||
| 10 | longer applies. See bug#16818. | ||
| 11 | * text.texi (Undo): Expand documentation of (TEXT . POS) and | ||
| 12 | (MARKER . ADJUSTMENT) undo elements. | ||
| 13 | |||
| 1 | 2014-03-26 Glenn Morris <rgm@gnu.org> | 14 | 2014-03-26 Glenn Morris <rgm@gnu.org> |
| 2 | 15 | ||
| 3 | * files.texi (File Locks): All systems support locking. | 16 | * files.texi (File Locks): All systems support locking. |
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index a00fa5b4795..64ed3a05ee6 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -950,22 +950,26 @@ as directories, symbolic links, and ordinary files. | |||
| 950 | @defun file-symlink-p filename | 950 | @defun file-symlink-p filename |
| 951 | @cindex file symbolic links | 951 | @cindex file symbolic links |
| 952 | If the file @var{filename} is a symbolic link, the | 952 | If the file @var{filename} is a symbolic link, the |
| 953 | @code{file-symlink-p} function returns the (non-recursive) link target | 953 | @code{file-symlink-p} function returns its (non-recursive) link target |
| 954 | as a string. (Determining the file name that the link points to from | 954 | as a string. (The link target string is not necessarily the full |
| 955 | the target is nontrivial.) First, this function recursively follows | 955 | absolute file name of the target; determining the full file name that |
| 956 | symbolic links at all levels of parent directories. | 956 | the link points to is nontrivial, see below.) If the leading |
| 957 | 957 | directories of @var{filename} include symbolic links, this function | |
| 958 | If the file @var{filename} is not a symbolic link (or there is no such file), | 958 | recursively follows them. |
| 959 | |||
| 960 | If the file @var{filename} is not a symbolic link, or does not exist, | ||
| 959 | @code{file-symlink-p} returns @code{nil}. | 961 | @code{file-symlink-p} returns @code{nil}. |
| 960 | 962 | ||
| 963 | Here are a few examples of using this function: | ||
| 964 | |||
| 961 | @example | 965 | @example |
| 962 | @group | 966 | @group |
| 963 | (file-symlink-p "foo") | 967 | (file-symlink-p "not-a-symlink") |
| 964 | @result{} nil | 968 | @result{} nil |
| 965 | @end group | 969 | @end group |
| 966 | @group | 970 | @group |
| 967 | (file-symlink-p "sym-link") | 971 | (file-symlink-p "sym-link") |
| 968 | @result{} "foo" | 972 | @result{} "not-a-symlink" |
| 969 | @end group | 973 | @end group |
| 970 | @group | 974 | @group |
| 971 | (file-symlink-p "sym-link2") | 975 | (file-symlink-p "sym-link2") |
| @@ -976,6 +980,40 @@ If the file @var{filename} is not a symbolic link (or there is no such file), | |||
| 976 | @result{} "/pub/bin" | 980 | @result{} "/pub/bin" |
| 977 | @end group | 981 | @end group |
| 978 | @end example | 982 | @end example |
| 983 | |||
| 984 | Note that in the third example, the function returned @file{sym-link}, | ||
| 985 | but did not proceed to resolve it, although that file is itself a | ||
| 986 | symbolic link. This is what we meant by ``non-recursive'' above---the | ||
| 987 | process of following the symbolic links does not recurse if the link | ||
| 988 | target is itself a link. | ||
| 989 | |||
| 990 | The string that this function returns is what is recorded in the | ||
| 991 | symbolic link; it may or may not include any leading directories. | ||
| 992 | This function does @emph{not} expand the link target to produce a | ||
| 993 | fully-qualified file name, and in particular does not use the leading | ||
| 994 | directories, if any, of the @var{filename} argument if the link target | ||
| 995 | is not an absolute file name. Here's an example: | ||
| 996 | |||
| 997 | @example | ||
| 998 | @group | ||
| 999 | (file-symlink-p "/foo/bar/baz") | ||
| 1000 | @result{} "some-file" | ||
| 1001 | @end group | ||
| 1002 | @end example | ||
| 1003 | |||
| 1004 | @noindent | ||
| 1005 | Here, although @file{/foo/bar/baz} was given as a fully-qualified file | ||
| 1006 | name, the result is not, and in fact does not have any leading | ||
| 1007 | directories at all. And since @file{some-file} might itself be a | ||
| 1008 | symbolic link, you cannot simply prepend leading directories to it, | ||
| 1009 | nor even naively use @code{expand-file-name} (@pxref{File Name | ||
| 1010 | Expansion}) to produce its absolute file name. | ||
| 1011 | |||
| 1012 | For this reason, this function is seldom useful if you need to | ||
| 1013 | determine more than just the fact that a file is or isn't a symbolic | ||
| 1014 | link. If you actually need the file name of the link target, use | ||
| 1015 | @code{file-chase-links} or @code{file-truename}, described in | ||
| 1016 | @ref{Truenames}. | ||
| 979 | @end defun | 1017 | @end defun |
| 980 | 1018 | ||
| 981 | The next two functions recursively follow symbolic links at | 1019 | The next two functions recursively follow symbolic links at |
diff --git a/doc/lispref/markers.texi b/doc/lispref/markers.texi index 19386d638fe..51b87ab1e5b 100644 --- a/doc/lispref/markers.texi +++ b/doc/lispref/markers.texi | |||
| @@ -344,12 +344,10 @@ specify the insertion type, create them with insertion type | |||
| 344 | @section Moving Marker Positions | 344 | @section Moving Marker Positions |
| 345 | 345 | ||
| 346 | This section describes how to change the position of an existing | 346 | This section describes how to change the position of an existing |
| 347 | marker. When you do this, be sure you know how the marker is used | 347 | marker. When you do this, be sure you know whether the marker is used |
| 348 | outside of your program. For example, moving a marker to an unrelated | 348 | outside of your program, and, if so, what effects will result from |
| 349 | new position can cause undo to later adjust the marker incorrectly. | 349 | moving it---otherwise, confusing things may happen in other parts of |
| 350 | Often when you wish to relocate a marker to an unrelated position, it | 350 | Emacs. |
| 351 | is preferable to make a new marker and set the prior one to point | ||
| 352 | nowhere. | ||
| 353 | 351 | ||
| 354 | @defun set-marker marker position &optional buffer | 352 | @defun set-marker marker position &optional buffer |
| 355 | This function moves @var{marker} to @var{position} | 353 | This function moves @var{marker} to @var{position} |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index f8a3e873449..7c5603fd645 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -1270,7 +1270,8 @@ This kind of element indicates how to reinsert text that was deleted. | |||
| 1270 | The deleted text itself is the string @var{text}. The place to | 1270 | The deleted text itself is the string @var{text}. The place to |
| 1271 | reinsert it is @code{(abs @var{position})}. If @var{position} is | 1271 | reinsert it is @code{(abs @var{position})}. If @var{position} is |
| 1272 | positive, point was at the beginning of the deleted text, otherwise it | 1272 | positive, point was at the beginning of the deleted text, otherwise it |
| 1273 | was at the end. | 1273 | was at the end. Zero or more (@var{marker} . @var{adjustment}) |
| 1274 | elements follow immediately after this element. | ||
| 1274 | 1275 | ||
| 1275 | @item (t . @var{time-flag}) | 1276 | @item (t . @var{time-flag}) |
| 1276 | This kind of element indicates that an unmodified buffer became | 1277 | This kind of element indicates that an unmodified buffer became |
| @@ -1296,8 +1297,10 @@ Here's how you might undo the change: | |||
| 1296 | @item (@var{marker} . @var{adjustment}) | 1297 | @item (@var{marker} . @var{adjustment}) |
| 1297 | This kind of element records the fact that the marker @var{marker} was | 1298 | This kind of element records the fact that the marker @var{marker} was |
| 1298 | relocated due to deletion of surrounding text, and that it moved | 1299 | relocated due to deletion of surrounding text, and that it moved |
| 1299 | @var{adjustment} character positions. Undoing this element moves | 1300 | @var{adjustment} character positions. If the marker's location is |
| 1300 | @var{marker} @minus{} @var{adjustment} characters. | 1301 | consistent with the (@var{text} . @var{position}) element preceding it |
| 1302 | in the undo list, then undoing this element moves @var{marker} | ||
| 1303 | @minus{} @var{adjustment} characters. | ||
| 1301 | 1304 | ||
| 1302 | @item (apply @var{funname} . @var{args}) | 1305 | @item (apply @var{funname} . @var{args}) |
| 1303 | This is an extensible undo item, which is undone by calling | 1306 | This is an extensible undo item, which is undone by calling |