From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Mon, 30 Mar 2020 22:10:34 +0300 Message-ID: <83a73x3bh1.fsf@gnu.org> References: <83o8sf3r7i.fsf@gnu.org> <2E218879-0F24-4A20-B210-263C8D0BEEA4@gmail.com> <87o8sdn0ot.fsf@gmail.com> <09E90C25-6119-44D4-85F2-A9CC4196FFE4@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="84125"; mail-complaints-to="usenet@ciao.gmane.io" Cc: akrl@sdf.org, stepnem@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 30 21:11:01 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 1jIzoL-000Ln4-Ld for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Mar 2020 21:11:01 +0200 Original-Received: from localhost ([::1]:55234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIzoK-0003Wq-Om for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Mar 2020 15:11:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52626) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIznl-0002qj-Qw for emacs-devel@gnu.org; Mon, 30 Mar 2020 15:10:26 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jIznl-000677-8q; Mon, 30 Mar 2020 15:10:25 -0400 Original-Received: from [176.228.60.248] (port=3118 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jIznk-0007hE-Ff; Mon, 30 Mar 2020 15:10:25 -0400 In-Reply-To: <09E90C25-6119-44D4-85F2-A9CC4196FFE4@gmail.com> (message from Yuan Fu on Mon, 30 Mar 2020 15:02:58 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:246061 Archived-At: > From: Yuan Fu > Date: Mon, 30 Mar 2020 15:02:58 -0400 > Cc: Štěpán Němec , > Eli Zaretskii , > emacs-devel , > Andrea Corallo > > >> (In short, `dired-readin' binds `inhibit-modification-hooks' to t, so > >> the buffer changes caused by populating dired buffers are not noticeable > >> in `after-change-functions'.) > >> I was wondering if I should report it as a bug, despite the workaround > >> not being particularly painful in this case (there's `dired-after-readin-hook'). > > > > I think it deserves a bug report, yes. > > > > > > Stefan > > > > 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.