diff options
author | Stephen Leake <stephen_leake@stephe-leake.org> | 2019-07-30 11:03:15 -0700 |
---|---|---|
committer | Stephen Leake <stephen_leake@stephe-leake.org> | 2019-07-30 11:03:15 -0700 |
commit | 01739625704aaaea6831cef459a4a53171689513 (patch) | |
tree | ef9f324b3fa6696647c6e637e436ee6160155b92 /lisp/emacs-lisp/cl-macs.el | |
parent | 056cbcb7a959463290bc91c19b909cbf3eb47d0a (diff) | |
parent | 9b480db6732c6d2e886838f112d9bd46fc8989bf (diff) | |
download | emacs-01739625704aaaea6831cef459a4a53171689513.tar.gz emacs-01739625704aaaea6831cef459a4a53171689513.tar.bz2 emacs-01739625704aaaea6831cef459a4a53171689513.zip |
Merge commit '9b480db6732c6d2e886838f112d9bd46fc8989bf'
Diffstat (limited to 'lisp/emacs-lisp/cl-macs.el')
-rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 4347b4b71bf..1ae72666244 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -695,8 +695,11 @@ its argument list allows full Common Lisp conventions." "Bind the variables in ARGS to the result of EXPR and execute BODY." (declare (indent 2) (debug (&define cl-macro-list1 def-form cl-declarations def-body))) - (let* ((cl--bind-lets nil) (cl--bind-forms nil) - (cl--bind-defs nil) (cl--bind-block 'cl-none) (cl--bind-enquote nil)) + (let* ((cl--bind-lets nil) + (cl--bind-forms nil) + (cl--bind-defs nil) + (cl--bind-block args) + (cl--bind-enquote nil)) (cl--do-arglist (or args '(&aux)) expr) (macroexp-let* (nreverse cl--bind-lets) (macroexp-progn (append (nreverse cl--bind-forms) body))))) @@ -2719,8 +2722,10 @@ 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. -Currently, only one keyword is supported, `:read-only'. If this has a -non-nil value, that slot cannot be set via `setf'. +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. +- `:type': the type of the field; currently unused. \(fn NAME &optional DOCSTRING &rest SLOTS)" (declare (doc-string 2) (indent 1) @@ -2899,14 +2904,17 @@ non-nil value, that slot cannot be set via `setf'. defaults)) (if (assq slot descp) (error "Duplicate slots named %s in %s" slot name)) - (let ((accessor (intern (format "%s%s" conc-name slot)))) + (let ((accessor (intern (format "%s%s" conc-name slot))) + (default-value (pop desc)) + (doc (plist-get desc :documentation))) (push slot slots) - (push (pop desc) defaults) + (push default-value defaults) ;; The arg "cl-x" is referenced by name in eg pred-form ;; and pred-check, so changing it is not straightforward. (push `(,defsym ,accessor (cl-x) - ,(format "Access slot \"%s\" of `%s' struct CL-X." - slot name) + ,(format "Access slot \"%s\" of `%s' struct CL-X.%s" + slot name + (if doc (concat "\n" doc) "")) (declare (side-effect-free t)) ,@(and pred-check (list `(or ,pred-check |