From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Davis Herring" Newsgroups: gmane.emacs.devel Subject: RE: file-truename, convert-standard-filename Date: Fri, 26 Feb 2010 11:35:03 -0800 (PST) Message-ID: <50265.130.55.132.103.1267212903.squirrel@webmail.lanl.gov> References: <83k4urfqs9.fsf@gnu.org> <0B5BFE3DC87648888328B75164292F06@us.oracle.com> <83bpg2g2l8.fsf@gnu.org> <834oluf9c8.fsf@gnu.org> <07544B532C8E490F96FE0B1CF403C510@us.oracle.com> <83zl3mdo22.fsf@gnu.org> <50159.130.55.132.103.1267209232.squirrel@webmail.lanl.gov> <38064152AFEA47BF9A5DBC6F9F16A6EF@us.oracle.com> Reply-To: herring@lanl.gov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1267212920 14632 80.91.229.12 (26 Feb 2010 19:35:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 26 Feb 2010 19:35:20 +0000 (UTC) Cc: 'Eli Zaretskii' , emacs-devel@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 26 20:35:16 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 1Nl5xz-0006Mf-DD for ged-emacs-devel@m.gmane.org; Fri, 26 Feb 2010 20:35:15 +0100 Original-Received: from localhost ([127.0.0.1]:48316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nl5xy-0001Dq-Rs for ged-emacs-devel@m.gmane.org; Fri, 26 Feb 2010 14:35:14 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nl5xt-0001Db-4D for emacs-devel@gnu.org; Fri, 26 Feb 2010 14:35:09 -0500 Original-Received: from [140.186.70.92] (port=38121 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nl5xr-0001DR-H6 for emacs-devel@gnu.org; Fri, 26 Feb 2010 14:35:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nl5xq-0004a0-BG for emacs-devel@gnu.org; Fri, 26 Feb 2010 14:35:07 -0500 Original-Received: from proofpoint1.lanl.gov ([204.121.3.25]:53625) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nl5xq-0004Zp-2p; Fri, 26 Feb 2010 14:35:06 -0500 Original-Received: from mailrelay1.lanl.gov (mailrelay1.lanl.gov [128.165.4.101]) by proofpoint1.lanl.gov (8.14.3/8.14.3) with ESMTP id o1QJZ33s026983; Fri, 26 Feb 2010 12:35:04 -0700 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay1.lanl.gov (Postfix) with ESMTP id E2040242B58; Fri, 26 Feb 2010 12:35:03 -0700 (MST) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay1.lanl.gov Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay1.lanl.gov (Postfix) with ESMTP id CE643242B57; Fri, 26 Feb 2010 12:35:03 -0700 (MST) Original-Received: by webmail1.lanl.gov (Postfix, from userid 48) id C9558450001; Fri, 26 Feb 2010 12:35:03 -0700 (MST) Original-Received: from 130.55.132.103 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Fri, 26 Feb 2010 11:35:03 -0800 (PST) In-Reply-To: <38064152AFEA47BF9A5DBC6F9F16A6EF@us.oracle.com> User-Agent: SquirrelMail/1.4.8-5.7.lanl7 X-Priority: 3 (Normal) Importance: Normal X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5, 1.2.40, 4.0.166 definitions=2010-02-26_06:2010-02-06, 2010-02-26, 2010-02-25 signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:121406 Archived-At: > If my code gets a file name from the user, and I can't depend on it > being valid for the given platform, why would I *not* need to call > `convert...'? Just wondering. Seems to me this would be similar to the > literal-file-name-string-in-code situation. What harm comes from not calling it? There are plenty of ways that filenames can be useless without `convert-standard-filename' even being able to help. The filename might reside in a directory to which the user has no access, or it might involve a directory that doesn't exist, or be a file you want to open for writing on a read-only filesystem, or... In other words, your code already has to be capable of dealing with the user's filename causing an error when you try to use it. That the error might be "invalid character" rather than "permission denied" is irrelevant; the user has the intelligence (that literal strings lack) to address the problem, so just report it. The error message that Emacs receives from the system in case of an invalid file name might be unhelpful (not tell the user what was wrong with their filename). Nonetheless, transparently changing (on Windows) a user's value of "really?" to "really_" (or whatever) is Not The Right Thing. If it turns out that such uninformative errors are a problem, we instead need (defun filename-valid-p (f) (not (equal f (convert-standard-filename f)))) ; or similar that you can test when the error occurs so as to substitute a more helpful error message. > Anyway, thanks for the extended explanation. It was what I eventually > had understood from the thread, but it helps in any case. If it had > come earlier in the thread, it might have made the thread shorter. ;-) If the thread had been shorter, I might not have gotten so far behind and the reply might have come earlier. ;) Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.