GNU bug report logs - #31905
detection of edge of highlighted text by mouse-drag-and-drop-region

Previous Next

Package: emacs;

Reported by: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>

Date: Tue, 19 Jun 2018 23:50:01 UTC

Severity: normal

Tags: fixed

Fixed in version 26.2

Done: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31905 in the body.
You can then email your comments to 31905 AT debbugs.gnu.org in the normal way.

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#31905; Package emacs. (Tue, 19 Jun 2018 23:50:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 19 Jun 2018 23:50:02 GMT) Full text and rfc822 format available.

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

From: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
To: bug-gnu-emacs <at> gnu.org
Cc: rudalics <at> gmx.at, tkk <at> misasa.okayama-u.ac.jp
Subject: detection of edge of highlighted text by mouse-drag-and-drop-region
Date: Wed, 20 Jun 2018 08:25:41 +0900 (JST)
[Message part 1 (text/plain, inline)]
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 <at> 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.
[mouse.el.diff (text/x-patch, inline)]
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.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31905; Package emacs. (Wed, 20 Jun 2018 07:44:02 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
Cc: 31905 <at> debbugs.gnu.org
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31905; Package emacs. (Wed, 20 Jun 2018 23:19:02 GMT) Full text and rfc822 format available.

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

From: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
To: rudalics <at> gmx.at
Cc: 31905 <at> debbugs.gnu.org, tkk <at> misasa.okayama-u.ac.jp
Subject: bug#31905: Re: detection of edge of highlighted text by
 mouse-drag-and-drop-region
Date: Thu, 21 Jun 2018 08:17:54 +0900 (JST)
tags 31905 fixed
close 31905 26.2
quit

From: martin rudalics <rudalics <at> 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




Added tag(s) fixed. Request was from Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp> to control <at> debbugs.gnu.org. (Thu, 21 Jun 2018 04:48:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 26.2, send any further explanations to 31905 <at> debbugs.gnu.org and Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp> Request was from Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp> to control <at> debbugs.gnu.org. (Thu, 21 Jun 2018 04:48:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 19 Jul 2018 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 331 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.