From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/32866 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.emacs.gnus.general Subject: Re: (concat "/dir/name/" "foo") --> (expand-file-name "foo" "/dir/name/") Date: 13 Oct 2000 17:13:27 -0400 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1035169076 22169 80.91.224.250 (21 Oct 2002 02:57:56 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:57:56 +0000 (UTC) Return-Path: Original-Received: from spinoza.math.uh.edu (spinoza.math.uh.edu [129.7.128.18]) by mailhost.sclp.com (Postfix) with ESMTP id E1199D051E for ; Fri, 13 Oct 2000 17:16:17 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by spinoza.math.uh.edu (8.9.1/8.9.1) with ESMTP id QAB29613; Fri, 13 Oct 2000 16:14:58 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 13 Oct 2000 16:13:42 -0500 (CDT) Original-Received: from mailhost.sclp.com (postfix@66-209.196.61.interliant.com [209.196.61.66] (may be forged)) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id QAA10186 for ; Fri, 13 Oct 2000 16:13:32 -0500 (CDT) Original-Received: from multivac.student.cwru.edu (multivac.STUDENT.CWRU.Edu [129.22.239.69]) by mailhost.sclp.com (Postfix) with SMTP id E60A2D051E for ; Fri, 13 Oct 2000 17:13:55 -0400 (EDT) Original-Received: (qmail 14744 invoked by uid 500); 13 Oct 2000 21:13:49 -0000 Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org In-Reply-To: Kai.Grossjohann@CS.Uni-Dortmund.DE's message of "13 Oct 2000 22:55:32 +0200" Original-Lines: 29 User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:32866 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:32866 Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Gro=DFjohann) writes: > In the Gnus source code, we often have constructs like this: >=20 > (concat "/dir/name/" "file-name") >=20 > I think this should be replaced with: >=20 > (expand-file-name "file-name" "/dir/name/") >=20 > 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