bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#37700: 27.0.50; undo mouse-drag-and-drop-region ineffective


From: Stefan Monnier
Subject: bug#37700: 27.0.50; undo mouse-drag-and-drop-region ineffective
Date: Wed, 30 Oct 2019 15:56:44 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> 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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]