From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Misery with undo. Help, please! Date: Mon, 20 Oct 2008 19:06:26 +0000 Message-ID: <20081020190626.GA3558@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1224539569 28066 80.91.229.12 (20 Oct 2008 21:52:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Oct 2008 21:52:49 +0000 (UTC) To: Richard Stallman , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 20 23:53:49 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ks0Jb-00036m-PK for ged-emacs-devel@m.gmane.org; Mon, 20 Oct 2008 21:21:20 +0200 Original-Received: from localhost ([127.0.0.1]:36989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ks0IW-0004uh-FM for ged-emacs-devel@m.gmane.org; Mon, 20 Oct 2008 15:20:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ks0Hu-0004Ye-9O for emacs-devel@gnu.org; Mon, 20 Oct 2008 15:19:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ks0Hs-0004XE-DF for emacs-devel@gnu.org; Mon, 20 Oct 2008 15:19:33 -0400 Original-Received: from [199.232.76.173] (port=50894 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ks0Hr-0004X3-VK for emacs-devel@gnu.org; Mon, 20 Oct 2008 15:19:32 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:36755) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Krzxp-00026Q-Np for emacs-devel@gnu.org; Mon, 20 Oct 2008 15:03:49 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Krzxa-0000A0-Or for emacs-devel@gnu.org; Mon, 20 Oct 2008 14:58:35 -0400 Original-Received: (qmail 37809 invoked by uid 3782); 20 Oct 2008 18:57:04 -0000 Original-Received: from acm.muc.de (pD9E233B2.dip.t-dialin.net [217.226.51.178]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 20 Oct 2008 20:57:03 +0200 Original-Received: (qmail 10544 invoked by uid 1000); 20 Oct 2008 19:06:26 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: by mx20.gnu.org: FreeBSD 4.6-4.9 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:104696 Archived-At: Hi, Richard and Emacs! I'm having a very bad day, and help would be appreciated. The following scenario arose in my investigation of bug#1202: Open a fresh buffer in fundamental mode. Type in "GNU" (three letters). Then look at the undo list, M-: buffer-undo-list (nil (1 . 4) (t 65535 . 65535)) . The three elements are: nil ; undo boundary (1 . 4) ; beginning and end of "GNU" (t 65535 .65535) ; Timestamp of file (here, there isn't one). In this state, you can undo with C-_ (or whatever). Now prefix a POSITION element and another undo boundary with M-: (push (point) buffer-undo-list M-: (push nil buffer-undo-list) buffer-undo-list now looks like (nil 4 nil (1 . 4) (t 65535 . 65535)) [*] , where the extra two elements are: nil ; undo boundary 4 ; POSITION. [*] Actually, it inserts an extra, spurious, nil too, or I've badly misunderstood something. This seems to be a bug in the macro `push'. Do M-: (pop buffer-undo-list) to get rid of this. I'm having a bad day. :-( o-o-O-o-o-O-o-o-O-o-o If you now attempt an undo, point is indeed moved to bufpos 4, but buffer-undo-list doesn't lose its first two elements as it should. THIS IS A BUG. o-o-O-o-o-O-o-o-O-o-o However, if you do M-2 C-_, the (double) undo works, but buffer-undo-list now looks like: (nil ("GNU" . 1) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) (# . -3) nil 4 nil (1 . 4) (t 65535 . 65535)) [The #