aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2016-05-27 12:34:33 -0400
committerStefan Monnier2016-05-27 12:34:33 -0400
commit09b72fc38aee1032b6d2c8476bcc22a2e7ec5642 (patch)
tree2f76ad2ba604fb145542cbb84eb55d6da558d667
parent84f431224cdc1ee65b4662f3eb55f4da46066e3e (diff)
downloademacs-09b72fc38aee1032b6d2c8476bcc22a2e7ec5642.tar.gz
emacs-09b72fc38aee1032b6d2c8476bcc22a2e7ec5642.zip
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Add docstring to accessors.
-rw-r--r--lisp/emacs-lisp/cl-macs.el12
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'.
2672 (let ((accessor (intern (format "%s%s" conc-name slot)))) 2672 (let ((accessor (intern (format "%s%s" conc-name slot))))
2673 (push slot slots) 2673 (push slot slots)
2674 (push (nth 1 desc) defaults) 2674 (push (nth 1 desc) defaults)
2675 (push `(cl-defsubst ,accessor (cl-x) 2675 (push `(cl-defsubst ,accessor (x)
2676 ,(format "Access slot \"%s\" of `%s' struct X."
2677 slot struct)
2676 (declare (side-effect-free t)) 2678 (declare (side-effect-free t))
2677 ,@(and pred-check 2679 ,@(and pred-check
2678 (list `(or ,pred-check 2680 (list `(or ,pred-check
2679 (signal 'wrong-type-argument 2681 (signal 'wrong-type-argument
2680 (list ',name cl-x))))) 2682 (list ',name x)))))
2681 ,(if (memq type '(nil vector)) `(aref cl-x ,pos) 2683 ,(if (memq type '(nil vector)) `(aref x ,pos)
2682 (if (= pos 0) '(car cl-x) 2684 (if (= pos 0) '(car x)
2683 `(nth ,pos cl-x)))) 2685 `(nth ,pos x))))
2684 forms) 2686 forms)
2685 (if (cadr (memq :read-only (cddr desc))) 2687 (if (cadr (memq :read-only (cddr desc)))
2686 (push `(gv-define-expander ,accessor 2688 (push `(gv-define-expander ,accessor