From: prj@po.cwru.edu (Paul Jarc)
Subject: Re: (concat "/dir/name/" "foo") --> (expand-file-name "foo" "/dir/name/")
Date: 13 Oct 2000 17:13:27 -0400 [thread overview]
Message-ID: <m3r95kzboy.fsf@multivac.student.cwru.edu> (raw)
In-Reply-To: Kai.Grossjohann@CS.Uni-Dortmund.DE's message of "13 Oct 2000 22:55:32 +0200"
Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
> In the Gnus source code, we often have constructs like this:
>
> (concat "/dir/name/" "file-name")
>
> I think this should be replaced with:
>
> (expand-file-name "file-name" "/dir/name/")
>
> What do you think?
It depends on the contents of "file-name". If it might contain
something that really needs to be normalized, then it should be handed
to expand-file-name. If it should be interpreted literally, then
expand-file-name might do something unintended. Consider, e.g.,
"foo/../bar", where foo is a symlink.
The default maildir in nnmaildir is expressed as
(concat (file-name-as-directory (expand-file-name "~")) "Maildir").
User-supplied maildir names are also normalized once with
expand-file-name, but then after that, dir/file is always accessed
with (concat (file-name-as-directory dir) file). I think
file-name-as-directory and directory-file-name are idempotent on all
platforms, although they aren't documented as such, AFAICT. nnmaildir
doesn't depend on their idempotency, as long as user-supplied maildir
names are what would be returned from directory-file-name.
paul
next prev parent reply other threads:[~2000-10-13 21:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-10-13 20:55 Kai Großjohann
2000-10-13 21:13 ` Paul Jarc [this message]
2000-10-13 22:19 ` Kai Großjohann
2000-10-16 18:12 ` Dave Love
2000-10-16 20:39 ` Paul Jarc
2000-10-16 22:36 ` Daniel Pittman
2000-10-18 17:55 ` Dave Love
2000-10-18 21:35 ` Paul Jarc
2000-10-22 16:00 ` Dave Love
2000-10-22 18:10 ` Paul Jarc
2000-10-22 18:51 ` Kai Großjohann
2000-10-23 0:45 ` Paul Jarc
2000-10-23 7:52 ` Kai Großjohann
2000-10-23 15:29 ` Paul Jarc
2000-10-19 1:11 ` Daniel Pittman
2000-10-22 16:02 ` Dave Love
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3r95kzboy.fsf@multivac.student.cwru.edu \
--to=prj@po.cwru.edu \
/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.
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 NNTP newsgroup(s).