diff options
| author | Stefan Monnier | 2015-04-27 15:33:43 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2015-04-27 15:33:43 -0400 |
| commit | d92e0c58e859592eba21176a09797e083ff9c541 (patch) | |
| tree | 65b66e5f7e25e608b929e017226c36aa9c80c63e | |
| parent | 1c7f0cdc4c1f8479fcf929cfb2446432b1cc19de (diff) | |
| download | emacs-d92e0c58e859592eba21176a09797e083ff9c541.tar.gz emacs-d92e0c58e859592eba21176a09797e083ff9c541.zip | |
* lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Reuse oldc.
| -rw-r--r-- | lisp/emacs-lisp/eieio-core.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 59d834837b0..582ac8a6524 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el | |||
| @@ -277,12 +277,12 @@ See `defclass' for more information." | |||
| 277 | (setq eieio-hook nil) | 277 | (setq eieio-hook nil) |
| 278 | 278 | ||
| 279 | (let* ((oldc (let ((c (eieio--class-v cname))) (if (eieio--class-p c) c))) | 279 | (let* ((oldc (let ((c (eieio--class-v cname))) (if (eieio--class-p c) c))) |
| 280 | (newc (if (and oldc (not (eieio--class-default-object-cache oldc))) | 280 | (newc (or oldc |
| 281 | ;; The oldc class is a stub setup by eieio-defclass-autoload. | 281 | ;; Reuse `oldc' instead of creating a new one, so that |
| 282 | ;; Reuse it instead of creating a new one, so that existing | 282 | ;; existing references stay valid. E.g. when |
| 283 | ;; references stay valid. | 283 | ;; reloading the file that does the `defclass', we don't |
| 284 | oldc | 284 | ;; want to create a new class object. |
| 285 | (eieio--class-make cname))) | 285 | (eieio--class-make cname))) |
| 286 | (groups nil) ;; list of groups id'd from slots | 286 | (groups nil) ;; list of groups id'd from slots |
| 287 | (clearparent nil)) | 287 | (clearparent nil)) |
| 288 | 288 | ||