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

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

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


From: Lars Ingebrigtsen
Subject: bug#33601: 26; Add macro `with-hook-added'
Date: Sat, 12 Feb 2022 09:46:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Drew Adams <drew.adams@oracle.com> 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





reply via email to

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