* lisp/emacs-lisp/eieio-core.el (eieio-oset-default): Catch the unexpected

case where the default value would be re-interpreted as a form!
This commit is contained in:
Stefan Monnier 2015-02-09 10:49:43 -05:00
parent af560cd6f1
commit 699ece2757
2 changed files with 7 additions and 0 deletions

View file

@ -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) 2015-02-09 Christopher Genovese <genovese@cmu.edu> (tiny change)
* help-fns.el (help-fns--signature): Keep doc for keymap. * help-fns.el (help-fns--signature): Keep doc for keymap.

View file

@ -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))) (signal 'invalid-slot-name (list (eieio--class-symbol class) slot)))
(eieio--validate-slot-value class c value slot) (eieio--validate-slot-value class c value slot)
;; Set this into the storage for defaults. ;; 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)) (setcar (nthcdr (- c (eval-when-compile eieio--object-num-slots))
(eieio--class-public-d class)) (eieio--class-public-d class))
value) value)