summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2005-11-27 20:59:10 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2005-11-27 20:59:10 +0000
commit40e8a6c318190b95a2f5b1e22bb128e4e2eb46c3 (patch)
tree29eee6f1387970b5346651916177b687a2848f4a /lisp/emacs-lisp
parentf679907bf2c41126ab045cfe4b9015d754b841ca (diff)
downloademacs-40e8a6c318190b95a2f5b1e22bb128e4e2eb46c3.tar.gz
emacs-40e8a6c318190b95a2f5b1e22bb128e4e2eb46c3.tar.bz2
emacs-40e8a6c318190b95a2f5b1e22bb128e4e2eb46c3.zip
(defstruct): Don't define the default constructor if it is overridden.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-macs.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 74c77128059..244029491de 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2175,7 +2175,12 @@ copier, a `NAME-p' predicate, and setf-able `NAME-SLOT' accessors.
(symbol-name (car args)) ""))))
((eq opt :constructor)
(if (cdr args)
- (push args constrs)
+ (progn
+ ;; If this defines a constructor of the same name as
+ ;; the default one, don't define the default.
+ (if (eq (car args) constructor)
+ (setq constructor nil))
+ (push args constrs))
(if args (setq constructor (car args)))))
((eq opt :copier)
(if args (setq copier (car args))))