summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-08-21 16:50:16 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-08-21 16:50:20 +0200
commita0023661a480bee27521981f7324e8670c7906c7 (patch)
tree2d2feaea5c091521db33f6c243d89caf82718a94 /lisp/emacs-lisp
parent69637fe7a612733177b72479269930562d4ba386 (diff)
downloademacs-a0023661a480bee27521981f7324e8670c7906c7.tar.gz
emacs-a0023661a480bee27521981f7324e8670c7906c7.tar.bz2
emacs-a0023661a480bee27521981f7324e8670c7906c7.zip
Clarify cl-defstruct doc string and manual entry somewhat
* doc/misc/cl.texi (Structures): Rename the slot "name" in the examples to "first-name", since we're talking about the names of slots a lot here, and having a slot with the name "name" makes the examples somewhat confusing. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Clarify certain things about slots (bug#14278).
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-macs.el25
1 files changed, 15 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 4ef1948b0fe..d878af4d84a 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2868,16 +2868,21 @@ in SLOTs. It defines a `make-NAME' constructor, a `copy-NAME'
copier, a `NAME-p' predicate, and slot accessors named `NAME-SLOT'.
You can use the accessors to set the corresponding slots, via `setf'.
-NAME may instead take the form (NAME OPTIONS...), where each
-OPTION is either a single keyword or (KEYWORD VALUE) where
-KEYWORD can be one of `:conc-name', `:constructor', `:copier',
-`:predicate', `:type', `:named', `:initial-offset',
-`:print-function', `:noinline', or `:include'. See Info
-node `(cl)Structures' for the description of the options.
-
-Each SLOT may instead take the form (SNAME SDEFAULT SOPTIONS...), where
-SDEFAULT is the default value of that slot and SOPTIONS are keyword-value
-pairs for that slot.
+NAME is usually a symbol, but may instead take the form (NAME
+OPTIONS...), where each OPTION is either a single keyword
+or (KEYWORD VALUE) where KEYWORD can be one of `:conc-name',
+`:constructor', `:copier', `:predicate', `:type', `:named',
+`:initial-offset', `:print-function', `:noinline', or `:include'.
+See Info node `(cl)Structures' for the description of the
+options.
+
+The first element in SLOTS can be a doc string.
+
+The rest of the elements in SLOTS is a list of SLOT elements,
+each of which should either be a symbol, or take the form (SNAME
+SDEFAULT SOPTIONS...), where SDEFAULT is the default value of
+that slot and SOPTIONS are keyword-value pairs for that slot.
+
Supported keywords for slots are:
- `:read-only': If this has a non-nil value, that slot cannot be set via `setf'.
- `:documentation': this is a docstring describing the slot.