[Top][All Lists]

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

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

From: Jan D.
Subject: Re: Drag and drop patch for X, please review.
Date: Tue, 20 Jan 2004 16:49:34 +0100

Is there a way that Dired mode could make a local variable binding,
or a local key binding, so as to control this?

    I could add some more events or hooks at various points in the DND
    protocol, but most DND protocols behave differently, so we would
probably get different behaviour when dropping with the XDND protocol
    and when dropping with the Motif protocol.

I am surprised you think it is difficult, because it looks
trivial to me.

+ (global-set-key [drag-n-drop] 'x-dnd-handle-drag-n-drop-event)

If Dired mode makes a local binding for drag-n-drop, won't that
do the job?

Maybe, but then dired would have to have code to handle all the details
of all drag and drop protocols, basically all the code that is in
the new file x-dnd.el and more since I haven't added Motif and OpenWindows
yet.  A drop in XDND involves at least 5 different messages with
different context, i.e. dired would need to handle all of them.  Also,
a Motif drop involves another 3-5 messages, of different contents and
different replies.  Ditto for OpenWindows.
I'd rather have the details of the protocols in one place and the pass
on the result of the drop to other parts of Emacs. The TEST-FUN suggestion
is a way forward, I don't think dired needs to do more than that to be
able to handle move and copy correctly.

Thinking about it, it would actually not do the job. Because if the drag
enters Emacs in a non-dired buffer, dired would not see the XdndEnter
message.  Later on when the mouse travels to a dired buffer, dired would
just see a XdndPosition message, and that is not enough. Also, we are not
selecting the buffers that the mouse travels over when doing a drop,
so a local binding would have no effect if another buffer
is selected when the drag starts.

The reason for not selecting the buffer the mouse is over is that a drag
can be aborted, and if the drag enters the selected buffer and leaves from
another buffer it would be confusing to have changed the selected buffer
just because the mouse happend to travel over it.

        Jan D.

reply via email to

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