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: convert-standard-filename Date: Sun, 07 Aug 2011 11:33:53 -0400 Message-ID: References: <83vcufaaqf.fsf@gnu.org> <83hb5vvwdp.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1312731247 12708 80.91.229.12 (7 Aug 2011 15:34:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 7 Aug 2011 15:34:07 +0000 (UTC) Cc: sds@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 07 17:34:02 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qq5MX-0006ia-78 for ged-emacs-devel@m.gmane.org; Sun, 07 Aug 2011 17:34:01 +0200 Original-Received: from localhost ([::1]:47793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qq5MW-0006Bw-PZ for ged-emacs-devel@m.gmane.org; Sun, 07 Aug 2011 11:34:00 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qq5MT-0006Ba-NZ for emacs-devel@gnu.org; Sun, 07 Aug 2011 11:33:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qq5MS-0004ou-QS for emacs-devel@gnu.org; Sun, 07 Aug 2011 11:33:57 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:15527 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qq5MR-0004oc-9y; Sun, 07 Aug 2011 11:33:55 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EALWvPk5FxKeo/2dsb2JhbABCpzR4gUABAQQBViMQCy0HEhQYDSSIALh2gzmDDQSfVYQx X-IronPort-AV: E=Sophos;i="4.67,333,1309752000"; d="scan'208";a="129372839" Original-Received: from 69-196-167-168.dsl.teksavvy.com (HELO ceviche.home) ([69.196.167.168]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 07 Aug 2011 11:33:53 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 3204566386; Sun, 7 Aug 2011 11:33:53 -0400 (EDT) In-Reply-To: <83hb5vvwdp.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 06 Aug 2011 10:20:50 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:142957 Archived-At: >> But how should it decide what is relative and what is not, e.g. in the >> case of "c:/foo" (or worse "c:foo") mentioned in the docstring? > Why by file-name-absolute-p, of course ;-) This would mean that the input is interpreted in an OS-dependent way. It would seem to make more sense to say that the arg to convert-filename-argument (or its new replacement) should be a Unix-style filename, i.e. "C:" is always interpreted as a relative file name, even under Window or DOS. >> AFAICT, there are the following different needs: >> - The original intention: convert a standard name such as "~/.emacs" so >> it works everywhere. The argument should come from within Emacs. >> This should pretty much only be used with a constant argument. >> Maybe (a big maybe) it can be used for things like generating >> a filename from some other piece of data, but I think even that should >> be discouraged in favor of `md5'. >> - Take a filename from outside Emacs and convert it into something Emacs >> can use internally. Can do things like cygwin handling. Can assume >> that the provided filename is valid, so it doesn't need to be careful >> to drop invalid filename characters. Can convert backslashes into >> slashes on Windows. >> - Take an internal filename and convert it to something that can be used >> outside of Emacs. E.g. convert slashes into backslashes. Again, this >> can probably assume that the file name is already valid and doesn't >> need to drop funny chars. > Something like that. There's also dos-8+3-filename, which is needed > when one compares with string= internal file names with those found on > disk, but that's DOS-specific, or maybe it can be merged into the last > category. How 'bout a file-name-equal, which could also try to account for case-sensitivity? Hmm... I didn't check all uses of doc-8+3-filename, but at least the one in files.el can't be replaced by file-name-equal. Stefan