emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110903: * lisp/emacs-lisp/advice.el


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110903: * lisp/emacs-lisp/advice.el (ad-definition-type): Make sure we don't use
Date: Wed, 14 Nov 2012 23:42:14 -0500
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110903
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2012-11-14 23:42:14 -0500
message:
  * lisp/emacs-lisp/advice.el (ad-definition-type): Make sure we don't use
  a preactivated advice from an old advice.el; they're not compatible!
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/advice.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-11-15 03:30:25 +0000
+++ b/lisp/ChangeLog    2012-11-15 04:42:14 +0000
@@ -1,3 +1,8 @@
+2012-11-15  Stefan Monnier  <address@hidden>
+
+       * emacs-lisp/advice.el (ad-definition-type): Make sure we don't use
+       a preactivated advice from an old advice.el; they're not compatible!
+
 2012-11-15  Katsumi Yamaoka  <address@hidden>
 
        * emacs-lisp/nadvice.el (advice--make-interactive-form):

=== modified file 'lisp/emacs-lisp/advice.el'
--- a/lisp/emacs-lisp/advice.el 2012-11-15 03:30:25 +0000
+++ b/lisp/emacs-lisp/advice.el 2012-11-15 04:42:14 +0000
@@ -2239,16 +2239,15 @@
 
 (defun ad-definition-type (definition)
   "Return symbol that describes the type of DEFINITION."
+  ;; These symbols are only ever used to check a cache entry's validity.
+  ;; The suffix `2' reflects the fact that we're using version 2 of advice
+  ;; representations, so cache entries preactivated with version
+  ;; 1 can't be used.
   (cond
-   ((ad-macro-p definition) 'macro)
-   ((ad-subr-p definition)
-    (if (special-form-p definition)
-        'special-form
-      'subr))
-   ((or (ad-lambda-p definition)
-        (ad-compiled-p definition))
-    'function)
-   ((ad-advice-p definition) 'advice)))
+   ((ad-macro-p definition) 'macro2)
+   ((ad-subr-p definition) 'subr2)
+   ((or (ad-lambda-p definition) (ad-compiled-p definition)) 'fun2)
+   ((ad-advice-p definition) 'advice2))) ;; FIXME: Can this ever happen?
 
 (defun ad-has-proper-definition (function)
   "True if FUNCTION is a symbol with a proper definition.


reply via email to

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