unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [elpa] externals/tempel 3acaf5546d: Introduce tempel--inhibit-hooks (Fix #32)
       [not found] ` <20220213165759.06C78C00891@vcs2.savannah.gnu.org>
@ 2022-02-13 17:40   ` Stefan Monnier
  0 siblings, 0 replies; only message in thread
From: Stefan Monnier @ 2022-02-13 17:40 UTC (permalink / raw)
  To: emacs-devel; +Cc: Daniel Mendler

Hi Daniel,

> +(defmacro tempel--inhibit-hooks (&rest body)
> +  "Inhibit tempel hooks from running in BODY.
> +We don't use `inhibit-modification-hooks' since this also prevents hooks
> +from other packages from running."
> +  (declare (indent 0))
> +  `(cl-letf (((symbol-function #'tempel--field-modified) #'ignore)
> +             ((symbol-function #'tempel--range-modified) #'ignore))
> +     ,@body))

Just curious here: why use this instead of a (defvar
tempel--inhibit-hooks nil) and then let-binding it where appropriate and
testing it in `tempel--field/range-modified`?


        Stefan




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-13 17:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <164477147878.11439.5911138031827567225@vcs2.savannah.gnu.org>
     [not found] ` <20220213165759.06C78C00891@vcs2.savannah.gnu.org>
2022-02-13 17:40   ` [elpa] externals/tempel 3acaf5546d: Introduce tempel--inhibit-hooks (Fix #32) Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).