GNU bug report logs - #18412
24.3.93 regression: undo boundary inserted by delete-selection-mode (CUA)

Previous Next

Package: emacs;

Reported by: David Reitter <david.reitter <at> gmail.com>

Date: Fri, 5 Sep 2014 16:38:02 UTC

Severity: normal

Tags: wontfix

Found in version 24.3.93

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 18412 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: David Reitter <david.reitter <at> gmail.com>
Cc: 18412 <at> debbugs.gnu.org
Subject: Re: bug#18412: 24.3.93 regression: undo boundary inserted by
 delete-selection-mode (CUA)
Date: Sun, 07 Sep 2014 22:04:29 -0400
> This is a regression in the 24.4 pretest compared to 24.3.
> M-x cua-mode
> (enter and) select a word “hello", e.g., via double-click
> enter single char, e.g., “x”
> C-_   (undo)
> In Emacs 24.3, the undo will restore “hello”.
> In Emacs 24.3.93 pretest, the undo will only delete “x”, but not
> restore “hello”.
> An undo boundary is present in buffer-undo-list between the
>  delete-selection step and the insertion of “x”.

Indeed, that's a difference between delete-selection-mode and cua's
earlier reimplementation of the feature.

To the extent that noone complained about it for delete-selection-mode,
I think this bug is not super-urgent to fix.  IOW, we should take the
time to think how to fix it right.

> Looking at how self-insert-command deletes the undo boundary to merge
> itself, we can either prevent the undo boundary from being inserted (I
> couldn’t figure out where that happens), or pretend that the
> delete-selection action was a self-insert-command.  The patch below is
> a proof of concept.

The undo-boundary is added by command_loop_1 in keyboard.c just before
calling command_execute.  Maybe the right fix is to change it so it's
push before running pre-command-hook?

Of course, maybe an even better fix is to change delete-selection-mode
so it doesn't rely on pre-command-hook.


        Stefan




This bug report was last modified 4 years and 256 days ago.

Previous Next


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