]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix return value of dnd-get-local-file-name (Bug#7090).
authorLeo Liu <sdl.web@gmail.com>
Sun, 3 Oct 2010 01:27:39 +0000 (21:27 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 3 Oct 2010 01:27:39 +0000 (21:27 -0400)
* lisp/dnd.el (dnd-get-local-file-name): If MUST-EXIST is non-nil, only
return non-nil if the file exists (Bug#7090).

lisp/ChangeLog
lisp/dnd.el

index 696941f93cdf7141e66d3a528064ef607803c5b2..acc2e0c382f9e39f83d64a682169296a44c8dbb3 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-03  Leo  <sdl.web@gmail.com>
+
+       * dnd.el (dnd-get-local-file-name): If MUST-EXIST is non-nil, only
+       return non-nil if the file exists (Bug#7090).
+
 2010-09-30  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * minibuffer.el (completion--replace):
index d7cbb641babec9f1b3ded07312391371a7a842ad..aadfad6d7acc74d770befdb46b686c04d12cd4c5 100644 (file)
@@ -154,10 +154,11 @@ Return nil if URI is not a local file."
       (let* ((decoded-f (decode-coding-string
                         f
                         (or file-name-coding-system
-                            default-file-name-coding-system)))
-            (try-f (if (file-readable-p decoded-f) decoded-f f)))
-       (when (file-readable-p try-f) try-f)))))
-
+                            default-file-name-coding-system))))
+       (setq f (cond ((file-readable-p decoded-f) decoded-f)
+                     ((file-readable-p f) f)
+                     (t nil)))))
+    f))
 
 (defun dnd-open-local-file (uri action)
   "Open a local file.