VM

drag-n-drop support

Bug #718687 reported by Uday Reddy
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
VM
Fix Released
Wishlist
Uday Reddy

Bug Description

Add drag-n-drop support for VM. There is some initial code in contrib/vm-dnd-blueman.el.

Tags: mime ui

Related branches

Revision history for this message
mere user (emacs-user) wrote : Re: [Bug 718687] [NEW] drag-n-drop support

thanks for giving this a try!

should I do anything except for loading this contrib file? it didn't
seem to work for me on first try, I just get the file contents
inserted as text into the mail buffer. The mac (ns) port may be
behaving differently, there is this [ns-drag-file] that needs to be
defined or used, perhaps?

On Mon, Feb 14, 2011 at 7:05 AM, Launchpad Bug Tracker
<email address hidden> wrote:
> You have been subscribed to a public bug by Uday Reddy (reddyuday):
>
> Add drag-n-drop support for VM.  There is some initial code in contrib
> /vm-dnd-blueman.el.
>
> ** Affects: vm
>     Importance: Wishlist
>         Status: Triaged
>
>
> ** Tags: mime ui
> --
> drag-n-drop support
> https://bugs.launchpad.net/bugs/718687
> You received this bug notification because you are a direct subscriber of the bug.
>

Revision history for this message
Uday Reddy (reddyuday) wrote :

Drag and drop is now in revision 1060. (It was easier than I expected!)

Changed in vm:
status: Triaged → Fix Committed
milestone: 8.2.1 → 8.2.0b
assignee: nobody → Uday Reddy (reddyuday)
Revision history for this message
mere user (emacs-user) wrote : Re: [Bug 718687] Re: drag-n-drop support

hi Uday, If I do c-h k and then drag a file into the vm-composition
buffer, I get this:

