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: Unbalanced change hooks (part 2) [Documentation fix still remaining] Date: Tue, 30 Aug 2016 12:01:22 -0400 Message-ID: References: <83inv9hkjd.fsf@gnu.org> <83h9ashfgx.fsf@gnu.org> <831t1wharr.fsf@gnu.org> <20160810161821.GB3413@acm.fritz.box> <83wpjofttf.fsf@gnu.org> <20160810185735.GD3413@acm.fritz.box> <20160811112951.GA2154@acm.fritz.box> <87a8fue656.fsf@russet.org.uk> <834m62ntqs.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1472575934 20989 195.159.176.226 (30 Aug 2016 16:52:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Aug 2016 16:52:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 30 18:52:07 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 1bemGZ-0004Um-02 for ged-emacs-devel@m.gmane.org; Tue, 30 Aug 2016 18:52:03 +0200 Original-Received: from localhost ([::1]:50214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bemGW-00006D-NG for ged-emacs-devel@m.gmane.org; Tue, 30 Aug 2016 12:52:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bemF2-00085G-GA for emacs-devel@gnu.org; Tue, 30 Aug 2016 12:50:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bemEw-0000oA-Dw for emacs-devel@gnu.org; Tue, 30 Aug 2016 12:50:28 -0400 Original-Received: from [195.159.176.226] (port=36974 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bemEw-0000nb-7c for emacs-devel@gnu.org; Tue, 30 Aug 2016 12:50:22 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1belQc-0000Z3-Eg for emacs-devel@gnu.org; Tue, 30 Aug 2016 17:58:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:zQmP8U0nphgsXcB1MDibRYf8pBw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:206963 Archived-At: > You are setting the bar impossibly high by expecting that. > Implementing what you want would need significant changes in how the > insdel functions are implemented and used. In particular, some > complex changes will probably have to do things twice: once just to > figure out which changes are needed, the other time to actually do > that while calling the hooks in the way you want. That's because in > some situations we discover the required changes as we go, and have no > idea in advance what we will find. Actually, we do have some idea beforehand, as evidenced by the fact that we call b-c-f with valid data. It's just that after the fact we have a more precise knowledge of what has actually been changed, so a-c-f can give more precise bounds. But as mentioned in some other message, the a-c-f function can itself extend its arguments to match those of the b-c-f if it needs them to be matched. We could also change the C code to perform this "extension" of the region passed to a-c-f so that the b-c-f region and the a-c-f region match, but that would make the region passed to a-c-f less precise, so those users of a-c-f which don't care about the pairing (the majority of the users) would be penalized (tho they'd still work correctly: just suboptimally) since there's no way for them to recover the tighter region. Stefan