aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2004-04-19 12:45:28 +0000
committerJan Djärv2004-04-19 12:45:28 +0000
commitd8dc1cccf6ac387d9596b0527bc26e6542243819 (patch)
treedd3cd67638aecfdb5a06af0e263e96f494225a66
parentf329780b740d90c13c38faa1b604208e2b770e47 (diff)
downloademacs-d8dc1cccf6ac387d9596b0527bc26e6542243819.tar.gz
emacs-d8dc1cccf6ac387d9596b0527bc26e6542243819.zip
* x-dnd.el (x-dnd-open-local-file, x-dnd-open-file): Improved error
messages.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/x-dnd.el18
2 files changed, 14 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 28c872ac281..f4d481a83cf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12004-04-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * x-dnd.el (x-dnd-open-local-file, x-dnd-open-file): Improved error
4 messages.
5
12004-04-19 Stephen Eglen <stephen@gnu.org> 62004-04-19 Stephen Eglen <stephen@gnu.org>
2 7
3 * add-log.el (add-change-log-entry): Update doc string to mention 8 * add-log.el (add-change-log-entry): Update doc string to mention
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index cdb0a63ace6..7d43a10556e 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -308,14 +308,13 @@ and must have the format file:file-name or file:///file-name.
308The last / in file:/// is part of the file name. ACTION is ignored." 308The last / in file:/// is part of the file name. ACTION is ignored."
309 309
310 (let* ((f (x-dnd-get-local-file-name uri t))) 310 (let* ((f (x-dnd-get-local-file-name uri t)))
311 (when f 311 (if (and f (file-readable-p f))
312 (if (file-readable-p f) 312 (progn
313 (progn 313 (if x-dnd-open-file-other-window
314 (if x-dnd-open-file-other-window 314 (find-file-other-window f)
315 (find-file-other-window f) 315 (find-file f))
316 (find-file f)) 316 'private)
317 'private) 317 (error "Can not read %s" uri))))
318 (error "Can not read %s (%s)" f uri)))))
319 318
320(defun x-dnd-open-file (uri action) 319(defun x-dnd-open-file (uri action)
321 "Open a local or remote file. 320 "Open a local or remote file.
@@ -327,7 +326,8 @@ The last / in file://hostname/ is part of the file name."
327 ;; The hostname may be our hostname, in that case, convert to a local 326 ;; The hostname may be our hostname, in that case, convert to a local
328 ;; file. Otherwise return nil. 327 ;; file. Otherwise return nil.
329 (let ((local-file (x-dnd-get-local-file-uri uri))) 328 (let ((local-file (x-dnd-get-local-file-uri uri)))
330 (when local-file (x-dnd-open-local-file local-file action)))) 329 (if local-file (x-dnd-open-local-file local-file action)
330 (error "Remote files not supported"))))
331 331
332 332
333(defun x-dnd-handle-moz-url (window action data) 333(defun x-dnd-handle-moz-url (window action data)