emacs-devel
[Top][All Lists]
Advanced

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

Re: `concat' a dir and a file (was: Strange `file-name-sans-extension' b


From: Richard Stallman
Subject: Re: `concat' a dir and a file (was: Strange `file-name-sans-extension' behavior )
Date: Fri, 16 Aug 2002 22:51:10 -0600 (MDT)

    The `Subject:' had not been updated, so it was misleading.
    The discussion is about whether or not we need a new function
    that is like expand-file-name but does not necessarily return
    an absolute file name.

I treated that as a subtopic of the issue of what to do with
file-name-sans-extension, and considered it only in reference to that
main topic.  Now I will address the new topic

As far as I can see, if you don't insist on an absolute file name,
it is correct to use concat.  As far as I can see, Eli's example
is only an issue if you want an absolute file name:

>     It means that to produce a full file name from a relative directory
>     "c:" and a relative file name "bar", a function should yield
>     "c:./bar".

Eli, is c:bar an invalid file name on MSDOS?

So it seems that in the case where you are happy to have
a non-absolute file name as the result, there is no problem.

    I've sometimes tried to use
      (let ((default-directory nil)) (expand-file-name bar foo))
    or
      (let ((default-directory "")) (expand-file-name bar foo))

    but it prepends "/" or "./" to the result.

Is that what you had in mind when you spoke of appending a slash?  It
would follow that these methods are not good ones.  However, that
doesn't say anything about whether concat is a good method.





reply via email to

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