GNU bug report logs -
#4803
Undo fails to restore marker position correctly
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
This is an automatic notification regarding your bug report
which was filed against the emacs package:
#4803: Undo fails to restore marker position correctly
It has been closed by Stefan Monnier <monnier <at> IRO.UMontreal.CA>.
Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Stefan Monnier <monnier <at> IRO.UMontreal.CA> by
replying to this email.
--
4803: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4803
Emacs Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> (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;
[Message part 3 (message/rfc822, inline)]
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 <at> cantab.net
web: www.dr-qubit.org
This bug report was last modified 15 years and 177 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.