1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-18 03:40:47 -08:00

Make sure alist-related functions say so in their doc

* src/fns.c (Fassq, assq_no_quit, Fassoc, assoc_no_quit, Frassq)
(Frassoc): Rename argument LIST to ALIST.  Doc strings updated.
This commit is contained in:
Eli Zaretskii 2020-04-29 17:52:53 +03:00
parent 2f9bfaef21
commit 274ec97e3c

View file

@ -1604,16 +1604,16 @@ The value is actually the tail of LIST whose car is ELT. */)
}
DEFUN ("assq", Fassq, Sassq, 2, 2, 0,
doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST.
The value is actually the first element of LIST whose car is KEY.
Elements of LIST that are not conses are ignored. */)
(Lisp_Object key, Lisp_Object list)
doc: /* Return non-nil if KEY is `eq' to the car of an element of ALIST.
The value is actually the first element of ALIST whose car is KEY.
Elements of ALIST that are not conses are ignored. */)
(Lisp_Object key, Lisp_Object alist)
{
Lisp_Object tail = list;
Lisp_Object tail = alist;
FOR_EACH_TAIL (tail)
if (CONSP (XCAR (tail)) && EQ (XCAR (XCAR (tail)), key))
return XCAR (tail);
CHECK_LIST_END (tail, list);
CHECK_LIST_END (tail, alist);
return Qnil;
}
@ -1621,22 +1621,22 @@ Elements of LIST that are not conses are ignored. */)
Use only on objects known to be non-circular lists. */
Lisp_Object
assq_no_quit (Lisp_Object key, Lisp_Object list)
assq_no_quit (Lisp_Object key, Lisp_Object alist)
{
for (; ! NILP (list); list = XCDR (list))
if (CONSP (XCAR (list)) && EQ (XCAR (XCAR (list)), key))
return XCAR (list);
for (; ! NILP (alist); alist = XCDR (alist))
if (CONSP (XCAR (alist)) && EQ (XCAR (XCAR (alist)), key))
return XCAR (alist);
return Qnil;
}
DEFUN ("assoc", Fassoc, Sassoc, 2, 3, 0,
doc: /* Return non-nil if KEY is equal to the car of an element of LIST.
The value is actually the first element of LIST whose car equals KEY.
doc: /* Return non-nil if KEY is equal to the car of an element of ALIST.
The value is actually the first element of ALIST whose car equals KEY.
Equality is defined by TESTFN if non-nil or by `equal' if nil. */)
(Lisp_Object key, Lisp_Object list, Lisp_Object testfn)
(Lisp_Object key, Lisp_Object alist, Lisp_Object testfn)
{
Lisp_Object tail = list;
Lisp_Object tail = alist;
FOR_EACH_TAIL (tail)
{
Lisp_Object car = XCAR (tail);
@ -1647,7 +1647,7 @@ Equality is defined by TESTFN if non-nil or by `equal' if nil. */)
: !NILP (call2 (testfn, XCAR (car), key))))
return car;
}
CHECK_LIST_END (tail, list);
CHECK_LIST_END (tail, alist);
return Qnil;
}
@ -1656,11 +1656,11 @@ Equality is defined by TESTFN if non-nil or by `equal' if nil. */)
that are not too deep and are not window configurations. */
Lisp_Object
assoc_no_quit (Lisp_Object key, Lisp_Object list)
assoc_no_quit (Lisp_Object key, Lisp_Object alist)
{
for (; ! NILP (list); list = XCDR (list))
for (; ! NILP (alist); alist = XCDR (alist))
{
Lisp_Object car = XCAR (list);
Lisp_Object car = XCAR (alist);
if (CONSP (car)
&& (EQ (XCAR (car), key) || equal_no_quit (XCAR (car), key)))
return car;
@ -1669,24 +1669,24 @@ assoc_no_quit (Lisp_Object key, Lisp_Object list)
}
DEFUN ("rassq", Frassq, Srassq, 2, 2, 0,
doc: /* Return non-nil if KEY is `eq' to the cdr of an element of LIST.
The value is actually the first element of LIST whose cdr is KEY. */)
(Lisp_Object key, Lisp_Object list)
doc: /* Return non-nil if KEY is `eq' to the cdr of an element of ALIST.
The value is actually the first element of ALIST whose cdr is KEY. */)
(Lisp_Object key, Lisp_Object alist)
{
Lisp_Object tail = list;
Lisp_Object tail = alist;
FOR_EACH_TAIL (tail)
if (CONSP (XCAR (tail)) && EQ (XCDR (XCAR (tail)), key))
return XCAR (tail);
CHECK_LIST_END (tail, list);
CHECK_LIST_END (tail, alist);
return Qnil;
}
DEFUN ("rassoc", Frassoc, Srassoc, 2, 2, 0,
doc: /* Return non-nil if KEY is `equal' to the cdr of an element of LIST.
The value is actually the first element of LIST whose cdr equals KEY. */)
(Lisp_Object key, Lisp_Object list)
doc: /* Return non-nil if KEY is `equal' to the cdr of an element of ALIST.
The value is actually the first element of ALIST whose cdr equals KEY. */)
(Lisp_Object key, Lisp_Object alist)
{
Lisp_Object tail = list;
Lisp_Object tail = alist;
FOR_EACH_TAIL (tail)
{
Lisp_Object car = XCAR (tail);
@ -1694,7 +1694,7 @@ The value is actually the first element of LIST whose cdr equals KEY. */)
&& (EQ (XCDR (car), key) || !NILP (Fequal (XCDR (car), key))))
return car;
}
CHECK_LIST_END (tail, list);
CHECK_LIST_END (tail, alist);
return Qnil;
}