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: Unbalanced change hooks (part 2) [Documentation fix still remaining] Date: Tue, 30 Aug 2016 20:53:48 +0300 Message-ID: <83d1kqm9cj.fsf@gnu.org> References: <7e1478b6-cf00-fcbf-8c24-43bdaa57e2b6@dancol.org> <415d1cca-f32c-624e-a4be-9aadcf8a0f17@dancol.org> <83inujbpek.fsf@gnu.org> <20160830171222.GA6672@acm.fritz.box> <83inuimajv.fsf@gnu.org> <20160830174223.GB6672@acm.fritz.box> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1472579670 24200 195.159.176.226 (30 Aug 2016 17:54:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Aug 2016 17:54:30 +0000 (UTC) Cc: dancol@dancol.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 30 19:54:25 2016 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 1benEv-0005fV-0w for ged-emacs-devel@m.gmane.org; Tue, 30 Aug 2016 19:54:25 +0200 Original-Received: from localhost ([::1]:50542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1benEs-0004Vp-Nb for ged-emacs-devel@m.gmane.org; Tue, 30 Aug 2016 13:54:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1benEj-0004Tn-RR for emacs-devel@gnu.org; Tue, 30 Aug 2016 13:54:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1benEe-0007x9-RJ for emacs-devel@gnu.org; Tue, 30 Aug 2016 13:54:12 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1benEe-0007ws-OO; Tue, 30 Aug 2016 13:54:08 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1993 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1benEa-0006i9-OL; Tue, 30 Aug 2016 13:54:07 -0400 In-reply-to: <20160830174223.GB6672@acm.fritz.box> (message from Alan Mackenzie on Tue, 30 Aug 2016 17:42:24 +0000) 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:206981 Archived-At: > Date: Tue, 30 Aug 2016 17:42:24 +0000 > Cc: dancol@dancol.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org > From: Alan Mackenzie > > > Your attempt didn't describe the current implementation. It described > > what you thought it should be. > > The text in question (intended for the Elisp manual) was: > > Normally the before-change-functions and the after-change-functions > hooks are called in balanced pairs around each buffer change, enabling > state to be determined in a before-change function and used in an > after-change function. However on rare occasions, > before-change-functions is not called before a buffer change and > after-change-functions is thus called twice in succession. Your > program should be ready to deal with such an occurrence. > > The crucial part of that is the first sentence. It is true. We use "normally" in the manual to mean "always, unless changed by customizations". So the above use of that word is extremely confusing and thus a bad idea. And the part about "balanced pairs" is simply false, if "balanced" is to be interpreted in its everyday's meaning. > The second sentence is true in essence, though it possibly needs to be > made more accurate to deal with other cases. The current text is even more "true in essence", though.