GNU bug report logs - #22295
viper-mode undo bug introduced between Nov 10 and Nov 14

Previous Next

Package: emacs;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Sun, 3 Jan 2016 04:03:01 UTC

Severity: normal

Fixed in version 25.1

Done: phillip.lord <at> russet.org.uk (Phillip Lord)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Kifer <kifer <at> cs.stonybrook.edu>
Cc: 22295 <at> debbugs.gnu.org, jim <at> meyering.net, phillip.lord <at> russet.org.uk
Subject: bug#22295: viper-mode undo bug introduced between Nov 10 and Nov 14
Date: Sat, 14 May 2016 13:01:23 +0300
> Date: Sat, 14 May 2016 12:25:13 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 22295 <at> debbugs.gnu.org, Jim Meyering <jim <at> meyering.net>
> 
> > From: Jim Meyering <jim <at> meyering.net>
> > Date: Sat, 2 Jan 2016 20:01:36 -0800
> > 
> > Hello,
> > I noticed that viper-mode's "undo" ('u') command began to undo too much
> > and was able quickly to determine that it worked fine with my snapshot
> > built from git master some time on Nov 10, yet that it began to undo
> > too much four days later.
> > 
> > To demonstrate the problem (without risking changing anything in your
> > home directory), run this:
> > 
> >   mkdir /tmp/x && HOME=/tmp/x emacs -Q -f viper-mode -nw
> > ~/previously-nonexistent-file
> > 
> > then respond "y", "y", "5" to get past the "viperize" setup questions.
> > To reproduce the error, insert two lines, terminating each "insertion" with ESC,
> > so that each is recorded as a separate undo'able operation. I.e., type this
> > 
> >    a 1 ESC
> > 
> > to create the first line, then
> > 
> >   o 2 ESC
> > 
> > to create the second.
> > Finally, hit "u" to undo creation of the second and you'll see that it undoes
> > both operations, erasing both lines.  This is rather disruptive when that first
> > bit of text was a long paragraph or two -- the novice may think that it's lost,
> > because redo does not restore it -- however, it is available in emacs's
> > yank buffer.
> 
> Phillip, could you please look into this?  This sounds like a annoying
> problem for users of viper-mode, and AFAIU it happens on the release
> branch as well.

(Adding Michael to the addressees.)

I took a short look, and it sounds like we need more experts here.
Undo in viper has its own implementation, which tries to do something
that is not immediately clear to me, and is not really documented
anywhere.  I guess vi users will know that, but I'm not one of them.

The viper-undo command and related functions manipulate the Emacs undo
data structures directly, see viper-adjust-undo.  I guess the recent
changes in low-level undo implementation run afoul of what viper-mode
tries to do.

I hope the above provides enough hints to find the reason for this
problem and solve it.

Thanks.




This bug report was last modified 8 years and 346 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.