diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2016-05-27 12:34:33 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2016-05-27 12:34:33 -0400 |
commit | 09b72fc38aee1032b6d2c8476bcc22a2e7ec5642 (patch) | |
tree | 2f76ad2ba604fb145542cbb84eb55d6da558d667 /lisp/emacs-lisp | |
parent | 84f431224cdc1ee65b4662f3eb55f4da46066e3e (diff) | |
download | emacs-09b72fc38aee1032b6d2c8476bcc22a2e7ec5642.tar.gz emacs-09b72fc38aee1032b6d2c8476bcc22a2e7ec5642.tar.bz2 emacs-09b72fc38aee1032b6d2c8476bcc22a2e7ec5642.zip |
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Add docstring to accessors.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 68abe67698c..809e9223b43 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2672,15 +2672,17 @@ non-nil value, that slot cannot be set via `setf'. (let ((accessor (intern (format "%s%s" conc-name slot)))) (push slot slots) (push (nth 1 desc) defaults) - (push `(cl-defsubst ,accessor (cl-x) + (push `(cl-defsubst ,accessor (x) + ,(format "Access slot \"%s\" of `%s' struct X." + slot struct) (declare (side-effect-free t)) ,@(and pred-check (list `(or ,pred-check (signal 'wrong-type-argument - (list ',name cl-x))))) - ,(if (memq type '(nil vector)) `(aref cl-x ,pos) - (if (= pos 0) '(car cl-x) - `(nth ,pos cl-x)))) + (list ',name x))))) + ,(if (memq type '(nil vector)) `(aref x ,pos) + (if (= pos 0) '(car x) + `(nth ,pos x)))) forms) (if (cadr (memq :read-only (cddr desc))) (push `(gv-define-expander ,accessor |