aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref
diff options
context:
space:
mode:
authorJuanma Barranquero2014-03-26 16:57:13 +0100
committerJuanma Barranquero2014-03-26 16:57:13 +0100
commit16adf2e6eb1ddf0b32ebea2d5ce8fa1e4c226614 (patch)
tree29b782fd6e7c44a834dd09442a551520e30bcbd6 /doc/lispref
parent5af73b0fe8975eeb47fb270819b4143c18d71caa (diff)
parent196716cf35f81bea108c3b75362e92c86ed1c016 (diff)
downloademacs-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/ChangeLog13
-rw-r--r--doc/lispref/files.texi54
-rw-r--r--doc/lispref/markers.texi10
-rw-r--r--doc/lispref/text.texi9
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 @@
12014-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
62014-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
12014-03-26 Glenn Morris <rgm@gnu.org> 142014-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
952If the file @var{filename} is a symbolic link, the 952If 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
954as a string. (Determining the file name that the link points to from 954as a string. (The link target string is not necessarily the full
955the target is nontrivial.) First, this function recursively follows 955absolute file name of the target; determining the full file name that
956symbolic links at all levels of parent directories. 956the link points to is nontrivial, see below.) If the leading
957 957directories of @var{filename} include symbolic links, this function
958If the file @var{filename} is not a symbolic link (or there is no such file), 958recursively follows them.
959
960If 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
963Here 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
984Note that in the third example, the function returned @file{sym-link},
985but did not proceed to resolve it, although that file is itself a
986symbolic link. This is what we meant by ``non-recursive'' above---the
987process of following the symbolic links does not recurse if the link
988target is itself a link.
989
990The string that this function returns is what is recorded in the
991symbolic link; it may or may not include any leading directories.
992This function does @emph{not} expand the link target to produce a
993fully-qualified file name, and in particular does not use the leading
994directories, if any, of the @var{filename} argument if the link target
995is 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
1005Here, although @file{/foo/bar/baz} was given as a fully-qualified file
1006name, the result is not, and in fact does not have any leading
1007directories at all. And since @file{some-file} might itself be a
1008symbolic link, you cannot simply prepend leading directories to it,
1009nor even naively use @code{expand-file-name} (@pxref{File Name
1010Expansion}) to produce its absolute file name.
1011
1012For this reason, this function is seldom useful if you need to
1013determine more than just the fact that a file is or isn't a symbolic
1014link. 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
981The next two functions recursively follow symbolic links at 1019The 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
347marker. When you do this, be sure you know how the marker is used 347marker. When you do this, be sure you know whether the marker is used
348outside of your program. For example, moving a marker to an unrelated 348outside of your program, and, if so, what effects will result from
349new position can cause undo to later adjust the marker incorrectly. 349moving it---otherwise, confusing things may happen in other parts of
350Often when you wish to relocate a marker to an unrelated position, it 350Emacs.
351is preferable to make a new marker and set the prior one to point
352nowhere.
353 351
354@defun set-marker marker position &optional buffer 352@defun set-marker marker position &optional buffer
355This function moves @var{marker} to @var{position} 353This 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.
1270The deleted text itself is the string @var{text}. The place to 1270The deleted text itself is the string @var{text}. The place to
1271reinsert it is @code{(abs @var{position})}. If @var{position} is 1271reinsert it is @code{(abs @var{position})}. If @var{position} is
1272positive, point was at the beginning of the deleted text, otherwise it 1272positive, point was at the beginning of the deleted text, otherwise it
1273was at the end. 1273was at the end. Zero or more (@var{marker} . @var{adjustment})
1274elements follow immediately after this element.
1274 1275
1275@item (t . @var{time-flag}) 1276@item (t . @var{time-flag})
1276This kind of element indicates that an unmodified buffer became 1277This 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})
1297This kind of element records the fact that the marker @var{marker} was 1298This kind of element records the fact that the marker @var{marker} was
1298relocated due to deletion of surrounding text, and that it moved 1299relocated 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. 1301consistent with the (@var{text} . @var{position}) element preceding it
1302in 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})
1303This is an extensible undo item, which is undone by calling 1306This is an extensible undo item, which is undone by calling