]> code.delx.au - gnu-emacs/blobdiff - doc/lispref/lists.texi
Doc fixes re alist-get. (Bug#23548)
[gnu-emacs] / doc / lispref / lists.texi
index c18c408209a3b24369cf4fbb4cc503c2e5135f15..e7a739f88f32ffccc3ef3d37a25729e2bb9473f7 100644 (file)
@@ -1556,12 +1556,16 @@ keys may not be symbols:
 @end smallexample
 @end defun
 
-@defun alist-get key value &optional default
+@defun alist-get key value &optional default remove
 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.
+returns just the @var{value}.  If @var{key} is not found in
+@var{alist} it returns @var{default}.
+
+This is a generalized variable (@pxref{Generalized Variables}) that
+can be used to change a value with @code{setf}.  When using it to set
+a value, optional argument @var{remove} non-nil means to remove
+@var{key} from @var{alist} if the new value is @code{eql} to @var{default}.
 @end defun
 
 @defun rassq value alist