defadvice
最近(几天)在 Emacs bzr 中的更改在使用与以前版本的 Emacs 一起工作的代码中引发了一个非常奇怪的错误。通常我会得到例如
Debugger entered--Lisp error: (wrong-type-argument symbolp #[(file newname &optional ok-if-already-exists)
...
ad-activate(rename-file nil)
当尝试加载例如的编译版本时
(defadvice rename-file (around sync-ectags-rename-file (file newname &optional ok-if-already-exists) activate)
"Update ectags for renaming of FILE to NEWNAME."
(ectags-unregister-tag-file file)
ad-do-it
(ectags-register-tag-file newname))
然而,使用上述评估表达式C-x C-e
工作正常。我已经尝试了几个小时来找出问题所在,但没有运气。在我建议函数的其他几种情况下也会出现类似的问题。