[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: Sun, 18 Jan 2004 21:44:55 +0100

On Sat, Jan 17, 2004 at 05:35:19PM +0100, Jan D. wrote:
You can currently drop file names and text.  Files will be opened
and text inserted (at mouse position).  Http urls and such are just
ignored, probably there is something more intelligent one could do,

It should just use an alist of (DND-TYPE . FUNCTION) pairs so the user can define his own preferences (in the case where there's some subtyping, e.g., I see you checking if the data is `some text type', you could look for more specific type in the alist first, and if not found, look for a more generic
supertype like`text').

There is one problem with this, I need to know beforehand what Emacs
is going to to with the URL to tell the drop source if Emacs is accepting the URL or not. Consider dropping text that will be inserted in a buffer.
It is not useful (or easy to make it work correctly) to drop that on the
tool bar, menu bar or scroll bar.  If you have multiple windows in the
frame, it is hard to select the one the user intended.  Also, if the
buffer is read only, we don't want to accept a drop there.  So currently
these kind of drops are not accepted.  But dropping a file on the menu
bar or on a read only buffer window is useful, it justs open the file in a
new window.

So if the user redefines say the uri-list type to insert the text instead,
how can the drop code then know that it is supposed to accept the drop
only in writable buffer windows?

Personally, I'd like URLs to be just inserted, as I _very_ often want to copy
a url from mozilla into a mail message or something, and having such an
alist would make it simple for me to implement this.

I agree that the customizing aspect is important, but I just don't
know how to handle the accept/reject thing.  Maybe we can let the user
put different priorities on types, so for example plain/text is
preferred before plan/uri-list?  That way the text of an URL will
be inserted.

        Jan D.

reply via email to

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