From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [elpa] externals/tempel 3acaf5546d: Introduce tempel--inhibit-hooks (Fix #32) Date: Sun, 13 Feb 2022 12:40:52 -0500 Message-ID: References: <164477147878.11439.5911138031827567225@vcs2.savannah.gnu.org> <20220213165759.06C78C00891@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39299"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Daniel Mendler To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 13 18:42:37 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJItQ-000A1E-RM for ged-emacs-devel@m.gmane-mx.org; Sun, 13 Feb 2022 18:42:37 +0100 Original-Received: from localhost ([::1]:38118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJItO-0001Xw-Va for ged-emacs-devel@m.gmane-mx.org; Sun, 13 Feb 2022 12:42:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJIs5-0000mS-U1 for emacs-devel@gnu.org; Sun, 13 Feb 2022 12:41:14 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:28050) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJIs2-0007Ed-Bk for emacs-devel@gnu.org; Sun, 13 Feb 2022 12:41:12 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B316A441644; Sun, 13 Feb 2022 12:41:00 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7B176440CBF; Sun, 13 Feb 2022 12:40:55 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1644774055; bh=MIlqYS6kXr5GteWdXSRxCDZCqNmpKhs+LQcgOZ9awdw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=CaZi3gErADFycbQxDwTGQTmr384ZrkY/g8vLy8CWhXKKAdjtc2o7aFDM9NPWqAGGV IDgtHX3MXc7UbIdn9ZUxp4cOQNc1dPWQBmouCu9v3adcv1G477Cc0r2wV7gQ6L45Le W5bl3EpM4rnSNPuhWdQh0JOwJrSiBZhpf6IGmw2RzltaRhBjYed9IIePj/z2Vz37Hf +9eDTrDHWLTFnWO4fGzBCxSho1N2pO8K1rjmqTk6QfZsWDu8waQmqZOuxYOZEgatlv OU18niNFWYcVot3GdEaqgqnn0DyB7g/SgWy3+lJU/9B+iMkl7DZqEQ8ojVndULKDey j4bJbu/g8VhOg== Original-Received: from pastel (unknown [45.72.237.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 16EE312050E; Sun, 13 Feb 2022 12:40:55 -0500 (EST) In-Reply-To: <20220213165759.06C78C00891@vcs2.savannah.gnu.org> (ELPA Syncer's message of "Sun, 13 Feb 2022 11:57:58 -0500 (EST)") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286222 Archived-At: 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