From 2460cfac091c6a5b095816bef9e639f9da88f432 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 16 Jan 2016 16:32:05 +0200 Subject: [PATCH] * doc/lispref/lists.texi (Association Lists): Document 'alist-get'. --- doc/lispref/lists.texi | 8 ++++++++ etc/NEWS | 1 + 2 files changed, 9 insertions(+) diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index d961caf49f6..c18c408209a 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -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 diff --git a/etc/NEWS b/etc/NEWS index 3f867a0a9e8..01a8490023a 100644 --- 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' -- 2.39.5