Function: pgtk-dnd-handle-file-name

pgtk-dnd-handle-file-name is a byte-compiled function defined in pgtk-dnd.el.gz.

Signature

(pgtk-dnd-handle-file-name WINDOW ACTION STRING)

Documentation

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.

Source Code

;; Defined in /usr/src/emacs/lisp/pgtk-dnd.el.gz
(defun pgtk-dnd-handle-file-name (window action string)
  "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 (or file-name-coding-system
		    default-file-name-coding-system))
	retval)
    (let ((did-action
           (dnd-handle-multiple-urls
            window (mapcar
                    (lambda (item)
                      (when coding
                        (setq item (encode-coding-string item
                                                         coding)))
                      (concat "file://"
                              (mapconcat 'url-hexify-string
                                         (split-string item "/")
                                         "/")))
                    uri-list)
            action)))
      (when did-action (setq retval did-action)))
    retval))