unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Kifer <kifer@cs.stonybrook.edu>
To: Phillip Lord <phillip.lord@russet.org.uk>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 22295@debbugs.gnu.org, Jim Meyering <jim@meyering.net>
Subject: bug#22295: viper-mode undo bug introduced between Nov 10 and Nov 14
Date: Wed, 1 Jun 2016 18:34:05 -0400	[thread overview]
Message-ID: <574F62DD.4000506@cs.stonybrook.edu> (raw)
In-Reply-To: <877fe85z1e.fsf@russet.org.uk>



On 06/01/2016 06:23 PM, Phillip Lord wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>> different, though. With this fix, viper just disables automatic boundary
>>> addition and adds it's own as necessary, which seems cleaner.
>> I see an annoying side-effect of that change, tho:
>>
>>      % emacs -Q -f viper-mode
>>      y 5 n                   ;; To get past viper's initial questions.
>>      i helo C-b k C-/
>>
>> This last C-/ used to (and should) just undo the insertion of the last
>> "k", but instead it now completely wipes out the *scratch* buffer.
>>
>> So I think that completely disabling undo boundaries is not a good idea:
>> while in many use-cases insertion mode is very transient, it is not so
>> unusual to spend more time in insertion mode (which is pretty much
>> "emacs mode") and to expect undo boundaries to properly inserted during
>> this time.
> Oh dear. Yes, that is a problem. The difficulty is that viper modifies
> the undo-list, removing boundaries only *after* we leave insert mode.
> Hence, when you type C-/ above they are still there.
>
> If you do
>
> i helo C-b k escape C-/
>
> before the undo changes, then the whole buffer is deleted also. So, undo
> behaves different in insert mode and in <V> command mode.
>
> Viper's solution of introducing a 'viper symbol is a nice one, but has
> it's problems. If you do, for example
>
> i helo C-b k C-/ C-/
>
> We get an error from the undo system.
>
> primitive-undo: Unrecognized entry in undo list viper

not in  25.0.50
viper worked fine with this for 20 years and I'd say it is Emacs 
breakage, not Viper's.


> The deep problem here is that undo boundary == nil -- i.e. there is one
> and only one symbol for undo-boundary. If it could carry a value, viper
> could do this cleanly.
>
> Only solution that leaps to mind is this:
>
>
> 1) Restore all the old viper code
> 2) Instead of adding a 'viper mark, copy the buffer-undo-list to
> "viper-old-buffer-undo-list".
> 3) Instead of this....
>
> (if (setq tmp (memq viper-buffer-undo-list-mark buffer-undo-list))
>
> we should now already have the cons cell that represents the tail of the
> buffer-undo-list.
>
> This is also quite a big change, and I worry about buffer compaction --
> viper-old-buffer-undo-list would not be open for GC.

Do you know who made the changes to the emacs undo list? Maybe complain 
to him?



>
>> Have we been able to identify the original problem?
> No, fraid not. Thought about it lots. Failed.

could not  understand what happened either.

--

        --- michael


>
>> The old code seemed "simple" enough that the problem was probably
>> simple to fix (once identified).
> Well, most problems are simple to fix once you actually know what they
> are.
>
> I shall look again at the old code, and see if I can figure it out.
>
> Phil






  reply	other threads:[~2016-06-01 22:34 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03  4:01 bug#22295: viper-mode undo bug introduced between Nov 10 and Nov 14 Jim Meyering
2016-05-14  9:25 ` Eli Zaretskii
2016-05-14 10:01   ` Eli Zaretskii
2016-05-14 13:57     ` Phillip Lord
2016-05-14 20:10       ` Michael Kifer
2016-05-14 20:39         ` Phillip Lord
2016-05-14 20:50           ` Michael Kifer
2016-05-16  9:50             ` Phillip Lord
2016-05-17  3:38               ` Michael Kifer
2016-05-17  8:52                 ` Phillip Lord
2016-05-17 13:58                   ` Michael Kifer
2016-05-15  8:06           ` Michael Albinus
2016-05-16 12:37             ` Phillip Lord
2016-05-16 17:06               ` Michael Kifer
2016-05-16  2:31       ` Jim Meyering
2016-05-16 12:41         ` Phillip Lord
2016-05-16 15:39           ` Jim Meyering
2016-05-16 16:34             ` Eli Zaretskii
2016-05-16 17:14               ` Michael Kifer
2016-05-16 17:41                 ` Eli Zaretskii
2016-05-17  8:48                   ` Phillip Lord
2016-05-17  8:46                 ` Phillip Lord
2016-05-17 14:05                   ` Michael Kifer
2016-05-17 22:35                     ` Phillip Lord
2016-05-17  8:25               ` Phillip Lord
2016-05-17  8:35             ` Phillip Lord
     [not found]               ` <CA+8g5KG=XBCc8U3u3D=+bh74sMLAH9R7ZUZ=SeQL9de=WQ71vQ@mail.gmail.com>
2016-05-18  9:15                 ` Phillip Lord
2016-05-18 15:58                   ` Jim Meyering
2016-05-18 21:42                     ` Phillip Lord
2016-05-19  1:09                       ` Jim Meyering
2016-05-20 10:00                         ` Eli Zaretskii
2016-05-20 11:46                           ` Phillip Lord
2016-05-20 13:32                             ` Eli Zaretskii
2016-05-23  6:45                           ` John Wiegley
2016-05-23 13:23                             ` Phillip Lord
2016-05-24 15:43                               ` Eli Zaretskii
2016-05-25 12:43                                 ` Phillip Lord
2016-05-25 16:28                                   ` Eli Zaretskii
2016-06-01 13:06           ` Stefan Monnier
2016-06-01 22:23             ` Phillip Lord
2016-06-01 22:34               ` Michael Kifer [this message]
2016-06-01 22:41                 ` Phillip Lord
2016-06-01 22:47                   ` Michael Kifer
2016-06-02  0:11                 ` Stefan Monnier
2016-06-02  8:45                   ` Phillip Lord
2016-06-10 17:05               ` Stefan Monnier
2016-06-10 22:18                 ` Phillip Lord
2016-06-11  4:04                   ` Stefan Monnier
2016-06-13 12:36                     ` Phillip Lord
2016-06-11  7:34                   ` Eli Zaretskii
2016-06-13 12:37                     ` Phillip Lord
2016-06-13 13:06                       ` Stefan Monnier
2016-06-15  4:40                         ` Jim Meyering
2016-06-15  5:24                       ` Michael Kifer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=574F62DD.4000506@cs.stonybrook.edu \
    --to=kifer@cs.stonybrook.edu \
    --cc=22295@debbugs.gnu.org \
    --cc=jim@meyering.net \
    --cc=monnier@iro.umontreal.ca \
    --cc=phillip.lord@russet.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).