From a0023661a480bee27521981f7324e8670c7906c7 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 21 Aug 2021 16:50:16 +0200 Subject: 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). --- lisp/emacs-lisp/cl-macs.el | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'lisp/emacs-lisp/cl-macs.el') 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. -- cgit v1.2.3