Mercurial > emacs
diff lisp/emacs-lisp/cl-macs.el @ 67162:d40b3c4502e9
(defstruct): Don't define the default constructor if it is overridden.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sun, 27 Nov 2005 20:59:10 +0000 |
parents | f5c6d3e91a14 |
children | 067115a6e738 7beb78bc1f8e |
line wrap: on
line diff
--- a/lisp/emacs-lisp/cl-macs.el Sun Nov 27 20:53:55 2005 +0000 +++ b/lisp/emacs-lisp/cl-macs.el Sun Nov 27 20:59:10 2005 +0000 @@ -2175,7 +2175,12 @@ (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))))