- (when (and f must-exist)
- (setq f (replace-regexp-in-string
- "%[A-Fa-f0-9][A-Fa-f0-9]"
- (lambda (arg)
- (let ((str (make-string 1 0)))
- (aset str 0 (string-to-number (substring arg 1) 16))
- str))
- f t t))
- (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)))))
-
-
-(defun dnd-open-local-file (uri action)
+ (and f (setq f (decode-coding-string (dnd-unescape-uri f)
+ (or file-name-coding-system
+ default-file-name-coding-system))))
+ (when (and f must-exist (not (file-readable-p f)))
+ (setq f nil))
+ f))
+
+(defun dnd-open-local-file (uri _action)