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.

Full log


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.

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

Previous Next


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