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: Mon, 01 Aug 2016 22:39:03 +0300 Message-ID: <838twgnuso.fsf@gnu.org> References: <20160731121642.GB2205@acm.fritz.box> <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> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine X-Trace: blaine.gmane.org 1470080495 16991 195.159.176.226 (1 Aug 2016 19:41:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 1 Aug 2016 19:41:35 +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 Mon Aug 01 21:41:31 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 1bUJ5f-0004GQ-83 for ged-emacs-devel@m.gmane.org; Mon, 01 Aug 2016 21:41:31 +0200 Original-Received: from localhost ([::1]:52582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUJ5b-0000Sn-MT for ged-emacs-devel@m.gmane.org; Mon, 01 Aug 2016 15:41:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUJ3t-0007vm-Tx for emacs-devel@gnu.org; Mon, 01 Aug 2016 15:39:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUJ3p-0002ED-PF for emacs-devel@gnu.org; Mon, 01 Aug 2016 15:39:40 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUJ3p-0002E2-Ln; Mon, 01 Aug 2016 15:39:37 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1702 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bUJ3k-0006lx-GE; Mon, 01 Aug 2016 15:39:35 -0400 In-reply-to: <20160801171552.GC15055@acm.fritz.box> (message from Alan Mackenzie on Mon, 1 Aug 2016 17:15:52 +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:206327 Archived-At: > Date: Mon, 1 Aug 2016 17:15:52 +0000 > Cc: ofv@wanadoo.es, rcopley@gmail.com, emacs-devel@gnu.org > From: Alan Mackenzie > > How about the following idea: we create a special purpose undo list > separate from the existing one. Every change is recorded on this list, > regardless of whether or not main undo is disabled. After each > invocation of after-change-functions the list is emptied. > > (defmacro with-change-undone (&rest forms) ...) > > An after-change-function can invoke the macro `with-change-undone' which > would undo the changes, execute the &rest forms, then redo the changes. > > Surely this would satisfy both of us, no? Sounds gross, but if this is the only way to solve this problem, and you can live with it, so can I. I do suggest to wait with conclusions for a while, perhaps a better idea will come up.