emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mouse-drag-and-drop-region


From: martin rudalics
Subject: Re: mouse-drag-and-drop-region
Date: Sat, 16 Dec 2017 10:42:10 +0100

> During the drag, when mouse point is on the original region, cursor
> would be set to hollow.  With this revision, I see that the cursor is
> not set.

Right.

> To do it, drag-but-negligible should be set to t.  The
> drag-but-negligible is set by following expressions.
>
> 2507        ;; Check if "drag but negligible".  Operation "drag but
> 2508        ;; negligible" is defined as drag-and-drop the text to
> 2509        ;; the original region.  When modifier is pressed, the
> 2510        ;; text will be inserted to inside of the original
> 2511        ;; region.
> 2512        (setq drag-but-negligible
> 2513              (member mouse-drag-and-drop-region
> 2514                      (mapcar (lambda (xxx) (overlay-get xxx 'face))
> 2515                              (overlays-at point-to-paste)))))
>
> On this revision, I wonder if mouse-drag-and-drop-region on line 2513
> refers to variable instead of face.  No?

Right again.  What about directly checking the overlay boundaries
instead as in the attached patch which appears cleaner than to rely on
face properties?  Note that this way a user can also insert the text
immediately before the original region which IIUC is not possible with
the original behavior.

Maybe we should also call the face `mouse-drag-and-drop-highlight' so
that there is less confusion.  OT1H faces should not end with the
postfix "-face" and OTOH the simple variable you used initially had a
user rely on predefined faces only which is an unnecessary restriction.
Some users might dislike `region' and `secondary-selection' here.

And please go over the entire text once again so that lines are no more
longer than 80 characters at most (I already tried that in some cases).

Thanks, martin

Attachment: mouse.el.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]