Subject: bug#27982: 25.1.50; expand-file-name docstring on how to traverse the filesystem

From: Nicolas Richard <[email-masked]>
Date: Wed, 23 Aug 2017 14:18:24 +0200

Hello,

Thanks for your comment.

Eli Zaretskii <[email-masked]> writes:

>> From: Nicolas Richard <[email-masked]>
>> Date: Sun, 06 Aug 2017 13:38:32 +0200
>>
>> The docstring of expand-file-name suggest
>> (directory-file-name (file-name-directory dirname))
>> to traverse a directory
>
> No, it only suggests that as a more reliable alternative to
>
>   (expand-file-name ".." dirname)

If it's an alternative, shouldn't it have an equivalent effect, except
for cases where it's better? Or perhaps my english is lacking and I
misunderstand the suggestion completely.

Let me rephrase my example just to make sure I explained myself
correctly:

(let ((dirname current-directory))
   (format "%s versus %s"
      (directory-file-name (file-name-directory dirname))
      (expand-file-name ".." dirname)))
=> "/home/youngfrog versus /home"
=> Effect is clearly different.

With my suggestion this would become:

(let ((dirname current-directory))
   (format "%s versus %s"
      (file-name-directory (directory-file-name dirname))
      (expand-file-name ".." dirname)))
=> "/home/ versus /home"
=> Effect is somewhat similar

Nicolas.