+ (if (eq system-type 'cygwin)
+ (let ((winfile (shell-command-to-string (concat
+ "cygpath -m " (shell-quote-argument file)))))
+ (setq file (concat "file://" (substring winfile 0 -1)))))
I would instead bind winfile to
(with-output-to-string
(call-process "cygpath" nil standard-output nil "-m" file))
(using, like `shell-command-to-string' does, the undocumented feature that
`with-output-to-string' causes `standard-output' to be a temporary
buffer). Then you don't have to worry with `shell-quote-argument'.