changeset 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 759b69f39057
children 3653ab7f7e3c
files lisp/emacs-lisp/cl-macs.el
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
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))))