all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jan D." <jan.h.d@swipnet.se>
Cc: emacs-devel@gnu.org
Subject: Re: Drag and drop patch for X, please review.
Date: Mon, 19 Jan 2004 22:14:00 +0100	[thread overview]
Message-ID: <66F4EDBB-4AC4-11D8-BCBC-00039363E640@swipnet.se> (raw)
In-Reply-To: <E1Aifkf-0005MW-HW@fencepost.gnu.org>

>
>     If we know the target is a dired buffer, we can then accept the
>     action that the source sends us (XdndActionCopy or XdndActionMove)
>     instead of always using XdndActionPrivate and to the right thing
>     for each action.
>
> It should be easy to tell whether the buffer it was dropped into
> is a Dired buffer.  But that is not the most elegant solution.
>
> 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.

Also, I don't want the protocols internals to be exposed too much, just
to be able to handle different protocols and future protocol changes 
better.

The way XDND works is basically it sends a XdndPosition to the target
(Emacs).  The XdndPosition contains the suggested action for the drop
(Move, Copy or Ask).  The target then reads available types for the drop
data, and determines if it wants to accept the suggested action, or
change it (Emacs always uses Private, which means, I'm doing something
that is special and don't affect the original data).  The target 
answers with
a XdndStatus message which tells the source if the drop is accepted and
if accepted, the action the target will take.

Later on, the source sends a XdndDrop message.  Then the target can read
the drop data and replies with a XdndFinished message that tells the 
source
if the drop was successful or not.

Now, if the mouse moves from a ordinary buffer to a dired buffer,
we need to change the action in the XdndStatus message.  And if it moves
out of the dired buffer, the action must be changed again.

Probably some buffer local variable could be used to influence the
actions chosen, but that would mean that dired would have to have
knowledge on the DND protocol.  The TEST-FUN suggested could be extended
to take the proposed action and return the preferred action.  So then
the alist could be made buffer local for dired buffers.

>
>     The types text/uri-list, text/x-moz-url, FILE_NAME and 
> _NETSCAPE_URL all
>     can have file:// URLs.  text/uri-list is the one XDND and the
>     freedesktop
>     organization wants everybody to use.  text/x-moz-url is used by 
> mozilla
>     and newer netscape.
>
> In modern systems, do the directory browsers use text/uri-list?
> If so, it is vital that Dired handle it right.

Yes, it is used by Gnome and KDE file browsers.

>
>       If you have multiple windows in the
>>> frame, it is hard to select the one the user intended.
>
> What is the difficulty?  Can you tell the position at which the drop
> occurred?  If so, is it hard to find the window containing that 
> position?

If the frame is split vertically and text is dropped on the menu bar, 
there
is a bit coordinate calculations to be made to determine which window
to use.  Not impossible, but quite elaborate for just a small benefit.
I kind of like the suggestion to push it in the kill buffer and display
a message about it.

	Jan D.

  reply	other threads:[~2004-01-19 21:14 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-17 16:35 Drag and drop patch for X, please review Jan D.
2004-01-17 20:20 ` David Kastrup
2004-01-18 20:22   ` Jan D.
2004-01-18 21:50     ` Kim F. Storm
2004-01-18 21:09       ` Jan D.
2004-01-18  0:40 ` Miles Bader
2004-01-18 20:44   ` Jan D.
2004-01-18 21:34     ` Kai Grossjohann
2004-01-18 21:55       ` Jan D.
2004-01-18 23:08         ` Miles Bader
2004-01-19 20:12           ` Richard Stallman
2004-01-19 20:43           ` Jan D.
2004-01-20  2:34             ` Miles Bader
2004-01-19 20:49           ` Jan D.
2004-01-18 22:10     ` Kim F. Storm
2004-01-18 21:14       ` Jan D.
2004-01-19 18:24     ` Stefan Monnier
2004-01-19 20:47       ` Jan D.
2004-01-19 23:35         ` Jason Rumney
2004-01-19 23:50           ` Jan D.
2004-01-20 15:52         ` Stefan Monnier
2004-01-20 16:05           ` Jan D.
2004-01-20 18:41             ` Stefan Monnier
2004-01-20 20:50               ` Jan D.
2004-01-20 21:12                 ` Stefan Monnier
2004-01-20 21:27                   ` Jan D.
2004-01-20 22:09                     ` Stefan Monnier
2004-01-20 22:28                       ` Jan D.
2004-01-20 23:38                         ` Stefan Monnier
2004-01-21 21:08                 ` Richard Stallman
2004-01-21 22:30                   ` Jan D.
2004-01-22 10:19                     ` Kim F. Storm
2004-01-22  9:46                       ` Jan D.
2004-01-22 11:32                         ` Kim F. Storm
2004-01-23 18:25                         ` Richard Stallman
2004-01-23 20:05                           ` Jan D.
2004-01-24 21:39                             ` Richard Stallman
2004-01-18 19:14 ` Richard Stallman
2004-01-18 21:02   ` Jan D.
2004-01-19 20:12     ` Richard Stallman
2004-01-19 21:14       ` Jan D. [this message]
2004-01-20 15:31         ` Richard Stallman
2004-01-20 15:49           ` Jan D.
2004-01-21 21:09             ` Richard Stallman
2004-01-21 22:22               ` Jan D.
2004-01-22 19:00                 ` Richard Stallman
2004-01-22 19:27                   ` Jan D.
2004-01-20 16:02         ` Stefan Monnier
2004-01-20 16:24           ` Jan D.
2004-01-20 18:43             ` Stefan Monnier
2004-01-20 20:33               ` Jan D.
2004-01-20 20:43                 ` Stefan Monnier
2004-01-21 21:08               ` Richard Stallman
2004-01-21 21:14                 ` Stefan Monnier
2004-01-21 22:02                   ` Jan D.
2004-01-18 19:16 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66F4EDBB-4AC4-11D8-BCBC-00039363E640@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.