GNU bug report logs - #57102
29.0.50; Peculiar file-name-split edge case

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Wed, 10 Aug 2022 08:26:02 UTC

Severity: normal

Found in version 29.0.50

Full log


Message #56 received at 57102 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Mattias EngdegÄrd <mattiase <at> acm.org>,
 Philip Kaludercic <philipk <at> posteo.net>, 57102 <at> debbugs.gnu.org
Subject: Re: bug#57102: 29.0.50; Peculiar file-name-split edge case
Date: Mon, 26 Sep 2022 07:14:56 -0400
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Kangas <stefankangas <at> gmail.com> writes:
>
>> I also note that we have `string-split' and `string-join', but
>> `file-name-split' and `file-name-concat'.  I think `file-name-join'
>> would be a better name.
>
> I think that makes sense...
>
>> We should leave behind an alias if we rename it of course, perhaps
>> forever.
>
> An obsolete alias?

Sure.

But, thinking more about this, maybe we would want a new function.
Because this is not fun:

    (apply #'file-name-concat (file-name-split "/foo/bar"))
    => "foo/bar"

I'd like it better if it worked like this:

    (file-name-join (file-name-split "/foo/bar"))
    => "/foo/bar"

And then there are the issues Mattias has pointed out.  One small step
in the right direction would be to make sure that:

    (equal (file-name-split "/foo")
           (file-name-split "//foo"))




This bug report was last modified 2 years and 355 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.