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:27:55 +0200 Message-ID: <20120624212755.GA14501@c3po.home> Reply-To: Toby Cubitt NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1340573298 10510 80.91.229.3 (24 Jun 2012 21:28:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 24 Jun 2012 21:28:18 +0000 (UTC) To: 11774@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 24 23:28:17 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 1SiuLw-0002WS-LQ for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Jun 2012 23:28:16 +0200 Original-Received: from localhost ([::1]:43077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiuLw-0000ev-FF for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Jun 2012 17:28:16 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiuLt-0000eb-Dj for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2012 17:28:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SiuLr-000687-KN for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2012 17:28:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiuLr-000682-H9 for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2012 17:28:11 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SiuPa-0001F7-Kg for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2012 17:32: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:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11774 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13405735204767 (code B ref -1); Sun, 24 Jun 2012 21:32:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Jun 2012 21:32:00 +0000 Original-Received: from localhost ([127.0.0.1]:55520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SiuPX-0001Ep-4A for submit@debbugs.gnu.org; Sun, 24 Jun 2012 17:31:59 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57560) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SiuPU-0001Ef-3G for submit@debbugs.gnu.org; Sun, 24 Jun 2012 17:31:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SiuLi-000678-TK for submit@debbugs.gnu.org; Sun, 24 Jun 2012 17:28:04 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:52653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiuLi-000673-Po for submit@debbugs.gnu.org; Sun, 24 Jun 2012 17:28:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiuLg-0000eK-Vx for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2012 17:28:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SiuLe-00066g-RZ for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2012 17:28:00 -0400 Original-Received: from sanddollar.geekisp.com ([216.168.135.167]:24134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiuLe-00066T-Mu for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2012 17:27:58 -0400 Original-Received: (qmail 29586 invoked by uid 1003); 24 Jun 2012 21:27:55 -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:27:53 -0400 Content-Disposition: inline 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-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:61258 Archived-At: Steps to reproduce, starting from "emacs -Q": 1. C-x C-f test.org 2. M-x org-mode 3. M-: (add-hook 'post-command-hook (lambda () (message "%s" buffer-undo-list)) nil t) 4. type "a" 5. C- C- 6. type "bc" Expected behaviour: contents of `buffer-undo-list' after step 6. should be ((2 . 4) nil (1 . 2) (t . -1)) Actual behaviour: contents of `buffer-undo-list' after step 6. are ((2 . 4) (1 . 2) (t . -1)) 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'. If we try the same thing under another major mode (e.g. replace step 2 with "M-x text-mode"), then `buffer-undo-list' does contain the undo boundary, as expected. Step 3 is there to monitor what's going on. The same results are obtained if that step is omitted. However, with the post-command-hook enabled, you can see that the undo boundary is still there after typing "b" in step 6, but gets deleted after typing "c". This might look like a minor bug, but it can have severe consequences. E.g. when using undo-tree-mode in org-mode, the corrupted `buffer-undo-list' contents cause undo-tree-mode to discard the entire undo history. Toby In GNU Emacs 24.1.50.2 (i686-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-06-20 on c3po Windowing system distributor `The X.Org Foundation', version 11.0.11104000 Configured using: `configure '--prefix=/usr' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--disable-dependency-tracking' '--program-suffix=-emacs-24-vcs' '--infodir=/usr/share/info/emacs-24-vcs' '--enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.5.3/../../../../lib' '--with-gameuser=games' '--without-compress-info' '--without-hesiod' '--without-kerberos' '--without-kerberos5' '--with-gpm' '--with-dbus' '--without-gnutls' '--without-xml2' '--without-selinux' '--without-wide-int' '--without-sound' '--with-x' '--without-ns' '--without-gconf' '--without-gsettings' '--with-toolkit-scroll-bars' '--without-gif' '--without-jpeg' '--with-png' '--with-rsvg' '--without-tiff' '--with-xpm' '--without-imagemagick' '--with-xft' '--without-libotf' '--without-m17n-flt' '--with-x-toolkit=gtk' 'EBZR_BRANCH=trunk' 'EBZR_REVNO=108667' '--build=i686-pc-linux-gnu' 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'CFLAGS=-march=prescott -O2 -pipe -O2' 'LDFLAGS=-Wl,-O1 -Wl,--as-needed' 'CPPFLAGS='' Important settings: value of $LANG: en_GB.utf-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t -- 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