From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Tue, 31 Mar 2020 16:57:53 -0800 Message-ID: <86pncshvji.fsf@stephe-leake.org> References: <83o8sf3r7i.fsf@gnu.org> <2E218879-0F24-4A20-B210-263C8D0BEEA4@gmail.com> <87o8sdn0ot.fsf@gmail.com> <09E90C25-6119-44D4-85F2-A9CC4196FFE4@gmail.com> <83a73x3bh1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="97844"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (windows-nt) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 01 02:58:36 2020 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 1jJRiG-000PN9-99 for ged-emacs-devel@m.gmane-mx.org; Wed, 01 Apr 2020 02:58:36 +0200 Original-Received: from localhost ([::1]:45592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJRiF-0006Q6-AX for ged-emacs-devel@m.gmane-mx.org; Tue, 31 Mar 2020 20:58:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35355) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJRhi-000613-0v for emacs-devel@gnu.org; Tue, 31 Mar 2020 20:58:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJRhe-0000CU-RW for emacs-devel@gnu.org; Tue, 31 Mar 2020 20:58:00 -0400 Original-Received: from gateway20.websitewelcome.com ([192.185.63.14]:41340) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jJRhe-00008w-9Z for emacs-devel@gnu.org; Tue, 31 Mar 2020 20:57:58 -0400 Original-Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id E94E4400D8295 for ; Tue, 31 Mar 2020 18:41:50 -0500 (CDT) Original-Received: from host2007.hostmonster.com ([67.20.76.71]) by cmsmtp with SMTP id JRhcjoIbZVQh0JRhdj19kY; Tue, 31 Mar 2020 19:57:57 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stephe-leake.org; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:To:From:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gBT1dNrsoY03ScIhMHDQEm8AmiIjBcT6pfpEefw2C5E=; b=I6RhfPM2wUCUbpraERCG1VwsD xgn/wUHfJBnp64AzcVNjSUkxzOcERBCD5tMy7OZStzCZTYdDN2q/LZmGaIkI7w8UVWhYt9oxmBw8E xrTPNvpOaVA0JJcMXusC8lzhXWI4ZxGa2o5ZoMvfZRhjYf9mlIdQ7FTEXWLCLA2na4Idx1/N2aAJq v910w3Yw432NRH78zRHaZPYY5nwta2aqhKO6jRzOY8ljROzKcbkjb+oO5ao8eOM4Y24p5nGmdxHPa qTqUf4Xa2Td3vzhV2R3owygnmO8SKyF/2+2m5816HN+KDQW2eN3P6eROii9KVeLX2EgwBhnvVuOn4 JWI7ufUBg==; Original-Received: from [76.77.182.20] (port=61873 helo=Takver4) by host2007.hostmonster.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jJRhc-003LdB-JW for emacs-devel@gnu.org; Tue, 31 Mar 2020 18:57:56 -0600 In-Reply-To: <83a73x3bh1.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 30 Mar 2020 22:10:34 +0300") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host2007.hostmonster.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stephe-leake.org X-BWhitelist: no X-Source-IP: 76.77.182.20 X-Source-L: No X-Exim-ID: 1jJRhc-003LdB-JW X-Source-Sender: (Takver4) [76.77.182.20]:61873 X-Source-Auth: stephen_leake@stephe-leake.org X-Email-Count: 8 X-Source-Cap: c3RlcGhlbGU7c3RlcGhlbGU7aG9zdDIwMDcuaG9zdG1vbnN0ZXIuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 192.185.63.14 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:246169 Archived-At: Eli Zaretskii writes: >> Is it really a bug of dired-mode? Dired-mode probably has a good >> reason to bind `inhibit-modification-hooks` to t. And if we provide >> such feature (disabling after-change-functions), we should expect >> people using it. Maybe there should be a reliable way to be informed >> of buffer changes (that cannot be silenced). > > I agree with Stefan: it's a bug. All dired-readin needs to do is call > the modification hooks after it's done reading in the directory. It's > just an optimization that it inhibits the hooks while it runs: read > the comments there and you will see why it is done. > > IMO, inhibit-modification-hooks is for when some code makes a > temporary change, or a change that no one is supposed to care about, > like changing faces. Any other case is a bug. ada-mode occasionally binds wisi-inhibit-parse for a similar reason; it is writing Ada source, so it is about to make several changes, during which the buffer will be syntactically incorrect, but it will be correct when done. The wisi after-change-functions still record changed regions, but the parser is not called until all the changes are done. Perhaps tree-sitter and eglot could use a similar approach. -- -- Stephe