]> git.eshelyaron.com Git - emacs.git/commitdiff
* doc/lispref/lists.texi (Association Lists): Document 'alist-get'.
authorEli Zaretskii <eliz@gnu.org>
Sat, 16 Jan 2016 14:32:05 +0000 (16:32 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 16 Jan 2016 14:32:05 +0000 (16:32 +0200)
doc/lispref/lists.texi
etc/NEWS

index d961caf49f6ba08db192c945f0cae0c03cb11ed3..c18c408209a3b24369cf4fbb4cc503c2e5135f15 100644 (file)
@@ -1556,6 +1556,14 @@ keys may not be symbols:
 @end smallexample
 @end defun
 
+@defun alist-get key value &optional default
+This function is like @code{assq}, but instead of returning the entire
+association for @var{key}, @code{(@var{key} . @var{value})}, it
+returns just the @var{value}.  It returns @var{default} if @var{key}
+is not found in @var{alist}, defaulting to @code{nil} if @var{default}
+is omitted.
+@end defun
+
 @defun rassq value alist
 This function returns the first association with value @var{value} in
 @var{alist}.  It returns @code{nil} if no association in @var{alist} has
index 3f867a0a9e8e162964da1490e120edc3191f225c..01a8490023ad4314c1c4d5b2b0fbe3b24bd404ad 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1464,6 +1464,7 @@ emulates the behavior of modern Posix platforms when the locale's
 codeset is "UTF-8" (as in "en_US.UTF-8").  This is needed because
 MS-Windows doesn't support UTF-8 as codeset in its locales.
 
++++
 ** New function `alist-get', which is also a valid place (aka lvalue).
 
 ** New function `funcall-interactively', which works like `funcall'