From: Stefan Monnier Date: Mon, 9 Feb 2015 15:49:43 +0000 (-0500) Subject: * lisp/emacs-lisp/eieio-core.el (eieio-oset-default): Catch the unexpected X-Git-Tag: emacs-25.0.90~2008^2~47^2~1 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=699ece275727be4ce452cdc43fe09fd7d8f8034c;p=emacs.git * lisp/emacs-lisp/eieio-core.el (eieio-oset-default): Catch the unexpected case where the default value would be re-interpreted as a form! --- 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 + + * 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 (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)