summaryrefslogtreecommitdiff
path: root/src/fns.c
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2022-07-18 12:19:38 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2022-07-18 12:49:29 +0200
commit9de0b06e7470cc047c96c59befe40077dc72b98d (patch)
treebbd0b1626ed7a60a77b6c6a42212768221daea33 /src/fns.c
parent6f7941272b112f0412479ffc315352d7928e0fdf (diff)
downloademacs-9de0b06e7470cc047c96c59befe40077dc72b98d.tar.gz
Clarify `take` and `ntake` documentation (bug#56521)
* doc/lispref/lists.texi (List Elements): Describe `ntake` better. * src/fns.c (Ftake, Fntake): Rephrase doc strings.
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fns.c b/src/fns.c
index 84cfec6c3f0..7e78bba3a04 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1560,7 +1560,7 @@ substring_both (Lisp_Object string, ptrdiff_t from, ptrdiff_t from_byte,
DEFUN ("take", Ftake, Stake, 2, 2, 0,
doc: /* Return the first N elements of LIST.
If N is zero or negative, return nil.
-If LIST is no more than N elements long, return it (or a copy). */)
+If N is greater or equal to the length of LIST, return LIST (or a copy). */)
(Lisp_Object n, Lisp_Object list)
{
CHECK_FIXNUM (n);
@@ -1590,7 +1590,8 @@ If LIST is no more than N elements long, return it (or a copy). */)
DEFUN ("ntake", Fntake, Sntake, 2, 2, 0,
doc: /* Modify LIST to keep only the first N elements.
If N is zero or negative, return nil.
-If LIST is no more than N elements long, return it. */)
+If N is greater or equal to the length of LIST, return LIST unmodified.
+Otherwise, return LIST after truncating it. */)
(Lisp_Object n, Lisp_Object list)
{
CHECK_FIXNUM (n);