From 699ece275727be4ce452cdc43fe09fd7d8f8034c Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 9 Feb 2015 10:49:43 -0500 Subject: [PATCH] * lisp/emacs-lisp/eieio-core.el (eieio-oset-default): Catch the unexpected case where the default value would be re-interpreted as a form! --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/eieio-core.el | 2 ++ 2 files changed, 7 insertions(+) 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) -- 2.11.4.GIT