[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master c814655: Clarify the TESTFN argument to `alist-get'
From: |
Mattias Engdegård |
Subject: |
[Emacs-diffs] master c814655: Clarify the TESTFN argument to `alist-get' |
Date: |
Tue, 9 Apr 2019 10:57:09 -0400 (EDT) |
branch: master
commit c81465580fe262f28ce47502c00f4afcbe3b8f8d
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
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).
---
lisp/subr.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/subr.el b/lisp/subr.el
index 45b3916..bdf9897 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -779,9 +779,9 @@ Elements of ALIST that are not conses are ignored."
alist)
(defun alist-get (key alist &optional default remove testfn)
- "Return the value associated with KEY in ALIST.
+ "Find the first element of ALIST whose `car' equals KEY and return its `cdr'.
If KEY is not found in ALIST, return DEFAULT.
-Use TESTFN to lookup in the alist if non-nil. Otherwise, use `assq'.
+Equality with KEY is tested by TESTFN, defaulting to `eq'.
You can use `alist-get' in PLACE expressions. This will modify
an existing association (more precisely, the first one if
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master c814655: Clarify the TESTFN argument to `alist-get',
Mattias Engdegård <=