+2013-01-07 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/advice.el (ad-activate-advised-definition): Refresh the
+ advice list when the interactive-spec of ad-Advice-* changes.
+
2013-01-07 Katsumi Yamaoka <yamaoka@jpl.org>
* wid-edit.el (widget-default-get): Work for inlined elements.
* net/tramp.el (tramp-default-host-alist): New defcustom.
(tramp-find-host): Use it.
- (tramp-eshell-directory-change): Moved from tramp-sh.el. Add to
+ (tramp-eshell-directory-change): Move from tramp-sh.el. Add to
`eshell-directory-change-hook'.
* net/tramp-adb.el (top): Add adb specific entry in
* net/tramp-adb.el (tramp-adb-ls-toolbox-regexp): The file size can
consist of more than one digit.
- (tramp-adb-file-name-handler-alist): Use
- `tramp-handle-file-exists-p' consistently.
+ (tramp-adb-file-name-handler-alist):
+ Use `tramp-handle-file-exists-p' consistently.
(tramp-adb-file-name-handler): Don't tweak `tramp-default-host'.
(tramp-adb-handle-file-exists-p): Remove function.
(tramp-adb-file-name-host): New defun.
(tramp-do-copy-or-rename-file): Ignore errors when calling
`set-file-extended-attributes'.
- * net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add
- handler for `file-acl'.
+ * net/tramp-smb.el (tramp-smb-file-name-handler-alist):
+ Add handler for `file-acl'.
(tramp-smb-handle-file-acl): New defun.
2013-01-02 Jay Belanger <jay.p.belanger@gmail.com>
"Redefine FUNCTION with its advised definition from cache or scratch.
The resulting FUNCTION will be compiled if `ad-should-compile' returns t.
The current definition and its cache-id will be put into the cache."
- (let ((verified-cached-definition
- (if (ad-verify-cache-id function)
- (ad-get-cache-definition function)))
- (advicefunname (ad-get-advice-info-field function 'advicefunname)))
+ (let* ((verified-cached-definition
+ (if (ad-verify-cache-id function)
+ (ad-get-cache-definition function)))
+ (advicefunname (ad-get-advice-info-field function 'advicefunname))
+ (old-ispec (interactive-form advicefunname)))
(fset advicefunname
(or verified-cached-definition
(ad-make-advised-definition function)))
+ (unless (equal (interactive-form advicefunname) old-ispec)
+ ;; If the interactive-spec of advicefunname has changed, force nadvice to
+ ;; refresh its copy.
+ (advice-remove function advicefunname))
(advice-add function :around advicefunname)
(if (ad-should-compile function compile)
(ad-compile-function function))
(lambda (f &rest args)
(cons (cons 2 (called-interactively-p)) (apply f args))))
(should (equal (call-interactively 'sm-test7) '((2 . t) (1 . t) 11)))
+
+ ;; Check handling of interactive spec.
+ (defun sm-test8 (a) (interactive "p") a)
+ (defadvice sm-test8 (before adv1 activate) nil)
+ (defadvice sm-test8 (before adv2 activate) (interactive "P") nil)
+ (should (equal (interactive-form 'sm-test8) '(interactive "P")))
))
;; Local Variables: