From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-26 671dc5a: Fix calls to buffer modification hooks from replace-buffer-contents Date: Sat, 21 Jul 2018 21:22:21 +0300 Message-ID: <83bmb0xxcy.fsf@gnu.org> References: <20180721180616.6608.26581@vcs0.savannah.gnu.org> <20180721180618.5CEA9208D4@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1532197227 13475 195.159.176.226 (21 Jul 2018 18:20:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 21 Jul 2018 18:20:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 21 20:20:23 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgwUQ-0003PB-Hj for ged-emacs-devel@m.gmane.org; Sat, 21 Jul 2018 20:20:22 +0200 Original-Received: from localhost ([::1]:53573 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgwWX-0004in-HR for ged-emacs-devel@m.gmane.org; Sat, 21 Jul 2018 14:22:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgwWM-0004hy-A0 for emacs-devel@gnu.org; Sat, 21 Jul 2018 14:22:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgwWJ-0008Rh-4y for emacs-devel@gnu.org; Sat, 21 Jul 2018 14:22:22 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgwWJ-0008Rc-0n; Sat, 21 Jul 2018 14:22:19 -0400 Original-Received: from [176.228.60.248] (port=3366 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fgwWI-0001gS-FG; Sat, 21 Jul 2018 14:22:18 -0400 In-reply-to: (message from Stefan Monnier on Sat, 21 Jul 2018 14:16:29 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:227632 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii > Date: Sat, 21 Jul 2018 14:16:29 -0400 > > > - prepare_to_modify_buffer (from, to, NULL); > > + /* If k >= l, it means nothing needs to be deleted. */ > > + if (k < l) > > + prepare_to_modify_buffer (from, to, NULL); > > This comment makes it sound like before-change-functions won't be run > when there are only insertions (which would be wrong). > > > - signal_after_change (from, to - from, updated_to - from); > > - update_compositions (from, updated_to, CHECK_INSIDE); > > + /* Only call after-change-functions if something was actually > > + inserted. */ > > + if (from < updated_to) > > + { > > + signal_after_change (from, to - from, updated_to - from); > > + update_compositions (from, updated_to, CHECK_INSIDE); > > + } > > And this comment makes it sound like after-change-functions won't be run > when there are only deletions (which would be similarly wrong). I don't understand your claims, sorry. Is the code wrong, or are the comments wrong? And what would you expect to see in the buffer modification hooks calls for the recipe of that bug?