GNU bug report logs - #37700
27.0.50; undo mouse-drag-and-drop-region ineffective

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattiase <at> acm.org>

Date: Fri, 11 Oct 2019 11:52:02 UTC

Severity: normal

Found in version 27.0.50

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mattias Engdegård <mattiase <at> acm.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, tkk <at> misasa.okayama-u.ac.jp, homeros.misasa <at> gmail.com, 37700 <at> debbugs.gnu.org
Subject: bug#37700: 27.0.50; undo mouse-drag-and-drop-region ineffective
Date: Thu, 31 Oct 2019 12:00:08 +0100
[Message part 1 (text/plain, inline)]
30 okt. 2019 kl. 20.56 skrev Stefan Monnier <monnier <at> iro.umontreal.ca>:
> 
>> Unfortunately, even with the patch, undoing a drag-and-drop does not leave
>> the region active the way it was before the undo, so the user has to
>> reselect the text in order to try again.
> 
> If the undo-list is built right, reselecting the text should be just
> `C-x C-x`, which isn't that bad.

Right, second nature to the Emacs user, but it would still be nice not having to go through that step. kill-region and delete-selection-mode are similarly affected.

> But now that I think about it, maybe a better option would be to check
> 
>    (when (symbolp last-command)
>      (get last-command 'undo-inhibit-region))
> 
> and then put the `undo-inhibit-region` property on
> `mouse-drag-and-drop-region`.

Thank you, this looks like the best idea so far. A very simple change, yet effective in practice. Not perfect --- last-command is not buffer-local, and even switching to a different frame and back will change it --- but good enough.

Patch attached.

[0001-Inhibit-undo-in-region-for-mouse-drag-region-bug-377.patch (application/octet-stream, attachment)]

This bug report was last modified 5 years and 282 days ago.

Previous Next


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