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: Lisp primitives and their calling of the change hooks Date: Fri, 05 Jan 2018 08:55:20 +0200 Message-ID: <838tdcbxrb.fsf@gnu.org> References: <20180103124543.GA5435@ACM> <20180104155111.GB6846@ACM> <20180104211154.GC6846@ACM> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1515135242 14479 195.159.176.226 (5 Jan 2018 06:54:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 5 Jan 2018 06:54:02 +0000 (UTC) Cc: 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 Fri Jan 05 07:53:58 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 1eXLt7-0003DN-GR for ged-emacs-devel@m.gmane.org; Fri, 05 Jan 2018 07:53:57 +0100 Original-Received: from localhost ([::1]:50816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXLv3-0003Zq-Dn for ged-emacs-devel@m.gmane.org; Fri, 05 Jan 2018 01:55:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXLup-0003Xo-4E for emacs-devel@gnu.org; Fri, 05 Jan 2018 01:55:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXLuk-0001xm-5z for emacs-devel@gnu.org; Fri, 05 Jan 2018 01:55:43 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXLuj-0001x6-SQ; Fri, 05 Jan 2018 01:55:37 -0500 Original-Received: from [176.228.60.248] (port=4104 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eXLuj-0006HN-4f; Fri, 05 Jan 2018 01:55:37 -0500 In-reply-to: <20180104211154.GC6846@ACM> (message from Alan Mackenzie on Thu, 4 Jan 2018 21:11:54 +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:221609 Archived-At: > Date: Thu, 4 Jan 2018 21:11:54 +0000 > From: Alan Mackenzie > Cc: emacs-devel@gnu.org > > The primitives which atomically insert or delete a contiguous chunk > of text into or from a buffer will call `before-change-functions' > and `after-change-functions' in balanced pairs, once for each > change. The arguments to these hooks will exactly delimit the > change being made. Calls to these primitives comprise the vast bulk > of buffer changes. > > Other, more complex primitives aim to call `before-change-functions' > once before making any changes, then to call > `after-change-functions' zero, one, or several times, depending on > how many individual changes the primitive makes. The `BEG' and > `END' arguments to `before-change-functions' will enclose a region > in which the individual changes are made, but won't necessarily be > the minimal such region. The `BEG', `END', and `OLD-LEN' arguments > to each successive call of `after-change-functions' will accurately > delimit the current change. How will the reader know to distinguish between these two classes of primitives? Without such an ability, the extra accuracy in this text is not useful.