* bug#31905: detection of edge of highlighted text by mouse-drag-and-drop-region
@ 2018-06-19 23:25 Tak Kunihiro
2018-06-20 7:42 ` martin rudalics
0 siblings, 1 reply; 3+ messages in thread
From: Tak Kunihiro @ 2018-06-19 23:25 UTC (permalink / raw)
To: 31905; +Cc: tkk
[-- Attachment #1: Type: Text/Plain, Size: 797 bytes --]
I found bug on `mouse-drag-and-drop-region'. The
`mouse-drag-and-drop-region' does not recognize the beginning and the
end of highlighted text as pre existing region.
1: emacs -Q
2: (setq mouse-drag-and-drop-region 'meta)
2: Select text on a buffer and have a region. Let's assume `This buffer' is highlighted.
3: Drag and drop the text onto the first character of the region, that is `T'.
4: Then the text `This buffer' would be disappeared.
I attach a patch to fix the bug. This patch is relative to 26.1.50.
* Commit log
Author: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
Fix bug of 'mouse-drag-and-drop-region' to detect edges of region
* lisp/mouse.el
(mouse-drag-and-drop-region): Detect both the beginning and the
end of character of region during dragging text.
[-- Attachment #2: mouse.el.diff --]
[-- Type: Text/X-Patch, Size: 701 bytes --]
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 5c9056fb43..f749d12054 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -2515,9 +2515,9 @@ mouse-drag-and-drop-region
(setq drag-but-negligible
(and (eq (overlay-buffer mouse-drag-and-drop-overlay)
buffer-to-paste)
- (< (overlay-start mouse-drag-and-drop-overlay)
+ (<= (overlay-start mouse-drag-and-drop-overlay)
point-to-paste)
- (< point-to-paste
+ (<= point-to-paste
(overlay-end mouse-drag-and-drop-overlay)))))
;; Show a tooltip.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#31905: detection of edge of highlighted text by mouse-drag-and-drop-region
2018-06-19 23:25 bug#31905: detection of edge of highlighted text by mouse-drag-and-drop-region Tak Kunihiro
@ 2018-06-20 7:42 ` martin rudalics
2018-06-20 23:17 ` bug#31905: " Tak Kunihiro
0 siblings, 1 reply; 3+ messages in thread
From: martin rudalics @ 2018-06-20 7:42 UTC (permalink / raw)
To: Tak Kunihiro; +Cc: 31905
> I found bug on `mouse-drag-and-drop-region'. The
> `mouse-drag-and-drop-region' does not recognize the beginning and the
> end of highlighted text as pre existing region.
>
> 1: emacs -Q
> 2: (setq mouse-drag-and-drop-region 'meta)
> 2: Select text on a buffer and have a region. Let's assume `This buffer' is highlighted.
> 3: Drag and drop the text onto the first character of the region, that is `T'.
> 4: Then the text `This buffer' would be disappeared.
Indeed.
> I attach a patch to fix the bug. This patch is relative to 26.1.50.
I verified that it corrects the behavior and applied it to the release
branch. Please countercheck and close the bug if everything is right.
Thank you, martin
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#31905: Re: detection of edge of highlighted text by mouse-drag-and-drop-region
2018-06-20 7:42 ` martin rudalics
@ 2018-06-20 23:17 ` Tak Kunihiro
0 siblings, 0 replies; 3+ messages in thread
From: Tak Kunihiro @ 2018-06-20 23:17 UTC (permalink / raw)
To: rudalics; +Cc: 31905, tkk
tags 31905 fixed
close 31905 26.2
quit
From: martin rudalics <rudalics@gmx.at>
Subject: Re: detection of edge of highlighted text by mouse-drag-and-drop-region
Date: Wed, 20 Jun 2018 09:42:47 +0200
>> I found bug on `mouse-drag-and-drop-region'. The
>> `mouse-drag-and-drop-region' does not recognize the beginning and the
>> end of highlighted text as pre existing region.
>>
>> 1: emacs -Q
>> 2: (setq mouse-drag-and-drop-region 'meta)
>> 2: Select text on a buffer and have a region. Let's assume `This
>> buffer' is highlighted.
>> 3: Drag and drop the text onto the first character of the region, that
>> is `T'.
>> 4: Then the text `This buffer' would be disappeared.
>
> Indeed.
>
>> I attach a patch to fix the bug. This patch is relative to 26.1.50.
>
> I verified that it corrects the behavior and applied it to the release
> branch. Please countercheck and close the bug if everything is right.
>
> Thank you, martin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-20 23:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-19 23:25 bug#31905: detection of edge of highlighted text by mouse-drag-and-drop-region Tak Kunihiro
2018-06-20 7:42 ` martin rudalics
2018-06-20 23:17 ` bug#31905: " Tak Kunihiro
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).