emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 699ece2: * lisp/emacs-lisp/eieio-core.el (eieio-ose


From: Stefan Monnier
Subject: [Emacs-diffs] master 699ece2: * lisp/emacs-lisp/eieio-core.el (eieio-oset-default): Catch the unexpected
Date: Mon, 09 Feb 2015 15:49:53 +0000

branch: master
commit 699ece275727be4ce452cdc43fe09fd7d8f8034c
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * 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(+), 0 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9ca0c30..d902498 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-09  Stefan Monnier  <address@hidden>
+
+       * 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  <address@hidden>  (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 fa8fefa..e71c54d 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]