unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [ihs_4664@yahoo.com: drag-n-drop can't be customized by the target buffer]
       [not found] <E1C16NF-0000dx-6Y@fencepost.gnu.org>
@ 2004-08-31 12:08 ` Jan D.
       [not found] ` <41346A3F.8090403@swipnet.se>
  1 sibling, 0 replies; 2+ messages in thread
From: Jan D. @ 2004-08-31 12:08 UTC (permalink / raw)
  Cc: gnu-emacs-bug, rms, emacs-devel

Richard Stallman wrote:
> Would the people who work on drag-n-drop please think about this idea?
> 
> ------- Start of forwarded message -------
> To: gnu-emacs-bug@moderators.isc.org
> From: Kevin Rodgers <ihs_4664@yahoo.com>
> Newsgroups: gnu.emacs.bug
> Date: Fri, 27 Aug 2004 11:56:49 -0600
> X-Orig-X-Trace: news.uni-berlin.de
> 	Nh+o2aku0MLBGtYAyGjzpwgNH8hH4wBq+aJybFTCUbIftZpW4=
> X-Accept-Language: en-us
> Cc: 
> Subject: drag-n-drop can't be customized by the target buffer

...


> It would be better if each of the term/foo-win.el files had something
> like:
> 
> (defvar drag-n-drop-function 'find-file)
> 
> (defun foo-drag-n-drop (event)
> ...
>    (mapc drag-n-drop-function (car (cdr (cdr event))))
> ...
> )
> 
> so that vm-mail-mode etc. could say:
> 
> (set (make-local-variable 'drag-n-drop-function)
>       (lambda (file)
>         (vm-mime-attach-file file (or (vm-mime-default-type-from-filename file)
>                                       "application/octet-stream"))))
> 

It is not that simple, since drag and drop may involve text, pictures, URLs and 
not just only files.  But if you just want files that exist, the current CVS 
version of Emacs allows you to do this when using X (i.e. not Windows or Mac OS X):

(set (make-local-variable 'x-dnd-protocol-alist)
      '(("^file:" . my-dnd-fun)))

(defun my-dnd-fun (url action)
   (let ((file (x-dnd-get-local-file-name url t)))
     (vm-mime-attach-file file (or (vm-mime-default-type-from-filename file)
				  "application/octet-stream"))))


	Jan D.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ihs_4664@yahoo.com: drag-n-drop can't be customized by the target buffer]
       [not found] ` <41346A3F.8090403@swipnet.se>
@ 2004-08-31 12:25   ` Jason Rumney
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Rumney @ 2004-08-31 12:25 UTC (permalink / raw)
  Cc: gnu-emacs-bug, ihs_4664, emacs-devel

Jan D. wrote:

> It is not that simple, since drag and drop may involve text, pictures, 
> URLs and not just only files.  But if you just want files that exist, 
> the current CVS version of Emacs allows you to do this when using X 
> (i.e. not Windows or Mac OS X):
>
> (set (make-local-variable 'x-dnd-protocol-alist)
>      '(("^file:" . my-dnd-fun)))
>
> (defun my-dnd-fun (url action)
>   (let ((file (x-dnd-get-local-file-name url t)))
>     (vm-mime-attach-file file (or (vm-mime-default-type-from-filename 
> file)
>                   "application/octet-stream"))))
>
This works on Windows too, since the DND implementation has been changed 
to call x-dnd-handle-one-url for consistency.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-08-31 12:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1C16NF-0000dx-6Y@fencepost.gnu.org>
2004-08-31 12:08 ` [ihs_4664@yahoo.com: drag-n-drop can't be customized by the target buffer] Jan D.
     [not found] ` <41346A3F.8090403@swipnet.se>
2004-08-31 12:25   ` Jason Rumney

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).