diff options
| author | Stefan Monnier | 2005-11-27 20:59:10 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-11-27 20:59:10 +0000 |
| commit | 40e8a6c318190b95a2f5b1e22bb128e4e2eb46c3 (patch) | |
| tree | 29eee6f1387970b5346651916177b687a2848f4a | |
| parent | f679907bf2c41126ab045cfe4b9015d754b841ca (diff) | |
| download | emacs-40e8a6c318190b95a2f5b1e22bb128e4e2eb46c3.tar.gz emacs-40e8a6c318190b95a2f5b1e22bb128e4e2eb46c3.zip | |
(defstruct): Don't define the default constructor if it is overridden.
| -rw-r--r-- | lisp/emacs-lisp/cl-macs.el | 7 |
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. | |||
| 2175 | (symbol-name (car args)) "")))) | 2175 | (symbol-name (car args)) "")))) |
| 2176 | ((eq opt :constructor) | 2176 | ((eq opt :constructor) |
| 2177 | (if (cdr args) | 2177 | (if (cdr args) |
| 2178 | (push args constrs) | 2178 | (progn |
| 2179 | ;; If this defines a constructor of the same name as | ||
| 2180 | ;; the default one, don't define the default. | ||
| 2181 | (if (eq (car args) constructor) | ||
| 2182 | (setq constructor nil)) | ||
| 2183 | (push args constrs)) | ||
| 2179 | (if args (setq constructor (car args))))) | 2184 | (if args (setq constructor (car args))))) |
| 2180 | ((eq opt :copier) | 2185 | ((eq opt :copier) |
| 2181 | (if args (setq copier (car args)))) | 2186 | (if args (setq copier (car args)))) |