diff options
| author | Leo Liu | 2010-10-02 21:27:39 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-10-02 21:27:39 -0400 |
| commit | 83b8ea28ea1d3f9f7c73af717fefaaeca18a1594 (patch) | |
| tree | 4719dc86c245ed201b30deb48932a20ed5dafe5b | |
| parent | 7b2bf907f15edfed9480e7c4087cc54b603e426c (diff) | |
| download | emacs-83b8ea28ea1d3f9f7c73af717fefaaeca18a1594.tar.gz emacs-83b8ea28ea1d3f9f7c73af717fefaaeca18a1594.zip | |
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).
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/dnd.el | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 696941f93cd..acc2e0c382f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-10-03 Leo <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * dnd.el (dnd-get-local-file-name): If MUST-EXIST is non-nil, only | ||
| 4 | return non-nil if the file exists (Bug#7090). | ||
| 5 | |||
| 1 | 2010-09-30 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2010-09-30 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * minibuffer.el (completion--replace): | 8 | * minibuffer.el (completion--replace): |
diff --git a/lisp/dnd.el b/lisp/dnd.el index d7cbb641bab..aadfad6d7ac 100644 --- a/lisp/dnd.el +++ b/lisp/dnd.el | |||
| @@ -154,10 +154,11 @@ Return nil if URI is not a local file." | |||
| 154 | (let* ((decoded-f (decode-coding-string | 154 | (let* ((decoded-f (decode-coding-string |
| 155 | f | 155 | f |
| 156 | (or file-name-coding-system | 156 | (or file-name-coding-system |
| 157 | default-file-name-coding-system))) | 157 | default-file-name-coding-system)))) |
| 158 | (try-f (if (file-readable-p decoded-f) decoded-f f))) | 158 | (setq f (cond ((file-readable-p decoded-f) decoded-f) |
| 159 | (when (file-readable-p try-f) try-f))))) | 159 | ((file-readable-p f) f) |
| 160 | 160 | (t nil))))) | |
| 161 | f)) | ||
| 161 | 162 | ||
| 162 | (defun dnd-open-local-file (uri action) | 163 | (defun dnd-open-local-file (uri action) |
| 163 | "Open a local file. | 164 | "Open a local file. |