summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/advice.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2012-11-14 23:42:14 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2012-11-14 23:42:14 -0500
commit1232d6c2e4c41cc5c3296058a3750a662aaab2a1 (patch)
treea9e863a7e7be90ea14d01cfc11299bcde8aaa601 /lisp/emacs-lisp/advice.el
parent47f01a8af9660c018cafa3a97632c8bcb2417cec (diff)
downloademacs-1232d6c2e4c41cc5c3296058a3750a662aaab2a1.tar.gz
* 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!
Diffstat (limited to 'lisp/emacs-lisp/advice.el')
-rw-r--r--lisp/emacs-lisp/advice.el17
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index b99e614bec5..60c1a846a79 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -2239,16 +2239,15 @@ definition (see the code for `documentation')."
(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.