GNU bug report logs - #33601
26; Add macro `with-hook-added'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Mon, 3 Dec 2018 18:48:02 UTC

Severity: wishlist

Tags: wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: Phil Sainty <psainty <at> orcon.net.nz>
Cc: 33601 <at> debbugs.gnu.org
Subject: bug#33601: 26; Add macro `with-hook-added'
Date: Mon, 3 Dec 2018 23:51:44 +0000 (UTC)
> > The real question is whether such a macro is useful.
> > I think it can be.  I gave a couple examples in bug
> > #33595.  It was those examples that made me think
> > such a macro might be useful.
> 
> I certainly think it can be useful.
> 
> On a couple of occasions I've used code which does a similar thing
> with advice -- adding temporary advice, running a body, and removing
> the advice again.
> 
> In both cases one could argue for a more persistent hook or advice
> which performs its own check to see whether it should do things, but
> that might also entail writing a new wrapper to perform the test, so
> there's appeal in a with-* approach (particularly for things which are
> wanted only very occasionally).

Yes to all that.  A propos, I don't think advice (even
nadvice) replaces the special utility of a hook, for
reasons similar to those I gave in bug #33595 for why
a hook is handier for that use case than is using
`:exit-function' on `completion-extra-properties'.

Each such function behavior-modifying tool has a
purpose, even if sometimes they can substitute for
each other.




This bug report was last modified 3 years and 157 days ago.

Previous Next


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