308 |
The last / in file:/// is part of the file name. ACTION is ignored." |
The last / in file:/// is part of the file name. ACTION is ignored." |
309 |
|
|
310 |
(let* ((f (x-dnd-get-local-file-name uri t))) |
(let* ((f (x-dnd-get-local-file-name uri t))) |
311 |
(when f |
(if (and f (file-readable-p f)) |
312 |
(if (file-readable-p f) |
(progn |
313 |
(progn |
(if x-dnd-open-file-other-window |
314 |
(if x-dnd-open-file-other-window |
(find-file-other-window f) |
315 |
(find-file-other-window f) |
(find-file f)) |
316 |
(find-file f)) |
'private) |
317 |
'private) |
(error "Can not read %s" uri)))) |
|
(error "Can not read %s (%s)" f uri))))) |
|
318 |
|
|
319 |
(defun x-dnd-open-file (uri action) |
(defun x-dnd-open-file (uri action) |
320 |
"Open a local or remote file. |
"Open a local or remote file. |
326 |
;; The hostname may be our hostname, in that case, convert to a local |
;; The hostname may be our hostname, in that case, convert to a local |
327 |
;; file. Otherwise return nil. |
;; file. Otherwise return nil. |
328 |
(let ((local-file (x-dnd-get-local-file-uri uri))) |
(let ((local-file (x-dnd-get-local-file-uri uri))) |
329 |
(when local-file (x-dnd-open-local-file local-file action)))) |
(if local-file (x-dnd-open-local-file local-file action) |
330 |
|
(error "Remote files not supported")))) |
331 |
|
|
332 |
|
|
333 |
(defun x-dnd-handle-moz-url (window action data) |
(defun x-dnd-handle-moz-url (window action data) |