From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier 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 14:16:29 -0400 Message-ID: References: <20180721180616.6608.26581@vcs0.savannah.gnu.org> <20180721180618.5CEA9208D4@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1532196936 25157 195.159.176.226 (21 Jul 2018 18:15:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 21 Jul 2018 18:15:36 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 21 20:15:32 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 1fgwPk-0006TY-Jg for ged-emacs-devel@m.gmane.org; Sat, 21 Jul 2018 20:15:32 +0200 Original-Received: from localhost ([::1]:53549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgwRr-0001sm-Dl for ged-emacs-devel@m.gmane.org; Sat, 21 Jul 2018 14:17:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgwQk-0001rs-Ob for emacs-devel@gnu.org; Sat, 21 Jul 2018 14:16:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgwQj-0006z9-TK for emacs-devel@gnu.org; Sat, 21 Jul 2018 14:16:34 -0400 Original-Received: from pmta21.teksavvy.com ([76.10.157.36]:31480) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1fgwQg-0006wl-83; Sat, 21 Jul 2018 14:16:30 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EYAwDad1Nb/37rr2xcGgEBAQEBAgEBA?= =?us-ascii?q?QEIAQEBAYNNQoEOEo0Ji1MBgh4eAZcFCxOEUwQCAoMMIjgUAQIBAQEBAQECAgJ?= =?us-ascii?q?pKIU5BlYjEAs0BwsUGA2FV69Uik6LGIERgmMuhUqFCQKZbAmXQYVhkhUMgVgig?= =?us-ascii?q?VIzGggwgyWCTI4iI45oAQE?= X-IPAS-Result: =?us-ascii?q?A2EYAwDad1Nb/37rr2xcGgEBAQEBAgEBAQEIAQEBAYNNQoE?= =?us-ascii?q?OEo0Ji1MBgh4eAZcFCxOEUwQCAoMMIjgUAQIBAQEBAQECAgJpKIU5BlYjEAs0B?= =?us-ascii?q?wsUGA2FV69Uik6LGIERgmMuhUqFCQKZbAmXQYVhkhUMgVgigVIzGggwgyWCTI4?= =?us-ascii?q?iI45oAQE?= X-IronPort-AV: E=Sophos;i="5.51,385,1526356800"; d="scan'208";a="40074770" Original-Received: from 108-175-235-126.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([108.175.235.126]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jul 2018 14:16:29 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 286C8AE0F6; Sat, 21 Jul 2018 14:16:29 -0400 (EDT) In-Reply-To: <20180721180618.5CEA9208D4@vcs0.savannah.gnu.org> (Eli Zaretskii's message of "Sat, 21 Jul 2018 14:06:17 -0400 (EDT)") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 76.10.157.36 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:227629 Archived-At: > - 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). Stefan