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:42:58 +0300 Message-ID: <83fupmm9ul.fsf@gnu.org> References: <20160811112951.GA2154@acm.fritz.box> <7e1478b6-cf00-fcbf-8c24-43bdaa57e2b6@dancol.org> <415d1cca-f32c-624e-a4be-9aadcf8a0f17@dancol.org> <83inujbpek.fsf@gnu.org> <20160830171222.GA6672@acm.fritz.box> <5857ab7e-e85c-c6ae-ba1a-b1337ae57f2c@dancol.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1472579060 19314 195.159.176.226 (30 Aug 2016 17:44:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Aug 2016 17:44:20 +0000 (UTC) Cc: acm@muc.de, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 30 19:44:16 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 1ben55-0004Ua-RA for ged-emacs-devel@m.gmane.org; Tue, 30 Aug 2016 19:44:15 +0200 Original-Received: from localhost ([::1]:50452 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ben53-0000Uc-FV for ged-emacs-devel@m.gmane.org; Tue, 30 Aug 2016 13:44:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ben4G-0000QQ-Lx for emacs-devel@gnu.org; Tue, 30 Aug 2016 13:43:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ben4C-0004hy-M5 for emacs-devel@gnu.org; Tue, 30 Aug 2016 13:43:24 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ben4C-0004ht-Io; Tue, 30 Aug 2016 13:43:20 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1977 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1ben49-0005bg-Jg; Tue, 30 Aug 2016 13:43:20 -0400 In-reply-to: <5857ab7e-e85c-c6ae-ba1a-b1337ae57f2c@dancol.org> (message from Daniel Colascione on Tue, 30 Aug 2016 10:27:45 -0700) 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:206978 Archived-At: > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > From: Daniel Colascione > Date: Tue, 30 Aug 2016 10:27:45 -0700 > > +The region given to each of these functions is a conservative > +approximation of the region about to changed. After running the > +before-change-functions, Emacs will make zero or more fine-grained > +buffer changes and run after-change-functions for each. Do not expect > +before-change-functions and after-change-functions to be called in > +balanced pairs. The last sentence here is repeated afterwards, for no good reason. (Also, the markup is missing, but that's just an aside.) > - Do @emph{not} expect the before-change hooks and the after-change > -hooks be called in balanced pairs around each buffer change. Also > -don't expect the before-change hooks to be called for every chunk of > -text Emacs is about to delete. These hooks are provided on the > -assumption that Lisp programs will use either before- or the > -after-change hooks, but not both, and the boundaries of the region > -where the changes happen might include more than just the actual > -changed text, or even lump together several changes done piecemeal. > + Do @emph{not} expect the before-change hooks and the after-change > +hooks be called in balanced pairs around each buffer change. > +The before-change-functions region is a conservative bound on the zero > +or more fine-grained changes to follow. Emacs informs user code about > +the actual changes to the buffer through calls to > +after-change-functions; these fine-grained changes will always fall > +inside the broad change region Emacs describes by calling > +before-change-functions. You removed the part about text deletion, which is not specific to revert-buffer, so that information is now lost. I don't want to lose it. Other than that, I don't see how your text is more accurate, it's just a different wording dancing around the same issues trying to side-step them by replacing one vague description by another. If all you want is to remove this part: These hooks are provided on the assumption that Lisp programs will use either before- or the after-change hooks, but not both then I don't necessarily mind, although I do believe it is true, and the readers should be aware of that. Thanks.