From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.devel Subject: Re: Unbalanced change hooks (part 2) [Documentation fix still remaining] Date: Wed, 31 Aug 2016 12:17:00 +0100 Message-ID: <87shtl5gsz.fsf@russet.org.uk> 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> <83lgzembwt.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1472642248 18311 195.159.176.226 (31 Aug 2016 11:17:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 31 Aug 2016 11:17:28 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 31 13:17:24 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 1bf3WC-00049A-Da for ged-emacs-devel@m.gmane.org; Wed, 31 Aug 2016 13:17:20 +0200 Original-Received: from localhost ([::1]:53536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf3W9-0000sx-2w for ged-emacs-devel@m.gmane.org; Wed, 31 Aug 2016 07:17:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf3W0-0000sh-1S for emacs-devel@gnu.org; Wed, 31 Aug 2016 07:17:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bf3Vu-0001Ub-1T for emacs-devel@gnu.org; Wed, 31 Aug 2016 07:17:06 -0400 Original-Received: from cloud103.planethippo.com ([31.216.48.48]:56477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf3Vt-0001UV-Lq for emacs-devel@gnu.org; Wed, 31 Aug 2016 07:17:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=russet.org.uk; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From; bh=I0Cl31FTI0DwHamQGkHnUR6Vhazv4pcb53wuFeiJLjo=; b=GVRjwabLTpcV5LAh+D++G0RLSM 62ll9Bijc/aP/L0+7H9Nj3+3FcdbrwwCdAS+J/BFWTF3wT2s0mHnNuvrf3U1/ttK3cz1BHkz9Od+h xI9ZiQVqd9maPqlgECXahwYhSE7Wc8EIqtcNvlj7LvnPoJJRF+zVRjPq+Kl7iJDhn965+krUCOETW TJ7+U+xodzec/aGNxXfXk+z1jHGtwKIDVvyvVwF/e/9edsKHDgNOXD+AGoJypU/hmXDT5ws9ihQHf YeVpiYsBNazbIV+SiuKjhhhcQ13/djOpvrJ4Pk6LSQjhcs85SHtnlZmB6nU44bHyLiZCmVtP7tT47 UzbDCe1Q==; Original-Received: from janus-nat-128-240-225-60.ncl.ac.uk ([128.240.225.60]:51387 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_1) (envelope-from ) id 1bf3Vs-000sH0-LV; Wed, 31 Aug 2016 12:17:00 +0100 In-Reply-To: (Stefan Monnier's message of "Tue, 30 Aug 2016 13:57:31 -0400") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud103.planethippo.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - russet.org.uk X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id: phillip.lord@russet.org.uk X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@russet.org.uk X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 31.216.48.48 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:207020 Archived-At: Stefan Monnier writes: >> I was under the impression that Phillip wanted the data be accurate, >> not just valid. > > More precise (i.e. tighter bounds) is better, but valid is indispensable > (I used "valid" to mean that every change is covered by the bounds, even > though those bounds may be too lose. I consider "invalid" to be a plain > bug, as in insert-file-contents, for example). > > So I'm pretty sure he's more concerned about "proper pairing" than about > "utmost tightness of the bounds". This is exactly correct. I think in my last email I was using "valid" to mean consistent between b-c-f and a-c-f; sorry for confused terminology. > >> Because if validity is the only requirement, we could always call the >> before-change hook with the limits of the entire buffer, and be done. >> Clearly, that would not be very useful, to say the least. > > Indeed. But in the case of subst-chars-in-region, what we pass to b-c-f > is suboptimal but better than point-min/max, so there's a useful middle > point between the difficult "tightest bound" and the degenerate "just > pass point-min/max". I think you mean "painful middle point" rather than "useful"! Well, it's been on my list of things to do for a while. I will have another look at subst-char-in-region, to see if I can work out whether having b-c-f accurately signal the start is possible. Phil