GNU bug report logs - #16411
undo-only bugs

Previous Next

Package: emacs;

Reported by: Barry OReilly <gundaetiapo <at> gmail.com>

Date: Fri, 10 Jan 2014 22:34:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Barry OReilly <gundaetiapo <at> gmail.com>
Cc: 16411 <at> debbugs.gnu.org
Subject: bug#16411: undo-only bugs
Date: Fri, 14 Feb 2014 13:51:38 -0500
[Message part 1 (text/plain, inline)]
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.
[Message part 2 (text/html, inline)]

This bug report was last modified 10 years and 361 days ago.

Previous Next


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