bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6892: Please add a way to jump to advices


From: Stefan Monnier
Subject: bug#6892: Please add a way to jump to advices
Date: Mon, 09 May 2022 12:50:22 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
>
> This seems to still be the case with advice-add:
>
> (defun bar ()
>   (interactive)
>   (forward-line 1))
>
> (advice-add 'bar :before (lambda () (forward-line 1)))

But it should work if you do

    (advice-add 'bar :before #'bar--skip-line)
    (defun bar--skip-line () (forward-line 1))

> I'm sure this has come up before -- does advice add no pointers (to
> load-history, I guess?) that the help system could pick up?

`define-advice` could, but `advice-add` is definitely not limited to
uses at top-level, so it shouldn't mess with `load-history`.


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]