# HG changeset patch # User Chong Yidong # Date 1286069259 14400 # Node ID 018f0b2e8f2352795f69d68b27e5212f1cbadd4a # Parent 63399fcc7ef2381f5809cd700c56d3c18452da16 Fix return value of dnd-get-local-file-name (Bug#7090). * lisp/dnd.el (dnd-get-local-file-name): If MUST-EXIST is non-nil, only return non-nil if the file exists (Bug#7090). diff -r 63399fcc7ef2 -r 018f0b2e8f23 lisp/ChangeLog --- a/lisp/ChangeLog Sat Oct 02 18:23:50 2010 -0700 +++ b/lisp/ChangeLog Sat Oct 02 21:27:39 2010 -0400 @@ -1,3 +1,8 @@ +2010-10-03 Leo + + * 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 * minibuffer.el (completion--replace): diff -r 63399fcc7ef2 -r 018f0b2e8f23 lisp/dnd.el --- a/lisp/dnd.el Sat Oct 02 18:23:50 2010 -0700 +++ b/lisp/dnd.el Sat Oct 02 21:27:39 2010 -0400 @@ -154,10 +154,11 @@ (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.