From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: file-truename, convert-standard-filename Date: Fri, 5 Feb 2010 15:51:01 -0800 Message-ID: <0B5BFE3DC87648888328B75164292F06@us.oracle.com> References: <83k4urfqs9.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1265413880 31700 80.91.229.12 (5 Feb 2010 23:51:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Feb 2010 23:51:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Eli Zaretskii'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 06 00:51:17 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 1NdXxC-0006MR-AL for ged-emacs-devel@m.gmane.org; Sat, 06 Feb 2010 00:51:14 +0100 Original-Received: from localhost ([127.0.0.1]:56357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NdXxB-0005qr-RE for ged-emacs-devel@m.gmane.org; Fri, 05 Feb 2010 18:51:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NdXx6-0005qB-BU for emacs-devel@gnu.org; Fri, 05 Feb 2010 18:51:08 -0500 Original-Received: from [199.232.76.173] (port=50648 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NdXx6-0005pv-33 for emacs-devel@gnu.org; Fri, 05 Feb 2010 18:51:08 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NdXx4-0002M3-Be for emacs-devel@gnu.org; Fri, 05 Feb 2010 18:51:07 -0500 Original-Received: from acsinet11.oracle.com ([141.146.126.233]:64215) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NdXx3-0002LR-Re; Fri, 05 Feb 2010 18:51:06 -0500 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by acsinet11.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o15Np2NY028324 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 5 Feb 2010 23:51:03 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o159cDKE015403; Fri, 5 Feb 2010 23:51:01 GMT Original-Received: from abhmt017.oracle.com by acsmt355.oracle.com with ESMTP id 15148191265413860; Fri, 05 Feb 2010 15:51:00 -0800 Original-Received: from dradamslap1 (/141.144.80.40) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 05 Feb 2010 15:50:59 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <83k4urfqs9.fsf@gnu.org> Thread-Index: AcqmlhAqsLjejS8vQ4uVSYFeupwe4AAIe1jQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt354.oracle.com [141.146.40.154] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090205.4B6CAEE5.024B:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:120963 Archived-At: > `convert-standard-filename' is for file names embedded as literal > strings within Emacs sources. > > On Windows, `file-truename' also converts a short 8+3 alias into its > long original. So, for example, `C:/DOCUME~1/USER/LOCALS~1/Temp' is > converted into `C:/Documents and Settings/USER/Local Settings/Temp'. > It also converts the letter-case to what is actually recorded in the > filesystem. > > > But in terms of use, if I want to, say, compare two file > > names to see if they represent the same file, what's > > typically appropriate? > > Using `file-truename' should be enough. If you compare against a > literal string that holds a name of a file mentioned in Emacs sources, > such as ".emacs" or ".desktop", run them through > `convert-standard-filename' first. As Andreas points out, an existing > file should not be subject to `convert-standard-filename'. Thanks. Could you perhaps consider adding some of that information to the doc? I don't see any of it there. 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. 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? And does "Emacs sources" apply only to code distributed with Emacs or to any Emacs-Lisp source code? 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? IOW, is it about the name or the actual string object? 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? 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? Please feel free to ignore all my questions and just try to explain again, directly. All I want is to understand. I've read the replies from Andreas, Stefan, and you, and it's clear that this is clear to all of you, but I still don't get it, based on what you've said so far. > Which defcustoms use `file-truename'? Hm; my bad. I coulda sworn I saw some...