unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan D." <jan.h.d@swipnet.se>
Cc: gnu-emacs-bug@moderators.isc.org, rms@gnu.org, emacs-devel@gnu.org
Subject: Re: [ihs_4664@yahoo.com: drag-n-drop can't be customized by the target buffer]
Date: Tue, 31 Aug 2004 14:08:31 +0200	[thread overview]
Message-ID: <41346A3F.8090403__6486.4274267622$1093954233$gmane$org@swipnet.se> (raw)
In-Reply-To: <E1C16NF-0000dx-6Y@fencepost.gnu.org>

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.

       reply	other threads:[~2004-08-31 12:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1C16NF-0000dx-6Y@fencepost.gnu.org>
2004-08-31 12:08 ` Jan D. [this message]
     [not found] ` <41346A3F.8090403@swipnet.se>
2004-08-31 12:25   ` [ihs_4664@yahoo.com: drag-n-drop can't be customized by the target buffer] Jason Rumney

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='41346A3F.8090403__6486.4274267622$1093954233$gmane$org@swipnet.se' \
    --to=jan.h.d@swipnet.se \
    --cc=emacs-devel@gnu.org \
    --cc=gnu-emacs-bug@moderators.isc.org \
    --cc=rms@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 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).