How can I locate the defadvice for an advised function in Emacs?

大兔子大兔子 提交于 2019-12-07 11:05:12

问题


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.


回答1:


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)


来源:https://stackoverflow.com/questions/10967367/how-can-i-locate-the-defadvice-for-an-advised-function-in-emacs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!