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: [O] 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@c3po> 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 1341394917 23189 80.91.229.3 (4 Jul 2012 09:41:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 4 Jul 2012 09:41:57 +0000 (UTC) Cc: Bastien , Martin Pohlack , 11774@debbugs.gnu.org To: Samuel Wales Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 04 11:41:56 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 1SmM5e-0003Ia-K8 for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Jul 2012 11:41:42 +0200 Original-Received: from localhost ([::1]:40746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmM5d-0008Db-LP for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Jul 2012 05:41:41 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmM5W-00089v-0h for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 05:41:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmM5R-0007Yf-Fa for bug-gnu-emacs@gnu.org; Wed, 04 Jul 2012 05:41:33 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmM5E-0007TX-RC; Wed, 04 Jul 2012 05:41:16 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SmM9q-0005jc-2O; Wed, 04 Jul 2012 05:46: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, emacs-orgmode@gnu.org Resent-Date: Wed, 04 Jul 2012 09:46:02 +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.134139512921974 (code B ref 11774); Wed, 04 Jul 2012 09:46:02 +0000 Original-Received: (at 11774) by debbugs.gnu.org; 4 Jul 2012 09:45:29 +0000 Original-Received: from localhost ([127.0.0.1]:47225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmM9I-0005iM-Ji for submit@debbugs.gnu.org; Wed, 04 Jul 2012 05:45:29 -0400 Original-Received: from starfish.geekisp.com ([216.168.135.166]:18050) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SmM9G-0005i9-3B for 11774@debbugs.gnu.org; Wed, 04 Jul 2012 05:45:26 -0400 Original-Received: (qmail 2086 invoked by uid 1003); 4 Jul 2012 09:40:39 -0000 Original-Received: from localhost (localhost.geekisp.com [127.0.0.1]) by localhost.geekisp.com (tmda-ofmipd) with ESMTP; Wed, 04 Jul 2012 05:40:35 -0400 Content-Disposition: inline In-Reply-To: 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:61564 Archived-At: 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