<ns-drag-file> runs the command ns-insert-file, which is an
interactive compiled Lisp function in `ns-win.el'.

It is bound to <ns-drag-file>.

(ns-insert-file)

Insert contents of file `ns-input-file' like insert-file but with less
prompting. If file is a directory perform a `find-file' on it.

so doesn't work on a Mac for me... let me know if there is anything I can do...

On Mon, Feb 14, 2011 at 8:21 PM, Uday Reddy <email address hidden> wrote:
> Drag and drop is now in revision 1060.  (It was easier than I expected!)
>

Revision history for this message
Uday Reddy (reddyuday) wrote :

Do you have drag and drop working in Emacs at all? If it is not
implemented for Mac's, there is nothing I can do I am afraid.

Uday

Revision history for this message
Uday Reddy (reddyuday) wrote :

This page has some ideas on how to get drag and drop working in Emacs
under Mac.

http://anxiousmofo.wordpress.com/2008/07/19/getting-gnu-emacs-to-play-nicely-on-mac-os-x/

Revision history for this message
mere user (emacs-user) wrote :

drag and drop does work, as when I drag a file to the vm buffer its
contents are entered as text. also, when I drag a directory, emacs is
starting dired on that directory. I think the issue may be that under
ns (Mac), the implementation uses slightly different commands bound to
the drag and drop operation, as mentioned in my previous email. I'll
play with this a bit and let you know. you should be using a mac,
it's fun (and it's unix)... :)

On Tue, Feb 15, 2011 at 5:11 AM, Uday Reddy <email address hidden> wrote:
> Do you have drag and drop working in Emacs at all?  If it is not
> implemented for Mac's, there is nothing I can do I am afraid.
>
> Uday
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/718687
>
> Title:
>  drag-n-drop support
>
> Status in VM (View Mail) for Emacs:
>  Fix Committed
>
> Bug description:
>  Add drag-n-drop support for VM.  There is some initial code in contrib
>  /vm-dnd-blueman.el.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/vm/+bug/718687/+subscribe
>

Revision history for this message
Uday Reddy (reddyuday) wrote :

Yeah, I know, one of these days I will probably buy a mac...

Can you do C-h v for dnd-protocol-alist in a mail composition buffer
and tell me what the value is? Emacs is supposed to pick up the
handler from there.

Cheers,
Uday

Revision history for this message
Uday Reddy (reddyuday) wrote :

You should also check the value of dnd-protocol-alist in a dired
buffer. Then we can compare the two.

Cheers,
Uday

Revision history for this message
mere user (emacs-user) wrote :

vm does appear in this, so the problem may be that the drag operation
under ns does not use dnd.el

Value: (("^file:///" . vm-mail-dnd-attach-file)
 ("^file://" . dnd-open-file)
 ("^file:" . vm-mail-dnd-attach-file)
 ("^file:///" . dnd-open-local-file)
 ("^file://" . dnd-open-file)
 ("^file:" . dnd-open-local-file)
 ("^\\(https?\\|ftp\\|file\\|nfs\\)://" . dnd-open-file))

Original value was
(("^file:///" . dnd-open-local-file)
 ("^file://" . dnd-open-file)
 ("^file:" . dnd-open-local-file)
 ("^\\(https?\\|ftp\\|file\\|nfs\\)://" . dnd-open-file))

Local in buffer mail to _ on ""; global value is
(("^file:///" . dnd-open-local-file)
 ("^file://" . dnd-open-file)
 ("^file:" . dnd-open-local-file)
 ("^\\(https?\\|ftp\\|file\\|nfs\\)://" . dnd-open-file))

On Tue, Feb 15, 2011 at 9:25 AM, Uday Reddy <email address hidden> wrote:
> You should also check the value of dnd-protocol-alist in a dired
> buffer.  Then we can compare the two.
>
> Cheers,
> Uday
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/718687
>
> Title:
>  drag-n-drop support
>
> Status in VM (View Mail) for Emacs:
>  Fix Committed
>
> Bug description:
>  Add drag-n-drop support for VM.  There is some initial code in contrib
>  /vm-dnd-blueman.el.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/vm/+bug/718687/+subscribe
>

Revision history for this message
mere user (emacs-user) wrote :

here are the values for dired buffer. but note that these values may
not be used. please see ns-win.el for what I think is actually being
called. cheers, E

Value: (("^file:///" . dired-dnd-handle-local-file)
 ("^file://" . dired-dnd-handle-file)
 ("^file:" . dired-dnd-handle-local-file)
 ("^file:///" . dnd-open-local-file)
 ("^file://" . dnd-open-file)
 ("^file:" . dnd-open-local-file)
 ("^\\(https?\\|ftp\\|file\\|nfs\\)://" . dnd-open-file))

Original value was
(("^file:///" . dnd-open-local-file)
 ("^file://" . dnd-open-file)
 ("^file:" . dnd-open-local-file)
 ("^\\(https?\\|ftp\\|file\\|nfs\\)://" . dnd-open-file))

Local in buffer applicant-files-EPS; global value is
(("^file:///" . dnd-open-local-file)
 ("^file://" . dnd-open-file)
 ("^file:" . dnd-open-local-file)
 ("^\\(https?\\|ftp\\|file\\|nfs\\)://" . dnd-open-file))

On Tue, Feb 15, 2011 at 9:25 AM, Uday Reddy <email address hidden> wrote:
> You should also check the value of dnd-protocol-alist in a dired
> buffer.  Then we can compare the two.
>
> Cheers,
> Uday
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/718687
>
> Title:
>  drag-n-drop support
>
> Status in VM (View Mail) for Emacs:
>  Fix Committed
>
> Bug description:
>  Add drag-n-drop support for VM.  There is some initial code in contrib
>  /vm-dnd-blueman.el.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/vm/+bug/718687/+subscribe
>

Revision history for this message
Uday Reddy (reddyuday) wrote :

Ok, the next thing to do is how the dired dnd is working. Can you test
it out by dnd'ing into dired buffers? Place a debug-on-entry on the
corresponding dired functions to see if they are getting called and how.

Cheers,
Uday

Revision history for this message
Uday Reddy (reddyuday) wrote :

People here seem to think that the dnd library is getting used on Mac.

http://www.mackb.com/Uwe/Forum.aspx/mac-apps/17862/Download-files-from-within-emacs-on-Mac-OS-X

Revision history for this message
mere user (emacs-user) wrote :

sorry, I wasn't clear. drag and drop does work for me in general: if
I drag a file, its contents are entered into the buffer as text, if I
drag a directory, it is opened in dired. however, I think this may be
done via different commands from those in dnd.el. I could be totally
wrong as always, though. see the c-hv output I sent you previously,
which to my understanding means that some ns-specific functions are
being called, and I think they are defined in ns-win.el rather than
dnd.el. does this make sense at all? cheers, E

On Tue, Feb 15, 2011 at 1:01 PM, Uday Reddy <email address hidden> wrote:
> People here seem to think that the dnd library is getting used on Mac.
>
> http://www.mackb.com/Uwe/Forum.aspx/mac-apps/17862/Download-files-from-
> within-emacs-on-Mac-OS-X
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/718687
>
> Title:
>  drag-n-drop support
>
> Status in VM (View Mail) for Emacs:
>  Fix Committed
>
> Bug description:
>  Add drag-n-drop support for VM.  There is some initial code in contrib
>  /vm-dnd-blueman.el.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/vm/+bug/718687/+subscribe
>

Revision history for this message
Uday Reddy (reddyuday) wrote :

mere user writes:

> sorry, I wasn't clear. drag and drop does work for me in general: if
> I drag a file, its contents are entered into the buffer as text, if I
> drag a directory, it is opened in dired. however, I think this may be
> done via different commands from those in dnd.el.

Yes. What we are trying to do is to find out whether dnd.el is being
supported on Mac. If you do the experiment I mentioned about dragging
into dired buffers, we will know.

Cheers,
Uday

Revision history for this message
mere user (emacs-user) wrote :

OK. I put debug on entry on all functions in dnd.el, none was
triggered when I drag a directory into an emacs/ dired buffer

then I did the same with ns-insert-file, and that was triggered immediately:

Debugger entered--entering a function:
* ns-insert-file()
  call-interactively(ns-insert-file nil nil)

did I finally get it?

On Tue, Feb 15, 2011 at 4:54 PM, Uday Reddy <email address hidden> wrote:
> mere user writes:
>
>> sorry, I wasn't clear.  drag and drop does work for me in general: if
>> I drag a file, its contents are entered into the buffer as text, if I
>> drag a directory, it is opened in dired.  however, I think this may be
>> done via different commands from those in dnd.el.
>
> Yes.  What we are trying to do is to find out whether dnd.el is being
> supported on Mac.  If you do the experiment I mentioned about dragging
> into dired buffers, we will know.
>
> Cheers,
> Uday
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/718687
>
> Title:
>  drag-n-drop support
>
> Status in VM (View Mail) for Emacs:
>  Fix Committed
>
> Bug description:
>  Add drag-n-drop support for VM.  There is some initial code in contrib
>  /vm-dnd-blueman.el.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/vm/+bug/718687/+subscribe
>

Revision history for this message
Uday Reddy (reddyuday) wrote :

mere user writes:

> did I finally get it?

Yeah, that was useful information. I have added a function for ns and
bound it to [ns-drag-text]. Revision 1062. Please give it a try.

Cheers,
Uday

Changed in vm:
status: Fix Committed → In Progress
Revision history for this message
Uday Reddy (reddyuday) wrote :

Final fixes in revision 1065.

Changed in vm:
status: In Progress → Fix Committed
Uday Reddy (reddyuday)
Changed in vm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.