>> (defun thumbs-thumbname (img) >> "Return a thumbnail name for the image IMG." >> (concat thumbs-thumbsdir "/" >> (convert-standard-filename >> (subst-char-in-string ?/ ?\| (expand-file-name img)))))
ELISP> (thumbs-thumbname "C:/store/test/ycbcr-cat.tif") > "c:/usr/home/.emacs-thumb/C:!store!test!ycbcr-cat.tif" > which is not a valid name (the ":"). In fact, that was the error that > took me down this path. Oh, right. So the docstring should be fixed to make it clear that the argument should be an *absolute* file name. And maybe we then need another function "convert-standard-filename-element" for the non-directory components of a file name. Can someone confirm that the patch below is correct? Stefan --- orig/lisp/files.el +++ mod/lisp/files.el @@ -514,6 +514,10 @@ This means to guarantee valid names and perhaps to canonicalize certain patterns. +FILENAME should be an absolute file name since the conversion rules +sometimes vary depending on the position in the file name. E.g. c:/foo +is a valid DOS file name, but c:/bar/c:/foo is not. + This function's standard definition is trivial; it just returns the argument. However, on Windows and DOS, replace invalid characters. On DOS, make sure to obey the 8.3 limitations. On _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel