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

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

bug#36490: 26.1; directory-files-recursively breaks when it encounters a


From: Lars Ingebrigtsen
Subject: bug#36490: 26.1; directory-files-recursively breaks when it encounters a directory named "~"
Date: Mon, 08 Jul 2019 23:56:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Erik Hahn <erik_hahn@gmx.de> writes:

> It is related in that it also chokes on files named "~":
>
> (substitute-in-file-name "/tmp/~") => "~"
>
> Its doc string is also wrong. It says
>
>> If ‘/~’ appears, all of FILENAME through that ‘/’ is discarded.
>
> but
>
> (substitute-in-file-name "/tmp/~foo") => "/tmp/~foo"

Yup, it's only if the user exists:

(substitute-in-file-name "/tmp/~larsi")
=> "~larsi"

Same as with expand-file-name:

(expand-file-name "~larsi" "/tmp/")
=> "/home/larsi"

(expand-file-name "~foo" "/tmp/")
=> "/tmp/~foo"

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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