aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2013-08-13 00:15:27 -0700
committerGlenn Morris2013-08-13 00:15:27 -0700
commit3e6b67c9b7230bf10219082d9215d9617a33715e (patch)
treee55e450b9ef0cc50ec144e1b3264a20cf14189b3
parent16bcc96df4447cb5c47e53a4512671a2da7504f8 (diff)
downloademacs-3e6b67c9b7230bf10219082d9215d9617a33715e.tar.gz
emacs-3e6b67c9b7230bf10219082d9215d9617a33715e.zip
* lispref/lists.texi (List Elements): Undocument nth, nthcdr with n < 0
-rw-r--r--doc/lispref/ChangeLog5
-rw-r--r--doc/lispref/lists.texi15
2 files changed, 12 insertions, 8 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 29ab28c0fad..6df8c3912a3 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
12013-08-13 Glenn Morris <rgm@gnu.org>
2
3 * lists.texi (List Elements):
4 Undocument behavior of nth and nthcdr with n < 0. (Bug#15059)
5
12013-08-13 Xue Fuqiao <xfq.free@gmail.com> 62013-08-13 Xue Fuqiao <xfq.free@gmail.com>
2 7
3 * frames.texi (Display Feature Testing): Add indexes. 8 * frames.texi (Display Feature Testing): Add indexes.
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi
index 14601de1814..9daf01cd0a2 100644
--- a/doc/lispref/lists.texi
+++ b/doc/lispref/lists.texi
@@ -270,8 +270,10 @@ are numbered starting with zero, so the @sc{car} of @var{list} is
270element number zero. If the length of @var{list} is @var{n} or less, 270element number zero. If the length of @var{list} is @var{n} or less,
271the value is @code{nil}. 271the value is @code{nil}.
272 272
273If @var{n} is negative, @code{nth} returns the first element of 273@c Behavior for -ve n undefined since 2013/08; see bug#15059.
274@var{list}. 274@ignore
275If @var{n} is negative, @code{nth} returns the first element of @var{list}.
276@end ignore
275 277
276@example 278@example
277@group 279@group
@@ -281,10 +283,6 @@ If @var{n} is negative, @code{nth} returns the first element of
281@group 283@group
282(nth 10 '(1 2 3 4)) 284(nth 10 '(1 2 3 4))
283 @result{} nil 285 @result{} nil
284@end group
285@group
286(nth -3 '(1 2 3 4))
287 @result{} 1
288 286
289(nth n x) @equiv{} (car (nthcdr n x)) 287(nth n x) @equiv{} (car (nthcdr n x))
290@end group 288@end group
@@ -300,7 +298,8 @@ This function returns the @var{n}th @sc{cdr} of @var{list}. In other
300words, it skips past the first @var{n} links of @var{list} and returns 298words, it skips past the first @var{n} links of @var{list} and returns
301what follows. 299what follows.
302 300
303If @var{n} is zero or negative, @code{nthcdr} returns all of 301@c "or negative" removed 2013/08; see bug#15059.
302If @var{n} is zero, @code{nthcdr} returns all of
304@var{list}. If the length of @var{list} is @var{n} or less, 303@var{list}. If the length of @var{list} is @var{n} or less,
305@code{nthcdr} returns @code{nil}. 304@code{nthcdr} returns @code{nil}.
306 305
@@ -314,7 +313,7 @@ If @var{n} is zero or negative, @code{nthcdr} returns all of
314 @result{} nil 313 @result{} nil
315@end group 314@end group
316@group 315@group
317(nthcdr -3 '(1 2 3 4)) 316(nthcdr 0 '(1 2 3 4))
318 @result{} (1 2 3 4) 317 @result{} (1 2 3 4)
319@end group 318@end group
320@end example 319@end example