bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Nicolas Richard
Subject: bug#27982: 25.1.50; expand-file-name docstring on how to traverse the filesystem
Date: Wed, 23 Aug 2017 14:18:24 +0200
User-agent: mu4e 0.9.19; emacs 25.2.1

Hello,

Thanks for your comment.

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Nicolas Richard <youngfrog@members.fsf.org>
>> 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.





reply via email to

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