diff options
| author | Mattias EngdegÄrd | 2019-04-09 16:56:37 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2019-04-09 16:56:37 +0200 |
| commit | c81465580fe262f28ce47502c00f4afcbe3b8f8d (patch) | |
| tree | ee148a7a9ffa35a2e94d2bd6595978b70973d7d1 | |
| parent | 44b306d3510e54432b76724583ea9405f1c90686 (diff) | |
| download | emacs-c81465580fe262f28ce47502c00f4afcbe3b8f8d.tar.gz emacs-c81465580fe262f28ce47502c00f4afcbe3b8f8d.zip | |
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).
| -rw-r--r-- | lisp/subr.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 45b39161965..bdf98979c49 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -779,9 +779,9 @@ Elements of ALIST that are not conses are ignored." | |||
| 779 | alist) | 779 | alist) |
| 780 | 780 | ||
| 781 | (defun alist-get (key alist &optional default remove testfn) | 781 | (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'. |
| 783 | If KEY is not found in ALIST, return DEFAULT. | 783 | 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'. |
| 785 | 785 | ||
| 786 | You can use `alist-get' in PLACE expressions. This will modify | 786 | You can use `alist-get' in PLACE expressions. This will modify |
| 787 | an existing association (more precisely, the first one if | 787 | an existing association (more precisely, the first one if |