From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toby Cubitt Subject: bug#11774: bug#11774: bug#11774: org-mode causes undo boundaries to be lost Date: Wed, 4 Jul 2012 11:40:37 +0200 Message-ID: <20120704094036.GA23683__36078.5500881777$1341405094$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]:35904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmM5L-000849-5q for emacs-orgmode@gnu.org; Wed, 04 Jul 2012 05:41:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmM5E-0007U0-Uw for emacs-orgmode@gnu.org; Wed, 04 Jul 2012 05:41:22 -0400 Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-Message-ID: Content-Disposition: inline In-Reply-To: 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: Samuel Wales Cc: Bastien , Martin Pohlack , Stefan Monnier , 11774@debbugs.gnu.org On Tue, Jul 03, 2012 at 05:18:50PM -0700, Samuel Wales wrote: > On 7/3/12, Stefan Monnier wrote: > >> self-insert-command. Even just turning that magic 20 number into a > >> variable would help. > > > > Providing it as a variable would be very easy, indeed. > > Therefore, IF we have that variable, then undo-boundary considerations > should be simply to DTRT for undo-tree, org-self-insert-command, > and other code, in such a way that subtle bugs are prevented. Just to clarify the situation with undo-tree: it doesn't care how or when undo boundaries are inserted, and never did. The problem was only that undo boundaries that had nothing to do with self-insert-command were being *deleted*, due to the subtle interaction between the new Emacs-24 self-insert-command and org-mode's org-self-insert-cluster-for-undo feature. I've already pushed a change to the git version of undo-tree to make it work even if something else deletes undo boundaries that it shouldn't have touched (e.g. org-mode + Emacs-24). Deleting boundaries that have nothing to do with self-insert-command is still a bug, in my opinion, but it's a bug that no longer has catastrophic consequences in undo-tree-mode. It sounds from the preceding discussion that the right solution is simply to disable org-self-insert-cluster-for-undo in Emacs-24, since the purpose of org-mode's clustering was to recover the normal clustering behaviour and the standard self-insert-command clustering now works in org-mode with Emacs-24. The question of how to customize the clustering granularity seems to me to be a separate question (which can presumably be solved by making the hard-coded 20 into a variable). 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