unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4803: Undo fails to restore marker position correctly
@ 2009-10-25  0:18 ` Toby Cubitt
  2009-11-24 21:40   ` bug#4803: marked as done (Undo fails to restore marker position correctly) Emacs bug Tracking System
  0 siblings, 1 reply; 2+ messages in thread
From: Toby Cubitt @ 2009-10-25  0:18 UTC (permalink / raw)
  To: bug-gnu-emacs

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






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#4803: marked as done (Undo fails to restore marker position correctly)
  2009-10-25  0:18 ` bug#4803: Undo fails to restore marker position correctly Toby Cubitt
@ 2009-11-24 21:40   ` Emacs bug Tracking System
  0 siblings, 0 replies; 2+ messages in thread
From: Emacs bug Tracking System @ 2009-11-24 21:40 UTC (permalink / raw)
  To: Stefan Monnier

[-- Attachment #1: Type: text/plain, Size: 907 bytes --]

Your message dated Tue, 24 Nov 2009 16:33:39 -0500
with message-id <jwvfx83ipjv.fsf-monnier+gnus-read-ephemeral-bug@gnu.org>
and subject line Re: Undo fails to restore marker position correctly
has caused the Emacs bug report #4803,
regarding Undo fails to restore marker position correctly
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4803: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4803
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 2763 bytes --]

From: Toby Cubitt <tsc25@cantab.net>
To: bug-gnu-emacs@gnu.org
Subject: Undo fails to restore marker position correctly
Date: Sat, 24 Oct 2009 17:18:48 -0700
Message-ID: <20091025001848.GA7369@c3po.javajonescoffeehouse.com>

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



[-- Attachment #3: Type: message/rfc822, Size: 2510 bytes --]

From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Toby Cubitt <toby-dated-1256861956.bb6a54@dr-qubit.org>
Subject: Re: Undo fails to restore marker position correctly
Date: Tue, 24 Nov 2009 16:33:39 -0500
Message-ID: <jwvfx83ipjv.fsf-monnier+gnus-read-ephemeral-bug@gnu.org>

> (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;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-24 21:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <jwvfx83ipjv.fsf-monnier+gnus-read-ephemeral-bug@gnu.org>
2009-10-25  0:18 ` bug#4803: Undo fails to restore marker position correctly Toby Cubitt
2009-11-24 21:40   ` bug#4803: marked as done (Undo fails to restore marker position correctly) Emacs bug Tracking System

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).