[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A few issues with thumbs.el

From: Stefan Monnier
Subject: Re: A few issues with thumbs.el
Date: Thu, 26 May 2005 12:55:47 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> (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?


--- 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]