summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2023-09-26 18:13:00 +0200
committerStefan Kangas <stefankangas@gmail.com>2023-09-29 00:28:28 +0200
commit71feee79309b66a7baf7847472ccebf019d2a801 (patch)
tree6edae37cd0d39fea129ebc7d1e4a8f2552e246cc /lisp/emacs-lisp
parent72cc9cf2cde6e8bce7884f6a91db90e592ca931c (diff)
downloademacs-71feee79309b66a7baf7847472ccebf019d2a801.tar.gz
emacs-71feee79309b66a7baf7847472ccebf019d2a801.tar.bz2
emacs-71feee79309b66a7baf7847472ccebf019d2a801.zip
Doc fix in let-alist for keys with nil value
* lisp/emacs-lisp/let-alist.el (let-alist): Clarify that keys with a nil value will give the same result as if they were missing.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/let-alist.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/let-alist.el b/lisp/emacs-lisp/let-alist.el
index d9ad46b2af7..1f08cc41a5c 100644
--- a/lisp/emacs-lisp/let-alist.el
+++ b/lisp/emacs-lisp/let-alist.el
@@ -60,7 +60,7 @@
;; the variables of the outer one. You can, however, access alists
;; inside the original alist by using dots inside the symbol, as
;; displayed in the example above by the `.site.contents'.
-;;
+
;;; Code:
@@ -139,7 +139,14 @@ essentially expands to
If you nest `let-alist' invocations, the inner one can't access
the variables of the outer one. You can, however, access alists
inside the original alist by using dots inside the symbol, as
-displayed in the example above."
+displayed in the example above.
+
+Note that there is no way to differentiate the case where a key
+is missing from when it is present, but its value is nil. Thus,
+the following form evaluates to nil:
+
+ (let-alist '((some-key . nil))
+ .some-key)"
(declare (indent 1) (debug t))
(let ((var (make-symbol "alist")))
`(let ((,var ,alist))