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 21:33:11 +0200 Message-ID: <834oluf9c8.fsf@gnu.org> References: <83k4urfqs9.fsf@gnu.org> <0B5BFE3DC87648888328B75164292F06@us.oracle.com> <83bpg2g2l8.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1265484881 26743 80.91.229.12 (6 Feb 2010 19:34:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Feb 2010 19:34:41 +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 20:33:35 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 1NdqPO-0006E1-FW for ged-emacs-devel@m.gmane.org; Sat, 06 Feb 2010 20:33:34 +0100 Original-Received: from localhost ([127.0.0.1]:47902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NdqPN-0007Z8-MZ for ged-emacs-devel@m.gmane.org; Sat, 06 Feb 2010 14:33:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NdqPJ-0007Yd-AY for emacs-devel@gnu.org; Sat, 06 Feb 2010 14:33:29 -0500 Original-Received: from [199.232.76.173] (port=55938 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NdqPJ-0007YM-0c for emacs-devel@gnu.org; Sat, 06 Feb 2010 14:33:29 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NdqPH-0005oM-K8 for emacs-devel@gnu.org; Sat, 06 Feb 2010 14:33:28 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:35446) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NdqPH-0005ny-6u for emacs-devel@gnu.org; Sat, 06 Feb 2010 14:33:27 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0KXF00I00Q6I3T00@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Sat, 06 Feb 2010 21:33:09 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.70.67.249]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KXF00B1EQB8XWH0@a-mtaout22.012.net.il>; Sat, 06 Feb 2010 21:33:09 +0200 (IST) In-reply-to: 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:120992 Archived-At: > From: "Drew Adams" > Cc: > Date: Sat, 6 Feb 2010 07:33:17 -0800 > > But .emacs and _emacs could be two different files on MS-DOC, no? No. MS-DOS does not allow file names with leading dots. There cannot be a file name like .emacs there. Look, I think this discussion is getting out of hand. Let me try to step back a notch and try anew. There's a problem with file names, such as ".emacs", defined in Emacs Lisp code as literal strings: some filesystems don't allow such names. `convert-standard-filename' was introduced to take a Posix file name and produce from it a file name that can be used instead on the particular filesystem. So instead of (defvar foo-file (if (eq system-type 'foo) "this" (if (eq system-type 'bar) "that" .... we can now have just this: (defvar foo-file (convert-standard-filename "this")) So far so good? Same considerations apply when a file name is constructed from fragments, like in (append ".emacs." (user-full-name) ".log") In order to get a file name that any supported platform could use, you need to run the result of this through `convert-standard-filename'. Okay? If this part is understood, then just use `convert-standard-filename' in any situation where a string to be used as a file name might not be valid on the underlying filesystem, like e.g. a literal `?' on a Windows disk. An arbitrary string generally needs such a treatment, before it can safely be used as a file name. That's why Emacs defcustoms use it. Any questions so far?