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:29:27 -0400 Message-ID: References: <20180721180616.6608.26581@vcs0.savannah.gnu.org> <20180721180618.5CEA9208D4@vcs0.savannah.gnu.org> <83bmb0xxcy.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1532197663 10800 195.159.176.226 (21 Jul 2018 18:27:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 21 Jul 2018 18:27:43 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 21 20:27:39 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 1fgwbR-0002gE-Vn for ged-emacs-devel@m.gmane.org; Sat, 21 Jul 2018 20:27:38 +0200 Original-Received: from localhost ([::1]:53597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgwdY-0007bn-T5 for ged-emacs-devel@m.gmane.org; Sat, 21 Jul 2018 14:29:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgwdR-0007bT-Qt for emacs-devel@gnu.org; Sat, 21 Jul 2018 14:29:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgwdO-00022p-N5 for emacs-devel@gnu.org; Sat, 21 Jul 2018 14:29:41 -0400 Original-Received: from [195.159.176.226] (port=35424 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fgwdO-00022f-FW for emacs-devel@gnu.org; Sat, 21 Jul 2018 14:29:38 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fgwbE-0002T2-Rf for emacs-devel@gnu.org; Sat, 21 Jul 2018 20:27:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 19 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:ZcQv3qLAjPN22MkHR2Omvil4eGY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:227634 Archived-At: > I don't understand your claims, sorry. Is the code wrong, or are the > comments wrong? I don't understand enough of the code to have an opinion on it, but the comments describe a behavior which would be wrong: both before-c-f and after-c-f- need to be run for any buffer change, even if it's only an insertion or only a deletion. > And what would you expect to see in the buffer > modification hooks calls for the recipe of that bug? Lots of options, but basically: one call to b-c-f with FROM being < then the first position at which a deletion or insertion will take place and TO being after the last such position (e.g. from==to if the change is a single insertion); followed by one call to a-c-f with the same constraints (e.g. from==to if it's a single deletion). Stefan