如何在Emacs中找到建议功能的defadvice? [英] How can I locate the defadvice for an advised function in Emacs?
问题描述
当我查看开始的defen
的文档时,有一个注释:
建议使用此功能。
周围建议`参议员':
向后移动到defun的开头。
如果语义标签可用,请使用它们进行导航。
然而,我找不到在哪个.el文件中调用了defadvice。有没有办法导航到原始文件,在哪里定义了建议?
编辑虽然我标记了Phil的建议rgrep .el文件,我仍然希望,有一些更优雅的方式追溯到defadvice。
因为我知道没有办法导航到 defadvice
表达式的位置(我很高兴被证明是错误的)。
这应该可以跟踪它:
Mx rgrep
RET (defadvice'start-of-defun
RET *。el
RET 〜/ .emacs.d /
RET
/ p>(或者不这样,site-lisp目录将是下一个地方)
您还可以查看这样的建议数据结构(但是这个不包括您要查找的信息)。
(ad-get-advice-info'start-of-defun)
When I view documentation for beginning-of-defun
, there is a note:
This function is advised.
Around-advice `senator':
Move backward to the beginning of a defun.
If semantic tags are available, use them to navigate.
However I can't find in which .el file the defadvice is called. Is there any way to navigate to the original file, where the advice is defined?
Edit: While i marked correct Phils' suggestion to rgrep the .el files, i still hope, that there is some more elegant way to trace back to the defadvice.
As far as I know there is no way to navigate to the location of a defadvice
expression (I'd be delighted to be proved wrong).
This should presumably track it down:
M-x rgrep
RET (defadvice 'beginning-of-defun
RET *.el
RET ~/.emacs.d/
RET
(or failing that, the site-lisp directory would be the next place to look)
You can also view the advice data structure like this (but this doesn't include the information you're looking for).
(ad-get-advice-info 'beginning-of-defun)
这篇关于如何在Emacs中找到建议功能的defadvice?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!