[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: file-truename, convert-standard-filename

From: Drew Adams
Subject: RE: file-truename, convert-standard-filename
Date: Fri, 5 Feb 2010 15:51:01 -0800

> `convert-standard-filename' is for file names embedded as literal
> strings within Emacs sources.
> On Windows, `file-truename' also converts a short 8+3 alias into its
> long original.  So, for example, `C:/DOCUME~1/USER/LOCALS~1/Temp' is
> converted into `C:/Documents and Settings/USER/Local Settings/Temp'.
> It also converts the letter-case to what is actually recorded in the
> filesystem.
> > But in terms of use, if I want to, say, compare two file 
> > names to see if they represent the same file, what's
> > typically appropriate?
> Using `file-truename' should be enough.  If you compare against a
> literal string that holds a name of a file mentioned in Emacs sources,
> such as ".emacs" or ".desktop", run them through
> `convert-standard-filename' first.  As Andreas points out, an existing
> file should not be subject to `convert-standard-filename'.

Thanks. Could you perhaps consider adding some of that information to the doc? I
don't see any of it there.

And judging from this thread, it appears that the purpose of
`convert-standard-filename' is not too clear to everyone. It's still not clear
to me, at least. 

What do you mean by "embedded literal string" in the source code? If the Emacs
source code has (defcustom foo ".emacs"...), do I need to apply c-s-f to foo in
order to compare its value? And does "Emacs sources" apply only to code
distributed with Emacs or to any Emacs-Lisp source code?

And you seem to say two things: a "file name embedded as a literal string" and
"a name of a file mentioned in Emacs sources". Is c-s-f needed for certain file
names (e.g. those "mentioned" in Emacs sources) or for certain strings (e.g.
literal strings in distributed source code) that name files? IOW, is it about
the name or the actual string object?

Does it matter whether it's (string= (file-truename ".emacs") (file-truename
bar)) or (string= (file-truename foo) (file-truename bar)), where foo's value is
".emacs"? Is c-s-f needed in the former case but not the latter?

Obviously, I'm not yet understanding what this is about. Does it have something
to do with strings that are defined before Emacs gets dumped?

Please feel free to ignore all my questions and just try to explain again,
directly. All I want is to understand.

I've read the replies from Andreas, Stefan, and you, and it's clear that this is
clear to all of you, but I still don't get it, based on what you've said so far.

> Which defcustoms use `file-truename'?

Hm; my bad. I coulda sworn I saw some...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]