diff options
| author | Noam Postavsky | 2018-03-08 18:48:39 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2018-03-10 17:56:04 -0500 |
| commit | e244fed5e041c706dd10c60bd893634902f04aaa (patch) | |
| tree | 84682c4634a9397fcf48296e71ee59217bb7dfe7 | |
| parent | df0e7e2b9e98e45353d3555448cb0f7d5a20a00d (diff) | |
| download | emacs-e244fed5e041c706dd10c60bd893634902f04aaa.tar.gz emacs-e244fed5e041c706dd10c60bd893634902f04aaa.zip | |
Clarify that nil doesn't match itself as a cl-case clause (Bug#30749)
* lisp/emacs-lisp/cl-macs.el (cl-case): Mention that the ATOM
=> (ATOM) short form is only for non-nil ATOMs.
| -rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index e7f82ced488..971f4f926bd 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el | |||
| @@ -761,13 +761,15 @@ The result of the body appears to the compiler as a quoted constant." | |||
| 761 | ;;;###autoload | 761 | ;;;###autoload |
| 762 | (defmacro cl-case (expr &rest clauses) | 762 | (defmacro cl-case (expr &rest clauses) |
| 763 | "Eval EXPR and choose among clauses on that value. | 763 | "Eval EXPR and choose among clauses on that value. |
| 764 | Each clause looks like (KEYLIST BODY...). EXPR is evaluated and compared | 764 | Each clause looks like (KEYLIST BODY...). EXPR is evaluated and |
| 765 | against each key in each KEYLIST; the corresponding BODY is evaluated. | 765 | compared against each key in each KEYLIST; the corresponding BODY |
| 766 | If no clause succeeds, cl-case returns nil. A single atom may be used in | 766 | is evaluated. If no clause succeeds, cl-case returns nil. A |
| 767 | place of a KEYLIST of one atom. A KEYLIST of t or `otherwise' is | 767 | single non-nil atom may be used in place of a KEYLIST of one |
| 768 | allowed only in the final clause, and matches if no other keys match. | 768 | atom. A KEYLIST of t or `otherwise' is allowed only in the final |
| 769 | Key values are compared by `eql'. | 769 | clause, and matches if no other keys match. Key values are |
| 770 | \n(fn EXPR (KEYLIST BODY...)...)" | 770 | compared by `eql'. |
| 771 | |||
| 772 | \(fn EXPR (KEYLIST BODY...)...)" | ||
| 771 | (declare (indent 1) (debug (form &rest (sexp body)))) | 773 | (declare (indent 1) (debug (form &rest (sexp body)))) |
| 772 | (macroexp-let2 macroexp-copyable-p temp expr | 774 | (macroexp-let2 macroexp-copyable-p temp expr |
| 773 | (let* ((head-list nil)) | 775 | (let* ((head-list nil)) |