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: Fri, 24 Nov 2017 10:02:52 +0100

> I meant I need to spend significant time to make secondary-overlay
> option.  I have started to fix things from easy ones.

Do you mean that it's difficult to make the code work if it does not use
the secondary overlay?  I don't understand why, instead of perusing the
secondary overlay, you don't use your own overlay to indicate start and
end of the text you cut or copy.  When done with the operation or when
an error occurs during dragging, you simply remove that overlay.  In
addition, you can define a face the user can customize in order to
highlight that overlay.  This way, any secondary overlay that existed
already when the user started dragging would be just left alone.

> How to show insert point?

I think that by default the insert point should be shown by the mouse
cursor alone.  Personally, I'd also prefer that when the original
position of point is scrolled off-screen, the normal cursor should not
be shown at all because it's by no means sure that it will stay there
after the drop occurred: If the drop happens in another buffer, you
restore the original point to where it was before.  Note that this is
not the case with `mouse-drag-region' which always leaves the normal
cursor at its last position even after the window was auto-scrolled.

Optionally, I see no problem showing the normal cursor just as
`mouse-drag-region' does, maybe with some customizable cursor type (I
think "bar" would give a better feeling than "box").

> Do you mean restore active cursor back to source text?

When an error occurs, definitely so.  Then you should do what you do
when the drop happens in another buffer.  Maybe in these cases you
additionally should restore the window start position too, so that the
user can start from where she left off.  If you restore the window's
point only as you do now, then the region will be often partially
off-screen (at least here) although it was on-screen before.

When everything "goes well", point obviously will go to the position of
the inserted text.  Although when the drop happens in another window
showing the same buffer, it might be interesting to restore the source
window's state just as if the drop happened in another buffer.

> When an Icon of c:/runemacs.exe is dragged to d:/, copy.  When an Icon
> of c:/runemacs.exe is dragged to c:/emacs-26.0.90/bin, cut.

I see what you mean now but I doubt that many users of
`mouse-drag-and-drop-region' will be aware of such an analogy.

> I think the patch covered that.  The approach is to overwrite
> mouse-drag-and-drop-region-show-tooltip locally.
>
>   (let ((mouse-drag-and-drop-region-show-tooltip
>           (and mouse-drag-and-drop-region-show-tooltip
>                (display-multi-frame-p)
>                (require 'tooltip)))

You're right.  I apparently missed that.

> I think that there are two significant TODOs.
> - Make drag robust using condition-case

Definitely.

> - Make secondary-overlay option

This would be nice to have.

Thank you, martin



reply via email to

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