From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#16411: undo-only bugs Date: Wed, 14 May 2014 15:55:47 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1400097390 14000 80.91.229.3 (14 May 2014 19:56:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 May 2014 19:56:30 +0000 (UTC) Cc: 16411 <16411@debbugs.gnu.org> To: Barry OReilly Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 14 21:56:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1WkfHp-0001n4-Kx for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 May 2014 21:56:21 +0200 Original-Received: from localhost ([::1]:54107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkfHp-0003oD-9m for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 May 2014 15:56:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkfHf-0003nJ-SC for bug-gnu-emacs@gnu.org; Wed, 14 May 2014 15:56:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkfHX-0000fX-HI for bug-gnu-emacs@gnu.org; Wed, 14 May 2014 15:56:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkfHX-0000fR-Ep for bug-gnu-emacs@gnu.org; Wed, 14 May 2014 15:56:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WkfHW-0002d2-Dr for bug-gnu-emacs@gnu.org; Wed, 14 May 2014 15:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 May 2014 19:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16411 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16411-submit@debbugs.gnu.org id=B16411.140009735710091 (code B ref 16411); Wed, 14 May 2014 19:56:02 +0000 Original-Received: (at 16411) by debbugs.gnu.org; 14 May 2014 19:55:57 +0000 Original-Received: from localhost ([127.0.0.1]:34866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkfHP-0002cd-8K for submit@debbugs.gnu.org; Wed, 14 May 2014 15:55:56 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:44566) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WkfHK-0002cP-MI for 16411@debbugs.gnu.org; Wed, 14 May 2014 15:55:51 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s4EJtmxU002066; Wed, 14 May 2014 15:55:48 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id D0598602D4; Wed, 14 May 2014 15:55:47 -0400 (EDT) In-Reply-To: (Barry OReilly's message of "Tue, 13 May 2014 11:01:32 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4942=0 X-NAI-Spam-Version: 2.3.0.9378 : core <4942> : inlines <869> : streams <1182849> : uri <1756809> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:89102 Archived-At: > Having undo elements reference what they undid would help solve > several issues: > 1: undo-only in region doesn't work. > 2: Normal undo-only after an undo in region doesn't work. I've > previously outlined how the solution would use the > undo-redo-table. > 3: Undo in region has counter intuitive behavior as described in > the FIXME of simple.el describing undo in region. > 4: Deleting X bytes, then doing Y iterations of undo and redo > causes undo history to grow about X*Y. To grow proportional to Y > should be achievable: set undo-in-progress to the in progress > element, and the C level undo recording to use it and > undo-redo-table to find the eq Lisp_String. > 5: Undo Tree should more tightly integrate with the builtin undo > system. To do so, it needs sufficient information to visualize > the buffer-undo-list as a tree. Undo Tree has a means to > visualize undo in regions, so undo-equiv-table is inadequate. IIUC this undo-redo-table business is only necessary because of undo-in-region. So I think we should strive to minimize the changes to the way undo works in the absence of undo-in-region. I understand that the change can't be all localized in undo-in-region (because of the need to skip "redo-in-region" during normal undo-only, basically), but we still should try to aim in that direction. > There are variations on how elements could reference what they undid, > but fundamentally I think it is essential. I wish to know how you like > the direction the patch is going as I proceed to solve some problems > building upon it. I think we should try to keep the "one entry per undo boundary" rather than go for "one entry per undo element". > The reason undo-redo-table maps at the element level, as opposed to > the change group level, is because in the case of undo in region with > a prefix arg, the newly created change group needs to reference > subsets of potentially many prior change groups. IIUC the crux of the matter is how to record the redo data for an undo-in-region. The way I see it, for such a "redo-in-region" group, we indeed need to remember which elements it undid (and which ones it skipped instead), but we could store that info as a single entry in an undo-redo/equiv-table. Stefan