summaryrefslogtreecommitdiff
path: root/lisp/x-dnd.el
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2006-05-24 09:13:31 +0000
committerKaroly Lorentey <lorentey@elte.hu>2006-05-24 09:13:31 +0000
commit40a1b46245c1a8786324f5a06d6cb8d4bd9d5b74 (patch)
treef45020695e190f511f4faf4dd3ed144059f298c0 /lisp/x-dnd.el
parentdbe9f5ba9648890dc34f4836a49fde766b21ce74 (diff)
parent4ea5193b9cc5c577127ca6c89ecfaad819398d3b (diff)
downloademacs-40a1b46245c1a8786324f5a06d6cb8d4bd9d5b74.tar.gz
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-289 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-290 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-291 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-292 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-293 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-567
Diffstat (limited to 'lisp/x-dnd.el')
-rw-r--r--lisp/x-dnd.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index 3ad9a5f0e2c..04ef4f0b6dc 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -257,14 +257,20 @@ STRING is the uri-list as a string. The URIs are separated by \r\n."
retval))
(defun x-dnd-handle-file-name (window action string)
- "Prepend file:// to file names and call `dnd-handle-one-url'.
+ "Convert file names to URLs and call `dnd-handle-one-url'.
WINDOW is the window where the drop happened.
STRING is the file names as a string, separated by nulls."
(let ((uri-list (split-string string "[\0\r\n]" t))
+ (coding (and default-enable-multibyte-characters
+ (or file-name-coding-system
+ default-file-name-coding-system)))
retval)
(dolist (bf uri-list)
;; If one URL is handeled, treat as if the whole drop succeeded.
- (let* ((file-uri (concat "file://" bf))
+ (if coding (setq bf (encode-coding-string bf coding)))
+ (let* ((file-uri (concat "file://"
+ (mapconcat 'url-hexify-string
+ (split-string bf "/") "/")))
(did-action (dnd-handle-one-url window action file-uri)))
(when did-action (setq retval did-action))))
retval))