From: "Drew Adams" <drew.adams@oracle.com>
To: "'Eli Zaretskii'" <eliz@gnu.org>
Cc: 7617@debbugs.gnu.org
Subject: bug#7617: 24.0.50; `expand-file-name': removal of slashes
Date: Mon, 13 Dec 2010 07:47:49 -0800 [thread overview]
Message-ID: <62A30B68351D478582F85071F8D2909C@us.oracle.com> (raw)
In-Reply-To: <83wrndhfcz.fsf@gnu.org>
> > 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.
next prev parent reply other threads:[~2010-12-13 15:47 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-11 21:53 bug#7617: 24.0.50; `expand-file-name': removal of slashes Drew Adams
2010-12-12 15:58 ` Eli Zaretskii
2010-12-12 18:03 ` Drew Adams
2010-12-12 19:33 ` Eli Zaretskii
2010-12-12 20:21 ` Drew Adams
2010-12-12 20:32 ` Eli Zaretskii
2010-12-12 20:36 ` Drew Adams
2010-12-12 20:42 ` Andreas Schwab
2010-12-13 3:53 ` Stefan Monnier
2010-12-13 4:32 ` Drew Adams
2010-12-13 5:23 ` Eli Zaretskii
2010-12-13 14:51 ` Drew Adams
2010-12-13 15:17 ` Eli Zaretskii
2010-12-13 15:47 ` Drew Adams [this message]
2010-12-13 16:17 ` Eli Zaretskii
2010-12-13 20:40 ` Stefan Monnier
2010-12-12 22:35 ` Drew Adams
2010-12-12 23:40 ` Andreas Schwab
2010-12-13 5:17 ` Eli Zaretskii
2010-12-13 14:51 ` Drew Adams
2010-12-12 20:15 ` Andreas Schwab
2010-12-12 20:25 ` Drew Adams
2010-12-12 20:36 ` Andreas Schwab
2010-12-12 20:42 ` Drew Adams
2010-12-12 21:00 ` Andreas Schwab
2010-12-13 0:49 ` Jason Rumney
2010-12-12 20:39 ` Eli Zaretskii
2010-12-12 21:04 ` Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=62A30B68351D478582F85071F8D2909C@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=7617@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).