]> git.eshelyaron.com Git - emacs.git/commitdiff
Introduce EXPVAL for pcase, pcase-defmacro docstrings
authorThien-Thi Nguyen <ttn@gnu.org>
Mon, 21 May 2018 15:11:55 +0000 (17:11 +0200)
committerThien-Thi Nguyen <ttn@gnu.org>
Sun, 27 May 2018 08:36:35 +0000 (10:36 +0200)
Suggested by Drew Adams (Bug#31311).

* lisp/emacs-lisp/pcase.el (pcase): Use EXPVAL in
docstring to stand for the result of evaluating EXP.
(pcase-defmacro): Add (fn ...) form in docstring
that includes [DOC], and the EXPVAL convention.

lisp/emacs-lisp/pcase.el

index 6e8f08e699a4181d56e8f90d22a1ee11f8050090..38e434de3756788d33eb92b1596dd45bb7ecbe9c 100644 (file)
 
 ;;;###autoload
 (defmacro pcase (exp &rest cases)
-  "Evaluate EXP and attempt to match it against structural patterns.
+  "Evaluate EXP to get EXPVAL; try passing control to one of CASES.
 CASES is a list of elements of the form (PATTERN CODE...).
 
 A structural PATTERN describes a template that identifies a class
@@ -427,7 +427,11 @@ any kind of error."
 (defmacro pcase-defmacro (name args &rest body)
   "Define a new kind of pcase PATTERN, by macro expansion.
 Patterns of the form (NAME ...) will be expanded according
-to this macro."
+to this macro.
+
+By convention, DOC should use \"EXPVAL\" to stand
+for the result of evaluating EXP (first arg to `pcase').
+\n(fn NAME ARGS [DOC] &rest BODY...)"
   (declare (indent 2) (debug defun) (doc-string 3))
   ;; Add the function via `fsym', so that an autoload cookie placed
   ;; on a pcase-defmacro will cause the macro to be loaded on demand.