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 #26 received at 68114 <at> debbugs.gnu.org (full text, mbox):

From: Steven Allen <steven <at> stebalien.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 68114 <at> debbugs.gnu.org
Subject: Re: bug#68114: [PATCH] Make 'advice-remove' interactive
Date: Sat, 30 Dec 2023 08:22:04 -0800
[Message part 1 (text/plain, inline)]
> You should include the default in the prompt using `format-prompt`.
>
>> +     (advice-mapc (lambda (f _) (push (cons (prin1-to-string f) f) advice)) symbol)

Fixed. I also:

- Broke the large `completing-read` call into multiple let bindings.
- Made sure that the default value was actually advised before
  suggesting it.

> The var name `advice` suggests it holds a single piece of advice.
> I'd call it `advices` instead.

Fixed

> Also, some advice's functions are lambda expressions (i.e. closures)
> which can be rather ugly/unwieldy when printed.  When code expects to
> remove them, we usually provide a `name` property for them, so I suggest
> that you use something like

Fixed, although I noticed a few oddities (commented in the code to avoid
confusing future readers).

Basically

1. 'name' can be either a string or a symbol, but they're not considered
the same name.
2. The same advice can be applied multiple times with different names,
so I changed the code to select the advice's 'name' instead of the
advice itself, if named.

> I suspect you want to `require-match` in the `completing-read` call.

Fixed.

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

This bug report was last modified 151 days ago.

Previous Next


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