bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [address@hidden: drag-n-drop can't be customized by the target buffe


From: Jan D.
Subject: Re: [address@hidden: drag-n-drop can't be customized by the target buffer]
Date: Tue, 31 Aug 2004 14:08:31 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040605

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 via email to

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