From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jim Meyering Newsgroups: gmane.emacs.bugs Subject: bug#22295: viper-mode undo bug introduced between Nov 10 and Nov 14 Date: Mon, 16 May 2016 08:39:15 -0700 Message-ID: References: <83vb2h6lfq.fsf@gnu.org> <83r3d56jrg.fsf@gnu.org> <87poso7nf5.fsf@russet.org.uk> <878tzatbte.fsf@russet.org.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1463414335 17578 80.91.229.3 (16 May 2016 15:58:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 May 2016 15:58:55 +0000 (UTC) Cc: 22295@debbugs.gnu.org, Michael Kifer To: Phillip Lord Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 16 17:58:47 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b2Kum-0002b8-Ul for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 May 2016 17:58:41 +0200 Original-Received: from localhost ([::1]:44613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2Kul-0004M4-R6 for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 May 2016 11:58:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2Kcq-0007oI-30 for bug-gnu-emacs@gnu.org; Mon, 16 May 2016 11:40:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2Kck-0007NB-1H for bug-gnu-emacs@gnu.org; Mon, 16 May 2016 11:40:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2Kcj-0007Mz-UN for bug-gnu-emacs@gnu.org; Mon, 16 May 2016 11:40:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b2Kcj-0007wx-PB for bug-gnu-emacs@gnu.org; Mon, 16 May 2016 11:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Meyering Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 May 2016 15:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22295 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22295-submit@debbugs.gnu.org id=B22295.146341318430518 (code B ref 22295); Mon, 16 May 2016 15:40:01 +0000 Original-Received: (at 22295) by debbugs.gnu.org; 16 May 2016 15:39:44 +0000 Original-Received: from localhost ([127.0.0.1]:53918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2KcR-0007wA-UY for submit@debbugs.gnu.org; Mon, 16 May 2016 11:39:44 -0400 Original-Received: from mail-oi0-f46.google.com ([209.85.218.46]:34047) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2KcP-0007vx-RP for 22295@debbugs.gnu.org; Mon, 16 May 2016 11:39:42 -0400 Original-Received: by mail-oi0-f46.google.com with SMTP id k142so273959057oib.1 for <22295@debbugs.gnu.org>; Mon, 16 May 2016 08:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GRA3sJz+r39Wp/N+wgljN2Zf4UWJKAz0CfNUOwBnieU=; b=OcNL5/MinUFDOzbq1IIfchi+5Us/Z2xtawTwQwGdPhO86ba8+jO6t3oVlWqAmEj4Z+ FdDq0Qd70Uq9zcytJmQCEJszVOCSmShu6p5OUfI1Jw9Khaww3qu9TPF67hGrc4LdW0Dn o/h5yFxExhTAahFMdAazUDDSBL+tUCt8Ptc0bwqcvdz04JIur0+lH6+6cYGlAtCaH2An +YrVWsCdxAgfT+H6tehBgv4u0dHo92oszFiDuRD/PGcfl8l7brcbWfiJypgU/N2M8aR4 g7SwGz0UtDAeGAxY9BvIg22r0lD+PwXLHcj+zh49KGDEsiExil1I7k7SZS4Bh83aq9ZE 76yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=GRA3sJz+r39Wp/N+wgljN2Zf4UWJKAz0CfNUOwBnieU=; b=N2i63Xjv8LyJbTBXURw63j2TsgZeunSs+O5yAjQYTnG6EIbNJ6SD/Vs23YnUmkctDm D4KHhPYkuWdrV+xVn10+zJTY6cH6dLNFXqIPPsW4WtrFrwQU8uJ69FHfSowE0hjqeuwX AwNEufFVKf039e0yWqjbTQ7tKw2/zZQfHdVQD4XBpTQ2yVGfWc1imWSJJk1kxtivCNfs EW1tCX3v68+hcD894KueWC3NAGJeXINOgQ0H43k1nCYNGO5MFJ+KCP3ScKupnB0vNmBK Ny5iHEzzIJ/7miaq742gAUxGyGOnJOR8JUE5BM4LbLQnof5X2YhjZythbxBvXt8gn/X8 y0Hg== X-Gm-Message-State: AOPr4FXBW6aN9LT/sX24MJOAhyLl+NZidwjtdIs1BIRvPnnUCvFx8H8D3tokLMXHTLK4VALPUodv5h5VMpeaPg== X-Received: by 10.202.105.198 with SMTP id e189mr14877926oic.195.1463413176116; Mon, 16 May 2016 08:39:36 -0700 (PDT) Original-Received: by 10.202.175.193 with HTTP; Mon, 16 May 2016 08:39:15 -0700 (PDT) In-Reply-To: <878tzatbte.fsf@russet.org.uk> X-Google-Sender-Auth: XJiKR1zxe90pbzWju4FtrQYYeBo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:118285 Archived-At: On Mon, May 16, 2016 at 5:41 AM, Phillip Lord wrote: ... > I have pushed a first attempt at a fix to branch fix/viper-undo. > Clearly, it's not finished yet, but I'd like to get your feedback as to > whether it works; it should fix the example given, but I haven't used > viper at all, so if it breaks other things I won't know. > > I haven't managed to work out exactly why the error is happening -- > probably though because the timing of the undo-boundary is somewhat > different, though. With this fix, viper just disables automatic boundary > addition and adds it's own as necessary, which seems cleaner. Thank you. That does indeed fix the case I mentioned. Here are some cases where it does not work as expected: start with an empty buffer in viper-mode type 'i 1 2 3 4 5ESC' type 'F2dw' to delete the 2 and a space. type 'wdw' to delete the 4 and a space. Now, if I were to hit "u" to undo, I would expect that most recent deletion to be undone and the 4 would reappear. Then I would hit '.' to undo the deletion of the '2'. Finally one more '.' would undo the creation of that first line. However, with the current patches, that first 'u' undoes everything and leaves me with the empty initial file. Another example starting with an empty file: Create some content via ':r!seq 999|fmt RETURN' Then remove e.g., "222 " and "444 " via '/222' RET 'dw', then '/444' RET 'dw'. Now, we expect a single 'u' to restore the '444 ', yet it undoes everything, leaving an empty buffer. Hmm... that's probably no different from the first example. One more, then. Starting with this input: 1 2 3 4 5 6 advance to the '2' with 'w', 'dw' to delete the 2, then three '.'s to delete the 3, then 4 and 5. Then begin to undo with 'u', then '.' to repeat it. Those first two work, restoring the 5 and 4. However, one more '.' restores both the 3 and the 2.