Subject: Re: bug#33601: 26; Add macro `with-hook-added'

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 12 Feb 2022 09:46:19 +0100

Drew Adams <[email-masked]> writes:

> Enhancement request: Please consider adding a macro such as this, to
> facilitate temporary use of a hook function.
>
> (defmacro with-hook-added (hook function &rest body)
>   "Evaluate forms in BODY with FUNCTION added to HOOK, then remove FUNCTION."
>   (declare (indent 1) (debug t))
>   `(unwind-protect (progn (add-hook ',hook ',function) ,@body)
>      (remove-hook ',hook ',function)))

I don't think this is generally useful enough, so I'm closing this bug
report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no