unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: Re: file-truename, convert-standard-filename
Date: Sat, 06 Feb 2010 11:01:23 +0200	[thread overview]
Message-ID: <83bpg2g2l8.fsf@gnu.org> (raw)
In-Reply-To: <0B5BFE3DC87648888328B75164292F06@us.oracle.com>

> From: "Drew Adams" <drew.adams@oracle.com>
> Cc: <emacs-devel@gnu.org>
> Date: Fri, 5 Feb 2010 15:51:01 -0800
> 
> Thanks. Could you perhaps consider adding some of that information to the doc? I
> don't see any of it there.

If I have time.  Although I'm not sure where: we don't have a place in
the manual that describes how to compare file names reliably.  Perhaps
we should.

> 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. 

Even after reading the ELisp node where it is documented?  Could you
tell what else is missing?

> 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?

Only if the other string is a name of a file that already exists in
the filesystem.

> And does "Emacs sources" apply only to code distributed with Emacs
> or to any Emacs-Lisp source code?

The latter, of course.

> 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?

``Literal string'' is the main issue here.  That's why this function
was introduced in the first place: to seamlessly take care of all the
places in Emacs Lisp sources where there's a literal string serving as
a file name, and that string might be an invalid file name on some
filesystems.

> IOW, is it about the name or the actual string object?

It's about the names that are valid on some systems, but not on
others.

> 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?

It is needed in the first case, if `bar' is the name of a file already
existing in the filesystem, because on MS-DOS, `bar' could be "_emacs"
instead.  It _may_ be needed in the second case if one of `foo' or
`bar' is a string whose value is ".emacs", while the other is the name
of a file already existing in the filesystem.  It is _not_ needed if
both `foo' and `bar' hold names of files already existing on
filesystems of the same type.

> 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?

No, Emacs dumping is not the issue here, at least not directly.  For
defcustoms, it's not an issue because a defcustom is evaluated again
when a dumped Emacs starts.  So if the filesystem where it was dumped
is different from the one where it starts, the name will be
recomputed anew.




  parent reply	other threads:[~2010-02-06  9:01 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05 17:31 file-truename, convert-standard-filename Drew Adams
2010-02-05 18:15 ` Andreas Schwab
2010-02-05 18:33   ` Lennart Borgman
2010-02-05 19:45     ` Andreas Schwab
2010-02-05 19:49       ` Lennart Borgman
2010-02-05 20:14     ` Stefan Monnier
2010-02-05 20:18       ` Lennart Borgman
2010-02-06  1:10       ` Miles Bader
2010-02-05 23:51   ` Drew Adams
2010-02-05 19:04 ` Eli Zaretskii
2010-02-05 23:51   ` Drew Adams
2010-02-06  0:17     ` Lennart Borgman
2010-02-06  8:45       ` Eli Zaretskii
2010-02-06 16:55         ` Lennart Borgman
2010-02-06 19:12           ` Eli Zaretskii
2010-02-06 19:20             ` Lennart Borgman
2010-02-06  9:01     ` Eli Zaretskii [this message]
2010-02-06 15:33       ` Drew Adams
2010-02-06 19:33         ` Eli Zaretskii
2010-02-06 20:46           ` Drew Adams
2010-02-06 21:58             ` Eli Zaretskii
2010-02-06 23:12               ` Drew Adams
2010-02-07  4:01                 ` Eli Zaretskii
2010-02-08  1:38                 ` Stefan Monnier
2010-02-08  2:46                   ` Drew Adams
2010-02-26 18:33                 ` Davis Herring
2010-02-26 19:12                   ` Drew Adams
2010-02-26 19:35                     ` Davis Herring
2010-02-26 20:25                       ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2010-02-06  3:52 MON KEY
2010-02-06  8:28 ` Eli Zaretskii
     [not found]   ` <d2afcfda1002061814nc3e178fl5d93e21ea6bae7b5@mail.gmail.com>
2010-02-07  2:16     ` MON KEY
     [not found]     ` <83wrypelms.fsf@gnu.org>
2010-02-07 23:26       ` MON KEY
2010-02-08  0:28         ` Andreas Schwab
2010-02-08  4:10         ` Eli Zaretskii
     [not found]           ` <d2afcfda1002091330y53017b24w5e6bdf3c3d131a97@mail.gmail.com>
2010-02-09 21:32             ` MON KEY
2010-02-09 21:59               ` Andreas Schwab
2010-02-09 22:32             ` Eli Zaretskii

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=83bpg2g2l8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@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).