From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: A few issues with thumbs.el Date: Thu, 26 May 2005 12:55:47 -0400 Message-ID: <87vf56q6fk.fsf-monnier+emacs@gnu.org> References: <87br6zuerw.fsf-monnier+emacs@gnu.org> <87u0kqrsur.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1117126659 22567 80.91.229.2 (26 May 2005 16:57:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 26 May 2005 16:57:39 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 26 18:57:34 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DbLdu-00069A-5m for ged-emacs-devel@m.gmane.org; Thu, 26 May 2005 18:55:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbLi0-0000hw-GB for ged-emacs-devel@m.gmane.org; Thu, 26 May 2005 12:59:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DbLgW-0007yQ-4Q for emacs-devel@gnu.org; Thu, 26 May 2005 12:58:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DbLgS-0007vU-Rh for emacs-devel@gnu.org; Thu, 26 May 2005 12:58:12 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbLgS-0007uf-6c for emacs-devel@gnu.org; Thu, 26 May 2005 12:58:12 -0400 Original-Received: from [209.226.175.184] (helo=tomts22-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DbLeu-000791-3q for emacs-devel@gnu.org; Thu, 26 May 2005 12:56:36 -0400 Original-Received: from alfajor ([65.92.240.195]) by tomts22-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050526165548.OYEU21470.tomts22-srv.bellnexxia.net@alfajor>; Thu, 26 May 2005 12:55:48 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 8D95CD7378; Thu, 26 May 2005 12:55:47 -0400 (EDT) Original-To: Juanma Barranquero In-Reply-To: (Juanma Barranquero's message of "Thu, 26 May 2005 16:19:51 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:37712 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37712 >> (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