all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: tkk@misasa.okayama-u.ac.jp, 37700@debbugs.gnu.org,
	homeros.misasa@gmail.com
Subject: bug#37700: 27.0.50; undo mouse-drag-and-drop-region ineffective
Date: Wed, 30 Oct 2019 15:56:44 -0400	[thread overview]
Message-ID: <jwvzhhij9qa.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <9FE0E2D6-E4EA-4D7C-871C-3483AC53B295@acm.org> ("Mattias \=\?windows-1252\?Q\?Engdeg\=E5rd\=22's\?\= message of "Wed, 30 Oct 2019 20:09:40 +0100")

> 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	other threads:[~2019-10-30 19:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-11 11:51 bug#37700: 27.0.50; undo mouse-drag-and-drop-region ineffective Mattias Engdegård
2019-10-11 12:19 ` martin rudalics
2019-10-11 12:51   ` Mattias Engdegård
2019-10-11 14:43     ` Eli Zaretskii
2019-10-11 17:18       ` Mattias Engdegård
2019-10-11 18:36         ` Eli Zaretskii
2019-10-11 18:51           ` Eli Zaretskii
2019-10-12  8:24           ` martin rudalics
2019-10-11 18:57         ` Eli Zaretskii
2019-10-11 18:26     ` martin rudalics
2019-10-11 19:12       ` Eli Zaretskii
2019-10-12  1:55       ` Tak Kunihiro
2019-10-12  8:24         ` martin rudalics
2019-10-12 16:42           ` Mattias Engdegård
2019-10-12 17:17             ` Eli Zaretskii
2019-10-12 17:53               ` Eli Zaretskii
2019-10-16 15:27                 ` Mattias Engdegård
2019-10-26 10:15                   ` Eli Zaretskii
2019-10-28 20:01                   ` Stefan Monnier
2019-10-30 19:09                     ` Mattias Engdegård
2019-10-30 19:56                       ` Stefan Monnier [this message]
2019-10-31 11:00                         ` Mattias Engdegård
2019-10-31 14:45                           ` Eli Zaretskii
2019-10-31 16:04                             ` Mattias Engdegård
2019-10-31 16:10                               ` Eli Zaretskii
2019-10-31 16:47                                 ` Mattias Engdegård
2019-10-11 12:26 ` Eli Zaretskii
2019-10-11 12:53   ` Mattias Engdegård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvzhhij9qa.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=37700@debbugs.gnu.org \
    --cc=homeros.misasa@gmail.com \
    --cc=mattiase@acm.org \
    --cc=tkk@misasa.okayama-u.ac.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.