unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
To: 31905@debbugs.gnu.org
Cc: tkk@misasa.okayama-u.ac.jp
Subject: bug#31905: detection of edge of highlighted text by mouse-drag-and-drop-region
Date: Wed, 20 Jun 2018 08:25:41 +0900 (JST)	[thread overview]
Message-ID: <20180620.082541.1223268284350863328.tkk@misasa.okayama-u.ac.jp> (raw)

[-- 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.

             reply	other threads:[~2018-06-19 23:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19 23:25 Tak Kunihiro [this message]
2018-06-20  7:42 ` bug#31905: detection of edge of highlighted text by mouse-drag-and-drop-region martin rudalics
2018-06-20 23:17   ` bug#31905: " Tak Kunihiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180620.082541.1223268284350863328.tkk@misasa.okayama-u.ac.jp \
    --to=tkk@misasa.okayama-u.ac.jp \
    --cc=31905@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).