unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#63872: [PATCH] `mouse-drag-and-drop-region' sometimes couldn't cut
@ 2023-06-03 13:35 Shynur Xie
  2023-06-03 13:52 ` Shynur Xie
  2023-06-04  0:31 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 9+ messages in thread
From: Shynur Xie @ 2023-06-03 13:35 UTC (permalink / raw)
  To: 63872

[-- Attachment #1: Type: text/plain, Size: 499 bytes --]

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

[-- Attachment #2: 0001-Fix-bug-that-mouse-drag-and-drop-region-couldn-t-cut.patch --]
[-- Type: application/octet-stream, Size: 885 bytes --]

From e6c6d33b3b4f142d475a50c71b011ea0ef0f1533 Mon Sep 17 00:00:00 2001
From: Shynur <one.last.kiss@outlook.com>
Date: Sat, 3 Jun 2023 21:14:41 +0800
Subject: [PATCH] Fix bug that `mouse-drag-and-drop-region' couldn't cut

* lisp/mouse.el (mouse-drag-and-drop-region): Bind
`mark-even-if-inactive' to t locally.
---
 lisp/mouse.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 3c30361ad7d..475b3871348 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -3154,6 +3154,7 @@ is copied instead of being cut."
          ;; System tooltips tend to flicker and in general work
          ;; incorrectly.
          (use-system-tooltips nil)
+         (mark-even-if-inactive t)
          ;; Whether or not some text was ``cut'' from Emacs to another
          ;; program and the cleaanup code should not try modifying the
          ;; region.
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-09-06 12:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-03 13:35 bug#63872: [PATCH] `mouse-drag-and-drop-region' sometimes couldn't cut Shynur Xie
2023-06-03 13:52 ` Shynur Xie
2023-06-04  0:31 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-04  8:38   ` Shynur Xie
2023-06-04  8:48     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]       ` <SN7PR11MB74653C0C276CD27DE0CCD886D74CA@SN7PR11MB7465.namprd11.prod.outlook.com>
2023-06-04 10:50         ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-06 10:57         ` Stefan Kangas
2023-09-06 11:42           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-06 12:07             ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).