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: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Mattias Engdegård <mattiase <at> acm.org>
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: Wed, 30 Oct 2019 15:56:44 -0400
> 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.

> Partly because of this, I believe that providing an option to disable
> undo-in-region altogether is a better solution.

I agree that disabling it right after a drag-and-drop is a better choice.

> I'm not sure how that would be done in practice since 'undo-elt-in-region'
> is nil for any (apply ...) element.  This could be remedied, of course, but
> that would entail undo machinery changes which we wanted to avoid in the
> first place.

Yes, that's a long-standing missing feature, but I think it's orthogonal
to the current problem.

> In addition, it is unclear how the 'apply' mechanism could be used in
> a way that is sensitive to whether it's the first record to be undone.

With ad-hoc code looking for it at the beginning of `undo`.

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`.

Of course, I wouldn't oppose adding

    (defcustom undo-use-region-when-active t ...)
    
so users can turn it off, but I think it's more important to make sure
that users never need to set such a var to nil.


        Stefan





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

Previous Next


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