From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toby Cubitt Subject: bug#11774: bug#11774: org-mode causes undo boundaries to be lost Date: Tue, 3 Jul 2012 11:57:29 +0200 Message-ID: <20120703095729.GA6651__4798.89668426967$1341331596$gmane$org@c3po> References: <20120624212755.GA14501@c3po.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm5I7-0003sS-7t for emacs-orgmode@gnu.org; Tue, 03 Jul 2012 11:45:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sm5I0-0003i2-Ml for emacs-orgmode@gnu.org; Tue, 03 Jul 2012 11:45:26 -0400 Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-Message-ID: Content-Disposition: inline In-Reply-To: <4FF14504.10609@os.inf.tu-dresden.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Martin Pohlack Cc: Bastien , 11774@debbugs.gnu.org On Mon, Jul 02, 2012 at 08:51:48AM +0200, Martin Pohlack wrote: > > I'm still not entirely convinced that the boundary discarding logic in > > org-self-insert-command is correct. For example, if I do the following: > > > > 1. Type some text at some location in an org-mode buffer > > 2. Move to another location very far away > > (without invoking any commands other than point motion) > > 3. Type some more text > > > > then org-self-insert-cluster-for-undo collapses the undo changesets for > > these two changes into one. Undoing then reverts both sets of changes at > > once, even though those changes might be so far apart that they aren't > > both visible at the same time in the buffer. > > > > That seems very undesirable to me. > > Having been involved in org-mode's collapsing code I am interested in > this, but I cannot reproduce your problem. I used a very large org-mode > file, inserted some text, moved down some pages and inserted some text > again (3 chars each). Undoing was split between both parts, exactly as > desired. Could you provide more details please? Sure. The following steps produce the effect I described, at least for me. This is on a fairly recent (a couple of weeks old) bzr build of Emacs, and a similarly recent git build of org-mode: 1. $ emacs -Q 2. C-x C-f test.org 3. M-x org-mode [not really necessary since already in org-mode] 5. C-u 50 M-x newline 6. M-< 7. type "a" 8. M-> 9. type "bc" buffer-undo-list now contains: (nil (52 . 54) (1 . 2) nil (1 . 51) (t . -1)) Note the lack of undo boundary between (52 . 54) and (1 . 2), which means that undoing once (C-/) deletes both "bc" *and* "a" in one step. HTH, Toby -- Dr T. S. Cubitt Mathematics and Quantum Information group Department of Mathematics Complutense University Madrid, Spain email: tsc25@cantab.net web: www.dr-qubit.org