When a function documentation page tells me that a function has advice, is there any way to find out where that piece of advice is defined? This is advice that was created using the defadvice
facility. I was eventually able to find it by grepping defadvice the-func-name
in all lisp folders, but is there a more direct way to locate a given defadvice
statement?
Asked
Active
Viewed 178 times
1

nispio
- 8,225
- 2
- 36
- 74
C-h f the-func-name
, doesn't the*Help*
output give you a link to the advice? If you follow that link, does it tell you where that advice is defined? Unfortunately, sometimes the*Help*
is less helpful than it used to be, and it won't show you the file name but will just say, for example, "ad-Advice-THE-ADVICE-NAME is a compiled Lisp function.". – Drew Apr 22 '16 at 19:08add-advice
and one withdefadvice
. The*Help*
output for the first piece of advice does have a link to the file, but the second one (the one usingdefadvice
) just says that it "is a compiled Lisp function," like you mentioned. – nispio Apr 22 '16 at 19:16defadvice
statements (although I possibly didn't make use of advice prior to Emacs 23). If it's your own code, write useful docstrings for it to make it easy to find. Otherwise I've always resorted torgrep
to find them. – phils Apr 23 '16 at 06:33