]> code.delx.au - gnu-emacs/blobdiff - lisp/subr.el
Doc fixes re alist-get. (Bug#23548)
[gnu-emacs] / lisp / subr.el
index 81570d484b99e4c786523a18e6b08b92d73dd74a..ed2166a0ee29f11ed6709de05df0ec399cfbb5d0 100644 (file)
@@ -598,10 +598,12 @@ Elements of ALIST that are not conses are ignored."
   alist)
 
 (defun alist-get (key alist &optional default remove)
-  "Get the value associated to KEY in ALIST.
-DEFAULT is the value to return if KEY is not found in ALIST.
-REMOVE, if non-nil, means that when setting this element, we should
-remove the entry if the new value is `eql' to DEFAULT."
+  "Return the value associated with KEY in ALIST, using `assq'.
+If KEY is not found in ALIST, return DEFAULT.
+
+This is a generalized variable suitable for use with `setf'.
+When using it to set a value, optional argument REMOVE non-nil
+means to remove KEY from ALIST if the new value is `eql' to DEFAULT."
   (ignore remove) ;;Silence byte-compiler.
   (let ((x (assq key alist)))
     (if x (cdr x) default)))