From tsc25@cantab.net Sat Oct 24 17:19:30 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 25 Oct 2009 00:19:30 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9P0JSkV011078 for ; Sat, 24 Oct 2009 17:19:30 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N1qpU-00010x-I9 for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2009 20:19:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N1qpP-0000zJ-Ox for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2009 20:19:28 -0400 Received: from [199.232.76.173] (port=38841 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1qpP-0000zG-J7 for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2009 20:19:23 -0400 Received: from mail.geekisp.com ([216.168.135.169]:15446 helo=starfish.geekisp.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N1qpP-0003GR-6C for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2009 20:19:23 -0400 Received: (qmail 10795 invoked by uid 1003); 25 Oct 2009 00:19:16 -0000 Received: from c3po (localhost.geekisp.com [127.0.0.1]) by localhost.geekisp.com (tmda-ofmipd) with ESMTP; Sat, 24 Oct 2009 20:19:14 -0400 Date: Sat, 24 Oct 2009 17:18:48 -0700 To: bug-gnu-emacs@gnu.org Subject: Undo fails to restore marker position correctly Message-ID: <20091025001848.GA7369@c3po.javajonescoffeehouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Delivery-Agent: TMDA/1.1.11 (Ladyburn) From: Toby Cubitt X-Primary-Address: toby@dr-qubit.org Reply-To: Toby Cubitt X-detected-operating-system: by monty-python.gnu.org: OpenBSD 3.0-3.9 In GNU Emacs 23.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.16.6) of 2009-10-17 Steps to reproduce: ------------------- (switch-to-buffer "*scratch*") ; any buffer containing some text will do (setq mrk (make-marker)) (move-marker mrk 5) ; any position within text will do (set-marker-insertion-type mrk t) (delete-region 1 10) (undo) Marker mrk is now at position 15 in *scratch* instead of 5. Toby -- Dr T. S. Cubitt Quantum Information Theory group Department of Mathematics University of Bristol United Kingdom email: tsc25@cantab.net web: www.dr-qubit.org From monnier@faina.iro.umontreal.ca Tue Nov 24 13:33:54 2009 Received: (at 4803-done) by emacsbugs.donarmstrong.com; 24 Nov 2009 21:33:54 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.4 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pruche.dit.umontreal.ca (pruche.dit.umontreal.ca [132.204.246.22]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAOLXqw7026012 for <4803-done@emacsbugs.donarmstrong.com>; Tue, 24 Nov 2009 13:33:54 -0800 Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id nAOLXdtQ009678; Tue, 24 Nov 2009 16:33:40 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id AF8A33A1B6; Tue, 24 Nov 2009 16:33:39 -0500 (EST) From: Stefan Monnier To: Toby Cubitt Subject: Re: Undo fails to restore marker position correctly Message-ID: References: <20091025001848.GA7369@c3po.javajonescoffeehouse.com> Date: Tue, 24 Nov 2009 16:33:39 -0500 In-Reply-To: <20091025001848.GA7369@c3po.javajonescoffeehouse.com> (Toby Cubitt's message of "Sat, 24 Oct 2009 17:18:48 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3413=0 > (switch-to-buffer "*scratch*") ; any buffer containing some text will do > (setq mrk (make-marker)) > (move-marker mrk 5) ; any position within text will do > (set-marker-insertion-type mrk t) > (delete-region 1 10) > (undo) > Marker mrk is now at position 15 in *scratch* instead of 5. I've just installed the patch below should should fix it. Thanks for catching it! Stefan === modified file 'src/insdel.c' --- src/insdel.c 2009-11-24 15:30:54 +0000 +++ src/insdel.c 2009-11-24 21:28:22 +0000 @@ -377,7 +377,7 @@ upon re-inserting the deleted text, so we have to arrange for them to move backward to the correct position. */ XSETMISC (marker, m); - record_marker_adjustment (marker, charpos - to); + record_marker_adjustment (marker, to - charpos); } m->charpos = from; m->bytepos = from_byte; From unknown Sat Jun 14 14:24:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 23 Dec 2009 12:24:02 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator