diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2015-02-09 10:49:43 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2015-02-09 10:49:43 -0500 |
commit | 699ece275727be4ce452cdc43fe09fd7d8f8034c (patch) | |
tree | 9a22451069df9828211f10d31ed6c936f6393c69 | |
parent | af560cd6f15e7cc7e42bff5b3c802b9d1d1640b5 (diff) | |
download | emacs-699ece275727be4ce452cdc43fe09fd7d8f8034c.tar.gz |
* lisp/emacs-lisp/eieio-core.el (eieio-oset-default): Catch the unexpected
case where the default value would be re-interpreted as a form!
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/emacs-lisp/eieio-core.el | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9ca0c306e44..d9024982807 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-02-09 Stefan Monnier <monnier@iro.umontreal.ca> + + * emacs-lisp/eieio-core.el (eieio-oset-default): Catch the unexpected + case where the default value would be re-interpreted as a form! + 2015-02-09 Christopher Genovese <genovese@cmu.edu> (tiny change) * help-fns.el (help-fns--signature): Keep doc for keymap. diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index fa8fefa1df0..e71c54d4123 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -1010,6 +1010,8 @@ Fills in the default value in CLASS' in SLOT with VALUE." (signal 'invalid-slot-name (list (eieio--class-symbol class) slot))) (eieio--validate-slot-value class c value slot) ;; Set this into the storage for defaults. + (if (eieio-eval-default-p value) + (error "Can't set default to a sexp that gets evaluated again")) (setcar (nthcdr (- c (eval-when-compile eieio--object-num-slots)) (eieio--class-public-d class)) value) |