From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#37700: 27.0.50; undo mouse-drag-and-drop-region ineffective Date: Wed, 30 Oct 2019 15:56:44 -0400 Message-ID: References: <3311689D-B1DF-4BAC-86BA-E3D2C6D2ECF1@acm.org> <94D2DE0C-8BD0-4CCF-B77D-5606A1D227DD@acm.org> <5be797bb-9d6b-cebe-edf4-21b4a5944595@gmx.at> <60b5bfa7-0aaf-40c0-3a1d-d0c0c5c662c6@gmx.at> <354ABF35-C5D0-4045-B9F0-5615A64408E6@acm.org> <83k199nasx.fsf@gnu.org> <83ftjxn94q.fsf@gnu.org> <37DDF48D-FC37-47A8-8CEC-C6EB66AB2BF7@acm.org> <9FE0E2D6-E4EA-4D7C-871C-3483AC53B295@acm.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="173809"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: tkk@misasa.okayama-u.ac.jp, 37700@debbugs.gnu.org, homeros.misasa@gmail.com To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 30 21:55:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iPuzn-000j3u-AC for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Oct 2019 21:55:11 +0100 Original-Received: from localhost ([::1]:44302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPuzm-0004i1-5O for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Oct 2019 16:55:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47568) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPu5X-0002PX-67 for bug-gnu-emacs@gnu.org; Wed, 30 Oct 2019 15:57:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPu5V-0000g2-VZ for bug-gnu-emacs@gnu.org; Wed, 30 Oct 2019 15:57:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42714) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iPu5V-0000fu-SI for bug-gnu-emacs@gnu.org; Wed, 30 Oct 2019 15:57:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iPu5V-0008A6-N3 for bug-gnu-emacs@gnu.org; Wed, 30 Oct 2019 15:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Oct 2019 19:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37700 X-GNU-PR-Package: emacs Original-Received: via spool by 37700-submit@debbugs.gnu.org id=B37700.157246541531360 (code B ref 37700); Wed, 30 Oct 2019 19:57:01 +0000 Original-Received: (at 37700) by debbugs.gnu.org; 30 Oct 2019 19:56:55 +0000 Original-Received: from localhost ([127.0.0.1]:51535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iPu5O-00089j-Un for submit@debbugs.gnu.org; Wed, 30 Oct 2019 15:56:55 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:46111) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iPu5N-00089U-4E for 37700@debbugs.gnu.org; Wed, 30 Oct 2019 15:56:53 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id AFD7044965E; Wed, 30 Oct 2019 15:56:47 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 61520449659; Wed, 30 Oct 2019 15:56:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1572465406; bh=iumOh54ClUUlsf5pkFDqNyjNiYUUpnhJGjWqkrjaNG8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=QY2WUWjeinC2DQqVuYGEAQx93DlH1t13dEItvHX1fI1C0F9x73Jr79qz1fIfynvBR bEx5sJQHXT+QzgOFAhJE77Whv+3Mab7Te4czNuJ5pEmeqdFrLgtSsTB3D0pTWTiQgO sOKsqVe9D0k4uzsIfOGjYWCmvWvvFGOf562PE8XL/aTEK9+zSeW8FYkpO4iP4ugC1E dft6N/piI3AqKmxIcewJ19tNU21uddqQPtdjFbE1qp8TU3Jp8LVY6O9iaS0BpScRG4 KrPmYg8DGDutCbt9l76jqQKUnKZIqoEUK28aFw3HNWnEClqTEcqAOPaY+XFDWejWYK 4ZswTbyznS/JQ== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 23DAB12066A; Wed, 30 Oct 2019 15:56:46 -0400 (EDT) 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") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170452 Archived-At: > 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