Skip to content

Commit c814655

Browse files
committed
Clarify the TESTFN argument to `alist-get'
* lisp/subr.el (alist-get): Rephrase the initial text to clarify the meaning of the TESTFN argument. It's an equality predicate, not a look-up function (Bug#35206).
1 parent 44b306d commit c814655

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lisp/subr.el

+2-2
Original file line numberDiff line numberDiff line change
@@ -779,9 +779,9 @@ Elements of ALIST that are not conses are ignored."
779779
alist)
780780

781781
(defun alist-get (key alist &optional default remove testfn)
782-
"Return the value associated with KEY in ALIST.
782+
"Find the first element of ALIST whose `car' equals KEY and return its `cdr'.
783783
If KEY is not found in ALIST, return DEFAULT.
784-
Use TESTFN to lookup in the alist if non-nil. Otherwise, use `assq'.
784+
Equality with KEY is tested by TESTFN, defaulting to `eq'.
785785
786786
You can use `alist-get' in PLACE expressions. This will modify
787787
an existing association (more precisely, the first one if

0 commit comments

Comments
 (0)