Subject: RE: bug#7617: 24.0.50; `expand-file-name': removal of slashes

From: "Drew Adams" <[email-masked]>
Date: Sun, 12 Dec 2010 12:21:31 -0800

> > In interactive use, `...//abc...' is treated as just 
> > `/abc...' by Emacs.  The prefix `.../' is ignored until
> > you hit `RET'.  And then the prefix is dropped
> > when you enter the file name (`RET') - but only then.
> > And that's appropriate.  Other than when you actually
> > hit `RET', the prefix should not be removed but
> > simply ignored.
> 
> That's right, but I was talking about non-interactive uses.  I believe
> in interactive use, Emacs still does what you (and I) expect.

This is not about existing calls to `expand-file-name' in the vanilla Emacs
sources.

I am using the function `expand*' on user input (one operation among many), to
do just what is advertised for `expand*' - just the kind of canonicalization
that is described, which does not include collapsing consecutive slashes.

`expand*' does not do what is documented for it.  The choices - for this bug
report - are to either fix that behavior or provide a function that does what we
claim `expand*' does.  That is what this bug report is about: providing that
functionality, one way or the other.

> > Then please create a separate primitive the does just that.
> 
> Feel free to file a separate feature request for that.

_This_ bug is about the need for a function that does that.  The doc for
`expand*' describes it as exactly that function.  If you do not want to fix the
`expand*' behavior to reflect its description, then please provide the function
under a different name from `extract*'.  You already have the doc string for it.
;-)
 
I would think that you would want to fix the `extract*' behavior, since it can
lead to changing which file is targeted.  But if you do not want to face that,
then please at least provide some other way to get the behavior that is
documented.

> > Currently, there is no way to maintain the integrity of the 
> > user's input if that input is passed through `expand-file-name'
> > to do what the doc says `expand*' does.
> 
> If all you need is ignore everything before the double slash, there
> are easier ways than asking to change a primitive.

You are just running away, Eli.  (Why am I not surprised?)

Stop inventing.  I did not say that I need only to ignore everything before the
double slash.  If that were all I needed I would just do that in Lisp - no need
for any Emacs primitive for that.

I said (very clearly) that I need to do just what `expand*' is contracted to do
- _everything_ that its doc says it does, and no more.

You are ignoring the fact that collapsing consecutive slashes typically leads to
changing which file is targeted.  I gave a simple example, but you have nothing
to say about it.  That, to me, is a clear bug in the `expand*' behavior.  But if
you want to ignore that misbehavior, that's your privilege.

I hope that you will at least provide the functionality I asked for, if only via
a different function from `extract*'.

Barring that, I hope you will tell me how, in Lisp, to get the effect that
`expand*' is documented to have, that is, the effect that it had before Emacs
21.