[gnu.emacs.bug] expand-file-name tilde problem

wjc@hoswjc.ATT.COM (Bill Carpenter) (09/17/89)

[GNUemacs 18.55 on sun4, sunOS 4.0.3c]

As unlikely as this seems, I came across a file that had accidentally
been created with a leading tilde in its name.  When I tried to visit
it in GNUemacs, I got a message like this:

	"~foo" is not a registered user

I believe that this ultimately comes from "expand-file-name", which is
called by a ton of other file-manipulation functions.

This behavior seems right for filename completion use, but in a few
minutes of fiddling around, I couldn't find a way to visit the file at
all, so something is probably needed here.  Perhaps a good solution
would be to make "expand-file-name" give the error if being used
interactively, but treat the tilde literally in non-interactive use.
Or, give the error and then drive on taking things literally in
interactive mode.
--
   Bill Carpenter         att!ho5cad!wjc  or  attmail!bill

jbw@bucsf.bu.edu (Joe Wells) (09/20/89)

In article <WJC.89Sep16183751@hoswjc.hoswjc.ATT.COM> wjc@hoswjc.ATT.COM (Bill Carpenter) writes:

   [GNUemacs 18.55 on sun4, sunOS 4.0.3c]

   As unlikely as this seems, I came across a file that had accidentally
   been created with a leading tilde in its name.  When I tried to visit
   it in GNUemacs, I got a message like this:

	   "~foo" is not a registered user

I think the best solution to this is to let ~~ represent a single tilde
character, similar to the way $$ is used for a single dollar sign.
Perhaps the ~ expansion code should be moved into substitute-in-file-name,
along with the environment variable expansion code.  I have always felt
that ~ expansion should only occur in interactively read filenames, and
this would accomplish that.

--
Joe Wells <jbw@bucsf.bu.edu>
jbw%bucsf.bu.edu@bu-it.bu.edu
...!harvard!bu-cs!bucsf!jbw

mike@octel.UUCP (Michael D. Crawford) (09/20/89)

In article <38487@bu-cs.BU.EDU> jbw@bucsf.bu.edu (Joe Wells) writes:

>I think the best solution to this is to let ~~ represent a single tilde
>character, similar to the way $$ is used for a single dollar sign.
>Perhaps the ~ expansion code should be moved into substitute-in-file-name,
>along with the environment variable expansion code...  

Hear hear!

>...I have always felt
>that ~ expansion should only occur in interactively read filenames, and
>this would accomplish that.
>

I beg to differ.  I like to use the ~ expansion in my .emacs file:

(load "~mike/lisp/my-files.el")

As a consultant I get around to a lot of different machines, with different
home directories, and I like to load my personal .emacs while I am running
as root.

I suppose it would not be to for my to work around it if non-interactive ~
expansion were taken out.

>--
>Joe Wells <jbw@bucsf.bu.edu>
>jbw%bucsf.bu.edu@bu-it.bu.edu
>...!harvard!bu-cs!bucsf!jbw


-- 
Michael David Crawford			Consulting for:
Oddball Enterprises			Octel Communications Corp
694 Nobel Drive				890 Tasman Drive
Santa Cruz, CA 95060			Milpitas CA 95035
uunet!apple!vsi1!octel!mike
CI$ 72377,623

Ain't got no cache, ain't no file, ain't got no disk to make you smile,
Don`t worry, be happy!