From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry OReilly Newsgroups: gmane.emacs.bugs Subject: bug#16411: undo-only bugs Date: Fri, 14 Feb 2014 13:51:38 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11362860c82e0e04f2624bfb X-Trace: ger.gmane.org 1392403933 9993 80.91.229.3 (14 Feb 2014 18:52:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Feb 2014 18:52:13 +0000 (UTC) Cc: 16411@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 14 19:52:21 2014 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 1WENs3-00041O-69 for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Feb 2014 19:52:19 +0100 Original-Received: from localhost ([::1]:53377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WENs2-0004g2-KY for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Feb 2014 13:52:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WENrt-0004fp-PJ for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 13:52:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WENrn-0005lc-4i for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 13:52:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WENrn-0005lW-0r for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 13:52:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WENrm-0006go-8Y for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 13:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Barry OReilly Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Feb 2014 18:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16411 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16411-submit@debbugs.gnu.org id=B16411.139240390825685 (code B ref 16411); Fri, 14 Feb 2014 18:52:01 +0000 Original-Received: (at 16411) by debbugs.gnu.org; 14 Feb 2014 18:51:48 +0000 Original-Received: from localhost ([127.0.0.1]:52644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WENrX-0006gC-DS for submit@debbugs.gnu.org; Fri, 14 Feb 2014 13:51:48 -0500 Original-Received: from mail-oa0-f50.google.com ([209.85.219.50]:43667) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WENrU-0006fp-VJ for 16411@debbugs.gnu.org; Fri, 14 Feb 2014 13:51:45 -0500 Original-Received: by mail-oa0-f50.google.com with SMTP id n16so15178435oag.9 for <16411@debbugs.gnu.org>; Fri, 14 Feb 2014 10:51:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=NMJsq2UqwP7eKs/OuAyqYKRTHdYUQuWV8fhuqAX/IT4=; b=bzivNzYe4XvDSgmXHJB5fvjshfCIHMOszNK7VRO88Z7Mdwn4Xy66M5GWkjtOOsuHAX ZbiHsKYqqWPnW6NwZ14jnGO4bT5WV27chgYB2ZLIDWAxCCUOjso8XXJnJBGklLUW5/ST 6AV/CJUC+HjlBJGD7GlkmrWKtn2Qx5CIriZSxTFF4SwlFjZmxsb5I/lCQ8tjrc9CiYgP 8Jrz/Ha7t8abuHRJpgnyww91/hinPyR8ZUyWjHsCq9fnFW4GUro9y7bDQpXdDszxUZVn UFGZgzfD+2KJNLaoOKJa3r8VWM355V6peuBrUGENBtu/Waqwh0s2p8V4d5pGqy3kHrzE KTvw== X-Received: by 10.60.229.4 with SMTP id sm4mr8037060oec.9.1392403898967; Fri, 14 Feb 2014 10:51:38 -0800 (PST) Original-Received: by 10.76.21.84 with HTTP; Fri, 14 Feb 2014 10:51:38 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:85594 Archived-At: --001a11362860c82e0e04f2624bfb Content-Type: text/plain; charset=ISO-8859-1 Here's another bug with recipe. Again, each "insert" should be a change group. * ./src/emacs -Q * In *scratch* at least twice: * Insert "aaa" * Undo * Select the entire buffer * Undo in region with prefix-arg 4 * Observe the wrongful deletion of the string: "fer." in the Lisp comment. undo-elt-in-region has a discrepency between whether (TEXT . POSITION) and (BEGIN . END) are in the region: ;; (BEGIN . END) (and (>= (car undo-elt) start) (<= (cdr undo-elt) end)) ^^ ;; (TEXT . POSITION) (and (>= (abs (cdr undo-elt)) start) (< (abs (cdr undo-elt)) end)) ^ One is compared to the end by <= and the other by <. Consequently, (192 . 195) is deemed in the region, (aaa . 192) outside the region. With (aaa . 192) outside the region, all subsequent positions of undo-list-copy are decremented by three, including the next (192 . 195) which becomes (189 . 192). (189 . 192) is deemed in the region, but that's not valid given the restoration of "aaa" was just excluded. It's now pear shaped. I'm collecting these bugs related to the undo system in one bug report because that is the most organized way for me to address them. --001a11362860c82e0e04f2624bfb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Here's another bug with recipe. Again, each "inse= rt" should be a
change group.

  • ./src/emacs -Q  • In *scratch* at least twice:
    • I= nsert "aaa"
    • Undo
  • Select the entire buffer
  • Undo in region with= prefix-arg 4
  • Observe the wrongful deletion of the string:= "fer." in the Lisp
    comment.

undo-el= t-in-region has a discrepency between whether (TEXT . POSITION)
and (BEGIN . END) are in the region:

  ;; (BEGIN . END)
&nbs= p; (and (>=3D (car undo-elt) start)
     &nb= sp; (<=3D (cdr undo-elt) end))
      &n= bsp; ^^

  ;; (TEXT . POSITION)
  (and (>=3D (abs (cd= r undo-elt)) start)
       (< (abs (cdr undo-elt)) end))
&n= bsp;       ^

One is compared to the en= d by <=3D and the other by <. Consequently,
(192 . 195) is deemed = in the region, (aaa . 192) outside the region.
With (aaa . 192) outside = the region, all subsequent positions of
undo-list-copy are decremented by three, including the next (192 .
195) = which becomes (189 . 192). (189 . 192) is deemed in the region,
but that= 's not valid given the restoration of "aaa" was just excluded= .
It's now pear shaped.

I'm collecting these bugs related to t= he undo system in one bug report
because that is the most organized way = for me to address them.

--001a11362860c82e0e04f2624bfb--