GNU bug report logs - #63872
[PATCH] `mouse-drag-and-drop-region' sometimes couldn't cut

Previous Next

Package: emacs;

Reported by: Shynur Xie <one.last.kiss <at> outlook.com>

Date: Sat, 3 Jun 2023 13:41:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 63872 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#63872; Package emacs. (Sat, 03 Jun 2023 13:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Shynur Xie <one.last.kiss <at> outlook.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 03 Jun 2023 13:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Shynur Xie <one.last.kiss <at> outlook.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: [PATCH] `mouse-drag-and-drop-region' sometimes couldn't cut
Date: Sat, 3 Jun 2023 13:35:28 +0000
[Message part 1 (text/plain, inline)]
The function `mouse-drag-and-drop-region' couldn't cut/move the
selected region when `mark-even-if-inactive' is t.

Say execute `emacs -Q` then evaluate
    (custom-set-variables
     '(mark-even-if-inactive nil)
     '(mouse-drag-and-drop-region t))
When I use mouse to drag and drop a selected region, the region is not
cut and pasted; it is copied and pasted instead.

The attached patch binds `mark-even-if-inactive' to t within the body
of `mouse-drag-and-drop-region'.

--
shynur
[0001-Fix-bug-that-mouse-drag-and-drop-region-couldn-t-cut.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63872; Package emacs. (Sat, 03 Jun 2023 13:53:01 GMT) Full text and rfc822 format available.

Message #8 received at 63872 <at> debbugs.gnu.org (full text, mbox):

From: Shynur Xie <one.last.kiss <at> outlook.com>
To: "63872 <at> debbugs.gnu.org" <63872 <at> debbugs.gnu.org>
Subject: Re: [PATCH] `mouse-drag-and-drop-region' sometimes couldn't cut
Date: Sat, 3 Jun 2023 13:52:02 +0000
A typo in line 2:

> selected region when `mark-even-if-inactive' is t.
                                                  ^
                                         should be "nil" here



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63872; Package emacs. (Sun, 04 Jun 2023 00:32:02 GMT) Full text and rfc822 format available.

Message #11 received at 63872 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Shynur Xie <one.last.kiss <at> outlook.com>
Cc: 63872 <at> debbugs.gnu.org
Subject: Re: bug#63872: [PATCH] `mouse-drag-and-drop-region' sometimes
 couldn't cut
Date: Sun, 04 Jun 2023 08:31:31 +0800
Shynur Xie <one.last.kiss <at> outlook.com> writes:

> When I use mouse to drag and drop a selected region, the region is not
> cut and pasted; it is copied and pasted instead.

With transient-mark-mode on or off?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63872; Package emacs. (Sun, 04 Jun 2023 08:39:01 GMT) Full text and rfc822 format available.

Message #14 received at 63872 <at> debbugs.gnu.org (full text, mbox):

From: Shynur Xie <one.last.kiss <at> outlook.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: "63872 <at> debbugs.gnu.org" <63872 <at> debbugs.gnu.org>
Subject: Re: bug#63872: [PATCH] `mouse-drag-and-drop-region' sometimes
 couldn't cut
Date: Sun, 4 Jun 2023 08:38:45 +0000
> From: Po Lu
> Date: Sun, 04 Jun 2023 08:31:31 +0800
>   To: Shynur
>
>> When I use mouse to drag and drop a selected region, the region is
>> not cut and pasted; it is copied and pasted instead.
>
> With transient-mark-mode on or off?

On, by default.  I used `-Q` to launch Emacs.

(I forgot to CC the last email, my apologies.  I am resending it now.)



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63872; Package emacs. (Sun, 04 Jun 2023 08:49:02 GMT) Full text and rfc822 format available.

Message #17 received at 63872 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Shynur Xie <one.last.kiss <at> outlook.com>
Cc: "63872 <at> debbugs.gnu.org" <63872 <at> debbugs.gnu.org>
Subject: Re: bug#63872: [PATCH] `mouse-drag-and-drop-region' sometimes
 couldn't cut
Date: Sun, 04 Jun 2023 16:48:00 +0800
Shynur Xie <one.last.kiss <at> outlook.com> writes:

>> From: Po Lu
>> Date: Sun, 04 Jun 2023 08:31:31 +0800
>>   To: Shynur
>>
>>> When I use mouse to drag and drop a selected region, the region is
>>> not cut and pasted; it is copied and pasted instead.
>>
>> With transient-mark-mode on or off?
>
> On, by default.  I used `-Q` to launch Emacs.

Right.  Have you looked at the option
`mouse-drag-and-drop-region-cut-when-buffers-differ'?  I believe you're
experiencing intentional behavior: by default, text is copied when the
buffer which receives the drop is different from its source.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63872; Package emacs. (Sun, 04 Jun 2023 09:04:02 GMT) Full text and rfc822 format available.

Message #20 received at 63872 <at> debbugs.gnu.org (full text, mbox):

From: Shynur Xie <one.last.kiss <at> outlook.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: "63872 <at> debbugs.gnu.org" <63872 <at> debbugs.gnu.org>
Subject: Re: bug#63872: [PATCH] `mouse-drag-and-drop-region' sometimes
 couldn't cut
Date: Sun, 4 Jun 2023 09:03:07 +0000
[Message part 1 (text/plain, inline)]
> From: Po Lu
> Date: Sun, 04 Jun 2023 16:48:00 +0800
>   To: Shynur
>
> I believe you're experiencing intentional behavior: by default, text
> is copied when the buffer which receives the drop is different from
> its source.

The destination buffer is the original buffer.  I attached an MP4.

--
shynur
[bug63872-1.mp4 (video/mp4, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63872; Package emacs. (Sun, 04 Jun 2023 10:51:02 GMT) Full text and rfc822 format available.

Message #23 received at 63872 <at> debbugs.gnu.org (full text, mbox):

From: Ruijie Yu <ruijie <at> netyu.xyz>
To: Shynur Xie <one.last.kiss <at> outlook.com>
Cc: Po Lu <luangruo <at> yahoo.com>, 63872 <at> debbugs.gnu.org
Subject: Re: bug#63872: [PATCH] `mouse-drag-and-drop-region' sometimes
 couldn't cut
Date: Sun, 4 Jun 2023 18:50:09 +0800
On Jun 4, 2023, at 17:04, Shynur Xie <one.last.kiss <at> outlook.com> wrote:
> 
> 
>> 
>> From: Po Lu
>> Date: Sun, 04 Jun 2023 16:48:00 +0800
>>  To: Shynur
>> 
>> I believe you're experiencing intentional behavior: by default, text
>> is copied when the buffer which receives the drop is different from
>> its source.
> 
> The destination buffer is the original buffer.  I attached an MP4.
> 
> --
> shynur
> <bug63872-1.mp4>

Next time, please compress your attachments when they are large (> 1MB).  :)

-- 
Best,


RY




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63872; Package emacs. (Wed, 06 Sep 2023 10:58:02 GMT) Full text and rfc822 format available.

Message #26 received at 63872 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Shynur Xie <one.last.kiss <at> outlook.com>
Cc: Po Lu <luangruo <at> yahoo.com>, "63872 <at> debbugs.gnu.org" <63872 <at> debbugs.gnu.org>
Subject: Re: bug#63872: [PATCH] `mouse-drag-and-drop-region' sometimes
 couldn't cut
Date: Wed, 6 Sep 2023 03:57:46 -0700
Shynur Xie <one.last.kiss <at> outlook.com> writes:

>> From: Po Lu
>> Date: Sun, 04 Jun 2023 16:48:00 +0800
>>   To: Shynur
>>
>> I believe you're experiencing intentional behavior: by default, text
>> is copied when the buffer which receives the drop is different from
>> its source.
>
> The destination buffer is the original buffer.  I attached an MP4.

The video shows that text is copied also when the buffer which receives
the drop is the same as the source buffer.

Is that the intended behavior?  It seems off, to me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63872; Package emacs. (Wed, 06 Sep 2023 11:43:02 GMT) Full text and rfc822 format available.

Message #29 received at 63872 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Shynur Xie <one.last.kiss <at> outlook.com>,
 "63872 <at> debbugs.gnu.org" <63872 <at> debbugs.gnu.org>
Subject: Re: bug#63872: [PATCH] `mouse-drag-and-drop-region' sometimes
 couldn't cut
Date: Wed, 06 Sep 2023 19:42:24 +0800
Stefan Kangas <stefankangas <at> gmail.com> writes:

> The video shows that text is copied also when the buffer which receives
> the drop is the same as the source buffer.
>
> Is that the intended behavior?  It seems off, to me.

I can't download that attachment, so would you please summarize its
contents?  The important detail is whether the destination window is the
same as the source.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63872; Package emacs. (Wed, 06 Sep 2023 12:08:01 GMT) Full text and rfc822 format available.

Message #32 received at 63872 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Shynur Xie <one.last.kiss <at> outlook.com>,
 "63872 <at> debbugs.gnu.org" <63872 <at> debbugs.gnu.org>
Subject: Re: bug#63872: [PATCH] `mouse-drag-and-drop-region' sometimes
 couldn't cut
Date: Wed, 6 Sep 2023 05:07:15 -0700
Po Lu <luangruo <at> yahoo.com> writes:

> Stefan Kangas <stefankangas <at> gmail.com> writes:
>
>> The video shows that text is copied also when the buffer which receives
>> the drop is the same as the source buffer.
>>
>> Is that the intended behavior?  It seems off, to me.
>
> I can't download that attachment, so would you please summarize its
> contents?  The important detail is whether the destination window is the
> same as the source.

I can reproduce this on current master with the following steps:

0. emacs -Q
1. Evaluate this in *scratch*:

    (custom-set-variables
     '(mark-even-if-inactive nil)
     '(mouse-drag-and-drop-region t))

2. Mark some text with the mouse, and then drag and drop it into the
   same window.

The result is that the text is copied.  This is also what happens in the
video.

In GNU Emacs 30.0.50 (build 12, x86_64-apple-darwin21.6.0, NS
 appkit-2113.60 Version 12.6.8 (Build 21G725)) of 2023-09-06 built on
 MY-MacBook-Pro
Repository revision: c3584bb3ab6f442a837464e191182f713acc3be3
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.6.8

Configured features:
ACL GIF GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS
PDUMPER PNG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP
XIM ZLIB




This bug report was last modified 1 year 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.