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: Mon, 13 Dec 2010 07:47:49 -0800 Message-ID: <62A30B68351D478582F85071F8D2909C@us.oracle.com> References: <7F477A16FFA145E5AB532A96F55D5CDC@us.oracle.com> <022D0B344DB64B2A9E1B771B0695237E@us.oracle.com> <83k4jeu6pf.fsf@gnu.org> <0910543A74614DBD82DA14ED1B5E4D17@us.oracle.com> <8D21A82F766C4B0493597D9B294A7983@us.oracle.com> <0C4C99D992E6435E9931DA26D1DD476E@us.oracle.com> <83wrndhfcz.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: dough.gmane.org 1292256516 8689 80.91.229.12 (13 Dec 2010 16:08:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Dec 2010 16:08:36 +0000 (UTC) Cc: 7617@debbugs.gnu.org To: "'Eli Zaretskii'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 13 17:08:29 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 1PSAwv-0006VN-8G for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Dec 2010 17:08:29 +0100 Original-Received: from localhost ([127.0.0.1]:50945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSAhj-0007eV-7T for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Dec 2010 10:52:47 -0500 Original-Received: from [140.186.70.92] (port=52313 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSAhY-0007aj-R4 for bug-gnu-emacs@gnu.org; Mon, 13 Dec 2010 10:52:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSAhQ-0001vE-RL for bug-gnu-emacs@gnu.org; Mon, 13 Dec 2010 10:52:33 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSAhQ-0001v9-NC for bug-gnu-emacs@gnu.org; Mon, 13 Dec 2010 10:52:28 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PSAYI-0007il-P1; Mon, 13 Dec 2010 10:43: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 15:43: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.129225492729609 (code B ref 7617); Mon, 13 Dec 2010 15:43:02 +0000 Original-Received: (at 7617) by debbugs.gnu.org; 13 Dec 2010 15:42:07 +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 1PSAXO-0007hW-MQ for submit@debbugs.gnu.org; Mon, 13 Dec 2010 10:42:07 -0500 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSAXL-0007h1-MF for 7617@debbugs.gnu.org; Mon, 13 Dec 2010 10:42:04 -0500 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id oBDFmCui028784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 13 Dec 2010 15:48:13 GMT Original-Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id oBDFmARk011327; Mon, 13 Dec 2010 15:48:10 GMT Original-Received: from abhmt006.oracle.com by acsmt354.oracle.com with ESMTP id 849530541292255269; Mon, 13 Dec 2010 07:47:49 -0800 Original-Received: from dradamslap1 (/10.159.255.35) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 13 Dec 2010 07:47:48 -0800 X-Mailer: Microsoft Office Outlook 11 In-reply-to: <83wrndhfcz.fsf@gnu.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 Thread-Index: Acua2NbyUUpmSZpSS2GYmeuNfcDpcgAAXqsg X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 13 Dec 2010 10:43: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:42487 Archived-At: > > And it's not clear what that would mean in terms of the > > expansion I'm after (which is exactly the expansion of > > `expand*' minus the slash collapsing). > > But after the expansion, wouldn't you remove everything up to and > including the double slash? No, not at all. If I wanted to remove the prefix I would use `substitute-in-file-name'. > If so, why do you need the expansion, if > most of it will be thrown away? And if you don't remove the part up > to the double slash, then why do you need to keep the double slash? This is raw user input. I want to keep the prefix, if any, as it is (modulo ~ and any other changes `expand*' makes except for slash collapsing). I don't ever remove the prefix. Emacs (e.g. file-name reading) handles (ignores/removes) the prefix when the user finally hits RET. E.g., I want this behavior, with ~ = /home/toto": (expand-file-name "foo" "~//usr/") -> "/home/toto//usr/foo" Likewise, if double slashes appear in the first arg I want them preserved. As I said, "exactly the expansion of `expand*' minus the slash collapsing". It's OK. I can go with what I have now. And I can keep looking or experiment with other approaches such as temporarily removing the prefix (if any) and sewing it back on. I get the message that I haven't missed some obviously better solution. And I get the message that the `expand*' behavior will not be changed (including, e.g., adding an optional arg that inhibits slash collapsing). Thanks for adding mention of slash collapsing to the doc string. I hope you will also consider mentioning that a valid file name is expected and anything else results in undefined behavior. Feel free to close the bug now.