From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#7617: 24.0.50; `expand-file-name': removal of slashes Date: Sun, 12 Dec 2010 20:32:12 -0800 Message-ID: <8D21A82F766C4B0493597D9B294A7983@us.oracle.com> References: <7F477A16FFA145E5AB532A96F55D5CDC@us.oracle.com><022D0B344DB64B2A9E1B771B0695237E@us.oracle.com><83k4jeu6pf.fsf@gnu.org><0910543A74614DBD82DA14ED1B5E4D17@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1292215961 12941 80.91.229.12 (13 Dec 2010 04:52:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Dec 2010 04:52:41 +0000 (UTC) Cc: 7617@debbugs.gnu.org To: "'Stefan Monnier'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 13 05:52:37 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1PS0Oq-0003FC-4I for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Dec 2010 05:52:36 +0100 Original-Received: from localhost ([127.0.0.1]:55491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PS0Op-0005uv-I5 for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 Dec 2010 23:52:35 -0500 Original-Received: from [140.186.70.92] (port=55179 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PS0Ok-0005r2-CJ for bug-gnu-emacs@gnu.org; Sun, 12 Dec 2010 23:52:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PS0Oj-0000AT-3l for bug-gnu-emacs@gnu.org; Sun, 12 Dec 2010 23:52:30 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PS0Oj-0000AP-0r for bug-gnu-emacs@gnu.org; Sun, 12 Dec 2010 23:52:29 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PS014-0007uW-2m; Sun, 12 Dec 2010 23:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Dec 2010 04:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7617 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7617-submit@debbugs.gnu.org id=B7617.129221442930293 (code B ref 7617); Mon, 13 Dec 2010 04:28:02 +0000 Original-Received: (at 7617) by debbugs.gnu.org; 13 Dec 2010 04:27:09 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PS00C-0007sW-WF for submit@debbugs.gnu.org; Sun, 12 Dec 2010 23:27:09 -0500 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PS00A-0007ry-KK for 7617@debbugs.gnu.org; Sun, 12 Dec 2010 23:27:07 -0500 Original-Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id oBD4XE4P015951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 13 Dec 2010 04:33:15 GMT Original-Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id oBD4Gq5e008819; Mon, 13 Dec 2010 04:33:13 GMT Original-Received: from abhmt015.oracle.com by acsmt353.oracle.com with ESMTP id 847704691292214730; Sun, 12 Dec 2010 20:32:10 -0800 Original-Received: from dradamslap1 (/10.159.218.180) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 12 Dec 2010 20:32:10 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 Thread-Index: AcuaeVZQjx1RFDzQRq6PX9lxfqTkpAAALAvw X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 12 Dec 2010 23:28:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:42474 Archived-At: > > I am using the function `expand*' on user input (one operation among > > many), to do just what is advertised for `expand*' > > There-s your problem. You treat user input in a `read-file-name' > as an actual file name (i.e. suitable to pass to functions like > expand-file-name), "Suitable to pass to functions like expand-file-name" is precisely the question that you are begging. That suitability is completely undefined so far. Part of this bug report asks that you document (a) just what is acceptable to `expand-file-name' as "file-name" syntax (for each arg) and (b) what happens if the arg is a string that is not of acceptable file-name syntax. For (a) it is no doubt enough to say that it is whatever syntax is acceptable by the current file system (if that is in fact the answer). But that should be stated explicitly, along with a description of (b). > whereas it is actually a different beast, closely > related, but different: it has this "..// -> /" and ".../~ -> > ~" rules, as well as env-var expansion (which also implies > "$$ -> $" rewrite). And even these special rules depend on > file-name-handlers so, e.g., they do not apply to URLs but other > rules may aaply to other special filenames. I.e. the only safe > thing to do is to first pass those strings through > substitute-for-file-name. Please read what I wrote. I am looking for a function that gives the behavior that is documented for `expand-file-name'. That's all. I do not want the slash-collapsing that also occurs but is (was before now) undocumented. And I do not want any of the input-transforming behavior provided by `read-file-name' or `substitute-in-file-name'. (I do not see any `substitute-for-filename' function; I assume you meant `*-in-*'.) In particular, I do not want ...// prefix removal or env var substitution. I've stated several times already that I am not looking for the behavior of `substitute-in-file-name'. If you do not regard the undocumented slash-collapsing of `expand-file-name' as a bug, then I am obviously looking for a different function. In any case, its documented behavior (= the Emacs 20 behavior) is exactly what I am looking for. Do you know a good way to get that behavior in Lisp? I am getting it now by calling `expand-file-name' within an envelope that restores any consecutive slashes that get removed, but I'm looking for something less ugly.