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: Jason Rumney
Subject: Re: [address@hidden: drag-n-drop can't be customized by the target buffer]
Date: Tue, 31 Aug 2004 13:25:43 +0100
User-agent: Mozilla Thunderbird 0.7.1 (Windows/20040626)

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.





reply via email to

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