From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Toby Cubitt Newsgroups: gmane.emacs.devel Subject: Re: Integration of undo-tree in Emacs Date: Thu, 29 May 2014 18:42:10 +0100 Message-ID: <20140529174210.GA19232@c3po.maths.private.cam.ac.uk> References: Reply-To: Toby Cubitt NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1401385358 20763 80.91.229.3 (29 May 2014 17:42:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 May 2014 17:42:38 +0000 (UTC) Cc: Barry OReilly , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 29 19:42:32 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wq4LW-0002X6-Hg for ged-emacs-devel@m.gmane.org; Thu, 29 May 2014 19:42:30 +0200 Original-Received: from localhost ([::1]:49476 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wq4LW-00031W-5f for ged-emacs-devel@m.gmane.org; Thu, 29 May 2014 13:42:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wq4LO-0002w2-QG for emacs-devel@gnu.org; Thu, 29 May 2014 13:42:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wq4LJ-0000lO-Vv for emacs-devel@gnu.org; Thu, 29 May 2014 13:42:22 -0400 Original-Received: from sanddollar.geekisp.com ([216.168.135.167]:41446) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Wq4LJ-0000lD-Rl for emacs-devel@gnu.org; Thu, 29 May 2014 13:42:17 -0400 Original-Received: (qmail 9440 invoked by uid 1003); 29 May 2014 17:42:16 -0000 Original-Received: from localhost (localhost.geekisp.com [127.0.0.1]) by localhost.geekisp.com (tmda-ofmipd) with ESMTP; Thu, 29 May 2014 13:42:12 -0400 Content-Disposition: inline In-Reply-To: X-PGP-Key: http://www.dr-qubit.org/gpg-toby-pub.asc User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.11 (Ladyburn) X-Primary-Address: toby@dr-qubit.org X-detected-operating-system: by eggs.gnu.org: OpenBSD 4.x-5.x [fuzzy] X-Received-From: 216.168.135.167 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:172177 Archived-At: On Wed, May 28, 2014 at 10:08:08PM -0400, Stefan Monnier wrote: > > Toby, are there other reasons undo-tree needs to transfer undo > > elements from the buffer-undo-list to its own data model? > > Toby's position is that the undo data should be kept as a tree, not as > a list. That makes a lot of sense: For every branch in a tree, the > undo-list keeps 2 bundles (one going forward and the other going back), > but one of the two is always redundant, so the representation > is inefficient. Of course, this inefficiency only applies to the > *branches*, i.e. only for those elements generated by `undo', so this is > irrelevant as long as most of the changes are not undos. Just to be clear, I'm not strongly advocating changing Emacs' undo data structures. I'm just pointing out that *if* you're going to make substantial changes to the undo system for other reasons, you might as well consider whether changing the data structures would be useful too. I can see a number of arguments against changing Emacs' undo model, not least that `buffer-undo-list' is documented in the Elisp manual so is part of the Elisp API that packages may rely on. (I very occasionally get reports that undo-tree is incompatible with some package, for this reason.) Toby -- Dr T. S. Cubitt Royal Society University Research Fellow Fellow of Churchill College, Cambridge Centre for Quantum Information DAMTP, University of Cambridge email: tsc25@cantab.net web: www.dr-qubit.org