From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Martin Pohlack Newsgroups: gmane.emacs.bugs Subject: bug#11774: [O] bug#11774: org-mode causes undo boundaries to be lost Date: Mon, 02 Jul 2012 08:51:48 +0200 Message-ID: <4FF14504.10609@os.inf.tu-dresden.de> References: <20120624212755.GA14501@c3po.home> <20120625113529.GA15913@c3po.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1341211961 5906 80.91.229.3 (2 Jul 2012 06:52:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 Jul 2012 06:52:41 +0000 (UTC) Cc: Bastien , 11774@debbugs.gnu.org To: Toby Cubitt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 02 08:52:40 2012 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 1SlaUw-000719-Vw for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2012 08:52:39 +0200 Original-Received: from localhost ([::1]:39182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SlaUw-0004GI-16 for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2012 02:52:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SlaUt-0004BK-Bn for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2012 02:52:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SlaUr-0005T1-IL for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2012 02:52:34 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59718) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SlaUn-0005Rw-31; Mon, 02 Jul 2012 02:52:29 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SlaZC-0000WU-2x; Mon, 02 Jul 2012 02:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Martin Pohlack Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, emacs-orgmode@gnu.org Resent-Date: Mon, 02 Jul 2012 06:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11774 X-GNU-PR-Package: emacs,org-mode X-GNU-PR-Keywords: Original-Received: via spool by 11774-submit@debbugs.gnu.org id=B11774.13412121931977 (code B ref 11774); Mon, 02 Jul 2012 06:57:01 +0000 Original-Received: (at 11774) by debbugs.gnu.org; 2 Jul 2012 06:56:33 +0000 Original-Received: from localhost ([127.0.0.1]:41031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SlaYj-0000Vp-2l for submit@debbugs.gnu.org; Mon, 02 Jul 2012 02:56:33 -0400 Original-Received: from os.inf.tu-dresden.de ([141.76.48.99]:49487) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SlaYe-0000Vd-If for 11774@debbugs.gnu.org; Mon, 02 Jul 2012 02:56:30 -0400 Original-Received: from [84.179.214.51] (helo=[192.168.2.111]) by os.inf.tu-dresden.de with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80) id 1SlaUA-0001np-MD; Mon, 02 Jul 2012 08:51:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 In-Reply-To: <20120625113529.GA15913@c3po.home> X-Enigmail-Version: 1.4.1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:61483 Archived-At: Hi Toby, On 25.06.2012 13:35, Toby Cubitt wrote: > On Sun, Jun 24, 2012 at 11:52:41PM +0200, Toby Cubitt wrote: >> On Sun, Jun 24, 2012 at 11:39:08PM +0200, Bastien wrote: >>> Hi Toby, >>> >>> Toby Cubitt writes: >>> >>>> For some unknown reason, org-mode is causing the undo boundary between >>>> the (2 . 4) and (1 . 2) entries to be removed from `buffer-undo-list'. >>> >>> Can you try again with >>> >>> (setq org-self-insert-cluster-for-undo nil) >>> >>> and report? >> >> Yup, that fixes the problem. >> >> I don't fully understand the purpose of >> `org-self-insert-cluster-for-undo', given that the Emacs command loop >> already groups consecutive undo entries together, but presumably it >> enables a more aggressive form of clustering. >> > [snip] >> >> I could try to work around this in undo-tree-mode, but it seems to me >> that org-mode shouldn't be throwing away an undo boundary that comes >> before an entry which definitely shouldn't be clustered with anything >> (namely the undo-tree-canary symbol, which is meaningless to org-mode). > > I've now added a work-around for this in undo-tree-mode (currently only > in git, but I'll push to ELPA once it's sufficiently tested). > > 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? Thanks, Martin