From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Toby Cubitt Newsgroups: gmane.emacs.bugs Subject: bug#11774: org-mode causes undo boundaries to be lost Date: Sun, 24 Jun 2012 23:52:41 +0200 Message-ID: <20120624215241.GA6205@c3po.home> References: <20120624212755.GA14501@c3po.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1340574797 20362 80.91.229.3 (24 Jun 2012 21:53:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 24 Jun 2012 21:53:17 +0000 (UTC) Cc: 11774@debbugs.gnu.org To: Bastien Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 24 23:53:16 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 1Siuk8-0005C4-59 for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Jun 2012 23:53:16 +0200 Original-Received: from localhost ([::1]:44619 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Siuk7-0002BK-Ug for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Jun 2012 17:53:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Siuk5-0002B4-A7 for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2012 17:53:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Siuk3-0002Fi-Jl for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2012 17:53:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Siuk3-0002FY-Ge for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2012 17:53:11 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Siunm-0001md-7o for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2012 17:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Toby Cubitt Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Jun 2012 21:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11774 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11774-submit@debbugs.gnu.org id=B11774.13405749966824 (code B ref 11774); Sun, 24 Jun 2012 21:57:02 +0000 Original-Received: (at 11774) by debbugs.gnu.org; 24 Jun 2012 21:56:36 +0000 Original-Received: from localhost ([127.0.0.1]:55552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SiunM-0001m1-CN for submit@debbugs.gnu.org; Sun, 24 Jun 2012 17:56:36 -0400 Original-Received: from sanddollar.geekisp.com ([216.168.135.167]:17609) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SiunK-0001lu-UJ for 11774@debbugs.gnu.org; Sun, 24 Jun 2012 17:56:35 -0400 Original-Received: (qmail 31258 invoked by uid 1003); 24 Jun 2012 21:52:42 -0000 Original-Received: from localhost (localhost.geekisp.com [127.0.0.1]) by localhost.geekisp.com (tmda-ofmipd) with ESMTP; Sun, 24 Jun 2012 17:52:39 -0400 Content-Disposition: inline In-Reply-To: <87395kcrur.fsf@gnu.org> X-PGP-Key: http://www.dr-qubit.org/gpg-toby.asc User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.11 (Ladyburn) X-Primary-Address: toby@dr-qubit.org 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:61260 Archived-At: 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. If the behaviour I reported is the intended behaviour with this option set, perhaps the clustering heuristic can be improved to avoid triggering history discarding in undo-tree-mode? undo-tree-mode puts a "canary" at the end of buffer-undo-list, to detect when Emacs discards undo history behind undo-tree-mode's back. I.e. before any undo entries have been added, buffer-undo-list contains: (nil undo-tree-canary) org-mode's undo clustering deletes the undo boundary before the undo-tree-canary entry, causing undo-tree-mode to think that Emacs has discarded undo history behind its back. 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). 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