aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorStefan Monnier2019-07-29 11:56:11 -0400
committerStefan Monnier2019-07-29 11:56:11 -0400
commit75361be63fcd42497dd1eb93cab3255833334475 (patch)
treeb67e1dda5333f799e5df850765e1d68e8d1c77dd /doc/misc
parentb47ca8125b39b871328da114637449a86050baa5 (diff)
downloademacs-75361be63fcd42497dd1eb93cab3255833334475.tar.gz
emacs-75361be63fcd42497dd1eb93cab3255833334475.zip
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Add slot option :documentation
Use it to improve the docstring of the accessor functions. * doc/misc/cl.texi: Rename menu entry to "CL-Lib". (Structures): Add ':documentation' and mention ':type' as well, which we don't completely ignore any more.
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/cl.texi26
1 files changed, 18 insertions, 8 deletions
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index a9197602634..afe8f01f596 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -24,7 +24,7 @@ modify this GNU manual.''
24 24
25@dircategory Emacs lisp libraries 25@dircategory Emacs lisp libraries
26@direntry 26@direntry
27* CL: (cl). Partial Common Lisp support for Emacs Lisp. 27* CL-Lib: (cl). Partial Common Lisp support for Emacs Lisp.
28@end direntry 28@end direntry
29 29
30@finalout 30@finalout
@@ -4036,12 +4036,6 @@ is either a slot symbol or a list of the form @samp{(@var{slot-name}
4036is a Lisp form that is evaluated any time an instance of the 4036is a Lisp form that is evaluated any time an instance of the
4037structure type is created without specifying that slot's value. 4037structure type is created without specifying that slot's value.
4038 4038
4039Common Lisp defines several slot options, but the only one
4040implemented in this package is @code{:read-only}. A non-@code{nil}
4041value for this option means the slot should not be @code{setf}-able;
4042the slot's value is determined when the object is created and does
4043not change afterward.
4044
4045@example 4039@example
4046(cl-defstruct person 4040(cl-defstruct person
4047 (name nil :read-only t) 4041 (name nil :read-only t)
@@ -4049,7 +4043,23 @@ not change afterward.
4049 (sex 'unknown)) 4043 (sex 'unknown))
4050@end example 4044@end example
4051 4045
4052Any slot options other than @code{:read-only} are ignored. 4046@var{slot-options} is a list of keyword-value pairs, where the
4047following keywords can be used:
4048
4049@table @code
4050@item :read-only
4051A non-nil value means the slot should not be @code{setf}-able;
4052the slot's value is determined when the object is created and does
4053not change afterward.
4054
4055@item :type
4056The expected type of the values held in this slot.
4057
4058@item :documentation
4059A documentation string describing the slot.
4060@end table
4061
4062Other slot options are currently ignored.
4053 4063
4054For obscure historical reasons, structure options take a different 4064For obscure historical reasons, structure options take a different
4055form than slot options. A structure option is either a keyword 4065form than slot options. A structure option is either a keyword