From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Lower-level change hook immune to with-silent-modifications Date: Fri, 17 Jun 2022 08:28:35 +0300 Message-ID: <83sfo3q2nw.fsf@gnu.org> References: <2c2746e5f2558a87e8eab6f0914264a020173a9d.camel@pm.me> <27630AA3-8026-4E24-8852-ACCD9325B99D@gmail.com> <0E9E702B-B07C-4794-8498-29B9320E14CC@gmail.com> <871qvorqvv.fsf@localhost> <5D6F74DB-79C2-4D7E-B830-B529C3A5CD16@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23774"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, yantar92@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 17 07:30:30 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 1o24Yw-00063B-7J for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Jun 2022 07:30:30 +0200 Original-Received: from localhost ([::1]:41690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o24Yu-0006jy-Pp for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Jun 2022 01:30:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o24XA-00060I-66 for emacs-devel@gnu.org; Fri, 17 Jun 2022 01:28:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56754) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o24X9-0003a4-T9; Fri, 17 Jun 2022 01:28:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=QIccyPYvSd2e8Yjnn+Iqu7EoaLynohUfcinN5FhhiD4=; b=pfMe4Ti0p/fpFB1bZooG ZFSKX4tbBULDvVMWMMxLnlGLzZELM13I9EVu3evmuqw0NAQcTJtcmPpJStBrUM7+8QNllOdUjI1yF YxmVrZcW/M8k+g7sLbnQ4Cw77mBQ/ZNRKFETu71aKFdmZ0osqV/Cs++TjDYS+CSqdi9H9Se+R9JCq 0WdXMsq5AZCE+7kaq6aEpmqAhuqusLKj0h4Qgi053GTqfzw4mbliFAkeu5hL4AF2N+Zx0pVPeyZ1N JwOiVDADH7cbEqfUMh4H/GcjyqqFKV36gC/9S9+N9V20SI2D4k+AXAieghZIxENeHqAeH42qrsmNk leGxyaKLKRhcdA==; Original-Received: from [87.69.77.57] (port=3941 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o24X9-00048D-A1; Fri, 17 Jun 2022 01:28:39 -0400 In-Reply-To: (message from Stefan Monnier on Thu, 16 Jun 2022 22:55:50 -0400) 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:291267 Archived-At: > From: Stefan Monnier > Cc: Ihor Radchenko , Emacs Devel > Date: Thu, 16 Jun 2022 22:55:50 -0400 > > > I think you probably want a separate hook just for this purpose, rather than > > repurposing ts_record_change. We could have a lower-level > > after-change-functions that is immune to with-silent-modifications. Whether > > we should add such hook is probably another discussion. (So I opened a new > > thread.) I think it will be handy, but I don’t know that problem it > > might cause. > > As I just argued in bug#51766, I don't think it makes sense to try to > have such "a lower-level after-change-functions that is immune to > with-silent-modifications". I tend to agree. We can discuss the specific needs that triggered that request, but by and large, we have a good reason to have inhibit-modification-hooks that affects any Lisp program that wants to know about buffer modifications. That's the difference between the Lisp level and the lower-level code in C, which "knows everything", including when it isn't safe to use some data or some objects.