summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2012-10-26 14:01:30 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2012-10-26 14:01:30 -0400
commit150f809c341e3b711a78daee528ad40f68052ce6 (patch)
tree3be73d5c60e36ac32c661b845ae10fa0dcef64b3
parent372212dff2e3d84c676dc78ff27d7a0b5ec710de (diff)
downloademacs-150f809c341e3b711a78daee528ad40f68052ce6.tar.gz
* lisp/emacs-lisp/advice.el (ad-assemble-advised-definition):
Silence bogus compiler warnings for ad-do-it.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/emacs-lisp/advice.el8
2 files changed, 8 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c43b0c136e3..7cb9fb0793c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2012-10-26 Stefan Monnier <monnier@iro.umontreal.ca>
+ * emacs-lisp/advice.el (ad-assemble-advised-definition):
+ Silence bogus compiler warnings for ad-do-it.
+
* bookmark.el (bookmark-completing-read): Set the completion category
to `bookmark' (bug#11131).
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index 007871aa3a6..bd85238e23e 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -2897,8 +2897,11 @@ definition, INTERACTIVE if non-nil is the interactive form to be used,
ORIG is a form that calls the body of the original unadvised function,
and BEFORES, AROUNDS and AFTERS are the lists of advices with which ORIG
should be modified. The assembled function will be returned."
-
- (let (before-forms around-form around-form-protected after-forms definition)
+ ;; The ad-do-it call should always have the right number of arguments,
+ ;; but the compiler might signal a bogus warning because it checks the call
+ ;; against the advertised calling convention.
+ (let ((around-form `(setq ad-return-value (with-no-warnings ,orig)))
+ before-forms around-form-protected after-forms definition)
(dolist (advice befores)
(cond ((and (ad-advice-protected advice)
before-forms)
@@ -2911,7 +2914,6 @@ should be modified. The assembled function will be returned."
(append before-forms
(ad-body-forms (ad-advice-definition advice)))))))
- (setq around-form `(setq ad-return-value ,orig))
(dolist (advice (reverse arounds))
;; If any of the around advices is protected then we
;; protect the complete around advice onion: