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) Date: Tue, 02 Aug 2016 19:42:37 +0300 Message-ID: <83invjm8aq.fsf@gnu.org> References: <83a8gxq288.fsf@gnu.org> <20160731172804.GD2205@acm.fritz.box> <834m75ptij.fsf@gnu.org> <20160731212635.GF2205@acm.fritz.box> <83shuoocwp.fsf@gnu.org> <20160801165323.GB15055@acm.fritz.box> <20160801171552.GC15055@acm.fritz.box> <838twgnuso.fsf@gnu.org> <20160801205223.GD15055@acm.fritz.box> <83ziovmdrh.fsf@gnu.org> <20160802160913.GB2328@acm.fritz.box> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1470156194 23671 195.159.176.226 (2 Aug 2016 16:43:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 2 Aug 2016 16:43:14 +0000 (UTC) Cc: ofv@wanadoo.es, rcopley@gmail.com, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 02 18:43:11 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 1bUcmZ-0005ce-5d for ged-emacs-devel@m.gmane.org; Tue, 02 Aug 2016 18:43:07 +0200 Original-Received: from localhost ([::1]:57722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUcmV-00061O-RC for ged-emacs-devel@m.gmane.org; Tue, 02 Aug 2016 12:43:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUcmP-0005yl-2X for emacs-devel@gnu.org; Tue, 02 Aug 2016 12:42:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUcmK-0007fb-RB for emacs-devel@gnu.org; Tue, 02 Aug 2016 12:42:55 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUcmK-0007fX-O8; Tue, 02 Aug 2016 12:42:52 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2543 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bUcmI-0006zO-OT; Tue, 02 Aug 2016 12:42:51 -0400 In-reply-to: <20160802160913.GB2328@acm.fritz.box> (message from Alan Mackenzie on Tue, 2 Aug 2016 16:09:14 +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:206358 Archived-At: > Date: Tue, 2 Aug 2016 16:09:14 +0000 > Cc: ofv@wanadoo.es, rcopley@gmail.com, emacs-devel@gnu.org > From: Alan Mackenzie > > > What I don't get is why do you need to look at the deleted text. The > > after-change-functions called after deletion tells you which buffer > > positions were removed, so any data CC Mode holds in its caches about > > those positions should be discarded. Why do you need to actually look > > at the removed text itself? What am I missing? > > Things are cached in text properties on the text itself. These > properties can only be examined before the text is deleted. OK, so you must also have code that computes and places those properties, right? What triggers that code? E.g., when a file is visited, what invokes that code, and how much of the buffer it processes when invoked? If it doesn't process the entire buffer in one go, how is it invoked to process the rest of the buffer? > > Regarding the proposal itself, undoing arbitrary changes might be > > expensive, both CPU- and memory-wise. > > It might. But what are the alternatives? I don't know yet. That's why I asked the questions above. Thanks.