From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: Unbalanced change hooks (part 2) [Documentation fix still remaining] Date: Mon, 29 Aug 2016 19:26:23 -0700 Message-ID: <80571be7-97d0-50d2-ead4-faf6157c2f43@dancol.org> References: <20160810161821.GB3413@acm.fritz.box> <83wpjofttf.fsf@gnu.org> <20160810185735.GD3413@acm.fritz.box> <20160811112951.GA2154@acm.fritz.box> <7e1478b6-cf00-fcbf-8c24-43bdaa57e2b6@dancol.org> <415d1cca-f32c-624e-a4be-9aadcf8a0f17@dancol.org> <83inujbpek.fsf@gnu.org> <83eg57bl8f.fsf@gnu.org> <5ee6ff4a-2d58-82f1-8e83-479c62f0b729@dancol.org> <837fazbjb4.fsf@gnu.org> <75100b15-d49f-5a1a-d73b-24db77c891bf@dancol.org> <831t17bged.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1472524033 28974 195.159.176.226 (30 Aug 2016 02:27:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Aug 2016 02:27:13 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 Cc: emacs-devel@gnu.org To: Stefan Monnier , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 30 04:27:09 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 1beYlY-00075K-W6 for ged-emacs-devel@m.gmane.org; Tue, 30 Aug 2016 04:27:09 +0200 Original-Received: from localhost ([::1]:46579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beYlW-0003I6-Hu for ged-emacs-devel@m.gmane.org; Mon, 29 Aug 2016 22:27:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beYl0-0003I0-Ua for emacs-devel@gnu.org; Mon, 29 Aug 2016 22:26:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1beYkw-0006Ao-Pb for emacs-devel@gnu.org; Mon, 29 Aug 2016 22:26:33 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:43536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beYkw-0006Ai-E8 for emacs-devel@gnu.org; Mon, 29 Aug 2016 22:26:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject; bh=BiKQt7Qbg9pb14xiRgcBiVlpnn7hbbOKutusPvW2e0w=; b=L3WWal6kHfn99LwM2J67LGEDseyJT9zvY0ASb+UsqXViUIy6iZLLwL3B/o1mHEivhGFnI/CbR6E8totVbS7kR5ArXP829oEcn+emIOTI0Hdftt41Zg/X8ImM3+0t6OPsrF6WxVjxY0zfvbwvUmSn+9KCbKGbbOsb85ZKRPbMqudwRXhX+tO409Ea1qdrjCbHkOuFcOGtT/tgENoLHc5oOSArtu+3xOFjo7B1mGN0AcPlt4xpWjZMmnz2QJbd9QGJclZuf+AkNxSIEI2DdhLCPp2V7TJPmBQSNFcV1wsMfL7rNWHHq705ZUI736bCsUwCHUfOI5qeqm90r4IxlO1z1w==; Original-Received: from c-73-97-199-232.hsd1.wa.comcast.net ([73.97.199.232] helo=[192.168.1.173]) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1beYkt-0001Jw-8f; Mon, 29 Aug 2016 19:26:27 -0700 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 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:206911 Archived-At: On 08/29/2016 05:25 PM, Stefan Monnier wrote: >> So, while I agreed that #1 should probably be fixed, and even >> suggested how to do that in the least risky way, actually doing that >> is not a priority, IMO, not until we have a very grave problem caused >> by it. > > FWIW, I think it's important to fix the insert-file-contents case. > It breaks syntax-ppss, for example, although for various reasons of how > syntax-ppss is implemented and used, this happens to rarely show up. > [ So, yes, it's not top priority, but it should still be fixed. ] Agreed. > >>> #1 breaks the entire b-c-f model --- "hey, I'm about to modify the >>> buffer, so throw away caches" ---- and can lead to anything with a >>> cache flush in b-c-f (like syntax-ppss) not properly discarding >>> out-of-date buffer information. >> That single case of #1 is revert-buffer, which conceptually throws >> away the entire buffer and replaces it with what's on disk. That it >> actually keeps portions of the buffer is an optimization, but the >> concept still stands. So I don't see how it breaks the entire model, >> at least not in practice. > > The optimization is beside the point: not calling b-c-f in some corner > case breaks the entire model because a user such as syntax-ppss relies > on b-c-f to know when to flush its cache, so if you don't call it when > the buffer is modified, the cache ends up stale. > Yes. That's what I meant. If you don't do this, b-c-f becomes practically useless.