From: Jan Djärv Date: Mon, 19 Apr 2004 12:45:28 +0000 (+0000) Subject: * x-dnd.el (x-dnd-open-local-file, x-dnd-open-file): Improved error X-Git-Tag: ttn-vms-21-2-B4~6732 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d8dc1cccf6ac387d9596b0527bc26e6542243819;p=emacs.git * x-dnd.el (x-dnd-open-local-file, x-dnd-open-file): Improved error messages. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 28c872ac281..f4d481a83cf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-04-19 Jan Dj,Ad(Brv + + * x-dnd.el (x-dnd-open-local-file, x-dnd-open-file): Improved error + messages. + 2004-04-19 Stephen Eglen * 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. The last / in file:/// is part of the file name. ACTION is ignored." (let* ((f (x-dnd-get-local-file-name uri t))) - (when f - (if (file-readable-p f) - (progn - (if x-dnd-open-file-other-window - (find-file-other-window f) - (find-file f)) - 'private) - (error "Can not read %s (%s)" f uri))))) + (if (and f (file-readable-p f)) + (progn + (if x-dnd-open-file-other-window + (find-file-other-window f) + (find-file f)) + 'private) + (error "Can not read %s" uri)))) (defun x-dnd-open-file (uri action) "Open a local or remote file. @@ -327,7 +326,8 @@ The last / in file://hostname/ is part of the file name." ;; The hostname may be our hostname, in that case, convert to a local ;; file. Otherwise return nil. (let ((local-file (x-dnd-get-local-file-uri uri))) - (when local-file (x-dnd-open-local-file local-file action)))) + (if local-file (x-dnd-open-local-file local-file action) + (error "Remote files not supported")))) (defun x-dnd-handle-moz-url (window action data)