emacs-devel
[Top][All Lists]
Advanced

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

Re: Drag and drop patch for X, please review.


From: Stefan Monnier
Subject: Re: Drag and drop patch for X, please review.
Date: 20 Jan 2004 13:41:18 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> The problem is more figuring out where the mouse is, i.e. menu bar, scroll
> bar or tool bar.

Wait.... you're doing it in elisp, right?  That's the problem.
You first need to export the C code that does it.

> matter.  It may not be a complex thing, but all these events must
> interract so that if a drop starts with [menu-bar dnd], then enters
> a window, i.e. [dnd], and then exits via a [scroll-bar dnd], the global
> data needed for the drop must be synchronized so that it is
> correctly updated.

I must admit that I don't understand what you mean by a drop "starting"
somewhere and "exiting" somewhere else.  My understand of a drop is "release
the mouse button" which is instantaneous.

Or are you talking about the drag part and saying that Emacs should somehow
highlight the object to which the drop is going to apply ?

> I don't feel comfortable with accepting a drop and then signal an error.
> I think this goes a bit against the "spirit" of drag and drop in a small
> way.  The reason why the source of the drop gives a list of types and
> a suggested action (copy, move etc.) at the start of the drop is just
> so that the target can decide if to accept the drop or not.

Obviously, if there's no binding for the drop event at the drop location,
you should not accept the drop action.  So view-mode could explicily unbind
the drop event, for example.

Or the keymap bindings could be to commands that have to first call
a `dnd-accept' function to get the actual text to insert.  This accept
function could take arguments to indicate which kind of drop is being
accepted, ...

> Also, many programs (all GTK for example) have a visual indicator to
> show if the drop can be made or not where the mouse is.

With the generality of elisp you indeed can't do it 100%, but you can
approximate it using things like "is there a binding for dnd-drop here?".


        Stefan




reply via email to

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