From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: file-truename, convert-standard-filename Date: Sat, 06 Feb 2010 11:01:23 +0200 Message-ID: <83bpg2g2l8.fsf@gnu.org> References: <83k4urfqs9.fsf@gnu.org> <0B5BFE3DC87648888328B75164292F06@us.oracle.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1265446925 9347 80.91.229.12 (6 Feb 2010 09:02:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Feb 2010 09:02:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 06 10:02:02 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NdgYD-0007Ah-5H for ged-emacs-devel@m.gmane.org; Sat, 06 Feb 2010 10:02:01 +0100 Original-Received: from localhost ([127.0.0.1]:35877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NdgYC-0005LD-ON for ged-emacs-devel@m.gmane.org; Sat, 06 Feb 2010 04:02:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NdgY5-0005Kw-Jr for emacs-devel@gnu.org; Sat, 06 Feb 2010 04:01:53 -0500 Original-Received: from [199.232.76.173] (port=56348 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NdgY5-0005Kn-7i for emacs-devel@gnu.org; Sat, 06 Feb 2010 04:01:53 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NdgY2-0008Sb-Dg for emacs-devel@gnu.org; Sat, 06 Feb 2010 04:01:52 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:50407) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NdgY1-0008RW-16 for emacs-devel@gnu.org; Sat, 06 Feb 2010 04:01:49 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0KXE00900WODLA00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Sat, 06 Feb 2010 11:01:22 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.70.67.249]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KXE009VMX29EL10@a-mtaout21.012.net.il>; Sat, 06 Feb 2010 11:01:22 +0200 (IST) In-reply-to: <0B5BFE3DC87648888328B75164292F06@us.oracle.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:120978 Archived-At: > From: "Drew Adams" > Cc: > Date: Fri, 5 Feb 2010 15:51:01 -0800 > > Thanks. Could you perhaps consider adding some of that information to the doc? I > don't see any of it there. If I have time. Although I'm not sure where: we don't have a place in the manual that describes how to compare file names reliably. Perhaps we should. > And judging from this thread, it appears that the purpose of > `convert-standard-filename' is not too clear to everyone. It's still not clear > to me, at least. Even after reading the ELisp node where it is documented? Could you tell what else is missing? > What do you mean by "embedded literal string" in the source code? If the Emacs > source code has (defcustom foo ".emacs"...), do I need to apply c-s-f to foo in > order to compare its value? Only if the other string is a name of a file that already exists in the filesystem. > And does "Emacs sources" apply only to code distributed with Emacs > or to any Emacs-Lisp source code? The latter, of course. > And you seem to say two things: a "file name embedded as a literal string" and > "a name of a file mentioned in Emacs sources". Is c-s-f needed for certain file > names (e.g. those "mentioned" in Emacs sources) or for certain strings (e.g. > literal strings in distributed source code) that name files? ``Literal string'' is the main issue here. That's why this function was introduced in the first place: to seamlessly take care of all the places in Emacs Lisp sources where there's a literal string serving as a file name, and that string might be an invalid file name on some filesystems. > IOW, is it about the name or the actual string object? It's about the names that are valid on some systems, but not on others. > Does it matter whether it's (string= (file-truename ".emacs") (file-truename > bar)) or (string= (file-truename foo) (file-truename bar)), where foo's value is > ".emacs"? Is c-s-f needed in the former case but not the latter? It is needed in the first case, if `bar' is the name of a file already existing in the filesystem, because on MS-DOS, `bar' could be "_emacs" instead. It _may_ be needed in the second case if one of `foo' or `bar' is a string whose value is ".emacs", while the other is the name of a file already existing in the filesystem. It is _not_ needed if both `foo' and `bar' hold names of files already existing on filesystems of the same type. > Obviously, I'm not yet understanding what this is about. Does it have something > to do with strings that are defined before Emacs gets dumped? No, Emacs dumping is not the issue here, at least not directly. For defcustoms, it's not an issue because a defcustom is evaluated again when a dumped Emacs starts. So if the filesystem where it was dumped is different from the one where it starts, the name will be recomputed anew.