GNU bug report logs - #68114
[PATCH] Make 'advice-remove' interactive

Previous Next

Package: emacs;

Reported by: Steven Allen <steven <at> stebalien.com>

Date: Fri, 29 Dec 2023 19:58:02 UTC

Severity: wishlist

Tags: patch

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 68114 <at> debbugs.gnu.org (full text, mbox):

From: Steven Allen <steven <at> stebalien.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#68114: [PATCH] Make 'advice-remove' interactive
Date: Sat, 30 Dec 2023 08:37:48 -0800
[Message part 1 (text/plain, inline)]
Ah, I responded to the previous message before seeing this one.

> Please mention the bug number, since it is now known, in the log
> message.

Done.

> Two spaces between sentences, please.

Fixed in the first revision (d4a07757).

> Btw, what is "the 'name' of a piece of advice"?  I realize that this
> text was there to begin with, but I don't think I understand what it
> wants to tell me, so maybe we could clarify that.  The only reference
> to a "name" in the preceding text uses "name" to mean a symbol, but
> then what is "the name of a piece of advice"?  I guess this goes back
> to define-advice, which says:
>
>   @defmac define-advice symbol (where lambda-list &optional name depth) &rest body
>   This macro defines a piece of advice and adds it to the function named
>   @var{symbol}.  The advice is an anonymous function if @var{name} is
>   @code{nil} or a function named @code{symbol@@name}.  See
>   @code{advice-add} for explanation of other arguments.
>
> which is also a bit mysterious.  Does NAME used here serve as "the
> name of the piece of advice"? if so, should "@code{symbol@@name}" be
> "@code{symbol@@@var{name}}" instead, i.e. "name" is not a literal
> string but the reference to NAME?

So, those two names are actually different. The 'name' in referenced in
the `advice-remove` documentation is the 'name in the advice's 'props'
alist. The 'name' specified in `define-advice` is _not_ added to this
alist and is only used in the advice's function name.

I'm happy to resolve this in a separate patch, if that's OK with you.
Something like (`define-advice` documentation):

    Note if NAME is nil the advice is anonymous; otherwise the advice
    function is named `SYMBOL <at> NAME' and the advice is named NAME.

Then actually add NAME to the properties.

> I wonder whether "Remove advice from function: " would be a better
> prompt.

Good point, done!

> And here I wonder whether "Advice to remove: " would be a better
> prompt.

Also done.

[Message part 2 (text/x-patch, attachment)]

This bug report was last modified 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.