emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs and Squiggles as filenames


From: Richard M. Stallman
Subject: Re: Emacs and Squiggles as filenames
Date: Mon, 11 Jul 2005 01:34:57 -0400

    >> (expand-file-name (file-name-nondirectory fname) dir)
    >>
    >>
    >> should return fname back.  It is like an identity, right?  If not,
    >> what is the way to *always* correctly do an expand-file-name ?
    >
    > This works for me:
    > (concat (file-name-as-directory "~/tmp")
    >         (file-name-nondirectory "~/tmp/~"))

    I am afraid that the former version is _so_ ingrained into Elisp code
    that we should add advice into DOC strings and Elisp manual.

It is not just frequent, it is what we have always called "the right
way".  Using concat has been slightly deprecated, partly because it
won't work in the case where the directory name fails to end in a
slash.  Many places in the code were written to use expand-file-name
because it was the preferred method.

I think that using concat will always work right when the directory
name is properly formatted.  However, rather than recommend use of
concat, I would rather define a new function specifically for this
purpose.  It could be called `merge-file-name'.




reply via email to

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