helpful icon indicating copy to clipboard operation
helpful copied to clipboard

Improve `Advice` section

Open nbfalcon opened this issue 3 years ago • 2 comments

  • helpful--skip-advice now works for non :around advice. This means that the docstring no longer displays any advice.
  • The Advice section no longer just says "This function is advised", but now lists the advice, one per line, with the format <clickable X to remove> :<before/after/...> <advice symbol>:
    X :before +whatever
    X :after +whatever
    

nbfalcon avatar Mar 13 '21 10:03 nbfalcon

Here is how this looks now: 20210313-120043

The buffer in the middle shows the code used to create the function with advice. defadvice! is a doom-emacs advice definition functions, and it is basically defun + advice-add (i.e. using nadvice), so this works with both kinds of advice. A limitation of the current implementation is that defadvice (the old one) advice does not display the actual advice function, but ad-Advice-. IMHO this is better addressed upstream, but I can implement better display if you wish.

nbfalcon avatar Mar 13 '21 11:03 nbfalcon

For comparison, here is how this looks in master (helpful--skip-advice` doesn't work properly): 20210313-120544

nbfalcon avatar Mar 13 '21 11:03 nbfalcon