From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 36490@debbugs.gnu.org, erik_hahn@gmx.de
Subject: bug#36490: 26.1; directory-files-recursively breaks when it encounters a directory named "~"
Date: Tue, 09 Jul 2019 18:35:46 +0300 [thread overview]
Message-ID: <83bly35igd.fsf@gnu.org> (raw)
In-Reply-To: <87zhlo1bfl.fsf@mouse.gnus.org> (message from Lars Ingebrigtsen on Mon, 08 Jul 2019 23:08:46 +0200)
> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Mon, 08 Jul 2019 23:08:46 +0200
> Cc: 36490@debbugs.gnu.org
>
> Actually, the doc string of expand-file-name is either wrong, or the
> implementation is.
>
> It says:
>
> ---
> An initial ‘~/’ expands to your home directory.
> An initial ‘~USER/’ expands to USER’s home directory.
> ---
>
> Assuming the "An initial" refers to the first parameter, then
>
> (expand-file-name "~/" "/tmp/")
> => "/home/larsi/"
>
> works as advertised, but
>
> (expand-file-name "~" "/tmp/")
> => "/home/larsi"
>
> is a different thing: "~" is a perfectly valid file name, so having this
> function map that to something else is just... wrong.
If you want "~" to be interpreted literally, you need to protect it
with "/:".
> (expand-file-name "~larsi" "/tmp/")
> => "/home/larsi"
>
> is the same: Also wrong and undocumented.
Why would we want to document that?
> The doc string continues with further confusion:
>
> ---
> See also the function ‘substitute-in-file-name’.
> ---
>
> See it for... what?
For expanding environment variables, and for the special effect of
"//" etc.
> So what to do here? I think the current, undocumented
>
> (expand-file-name "~" "/tmp/")
> => "/home/larsi"
>
> must surely be an error, and that should be fixed instead of the
> callers? Opinions?
It is not an error.
next prev parent reply other threads:[~2019-07-09 15:35 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-03 18:07 bug#36490: 26.1; directory-files-recursively breaks when it encounters a directory named "~" Erik Hahn
2019-07-08 20:59 ` Lars Ingebrigtsen
2019-07-08 21:08 ` Lars Ingebrigtsen
2019-07-08 21:30 ` Erik Hahn
2019-07-08 21:56 ` Lars Ingebrigtsen
2019-07-09 15:39 ` Eli Zaretskii
2019-07-09 15:35 ` Eli Zaretskii [this message]
2019-07-09 15:50 ` Lars Ingebrigtsen
2019-07-09 16:12 ` Eli Zaretskii
2019-07-09 16:27 ` Lars Ingebrigtsen
2019-07-09 16:44 ` Eli Zaretskii
2019-07-09 16:50 ` Lars Ingebrigtsen
2019-07-09 16:52 ` Eli Zaretskii
2019-07-09 17:00 ` Lars Ingebrigtsen
2019-07-09 17:23 ` Eli Zaretskii
2019-07-09 18:16 ` Michael Albinus
2019-07-10 11:55 ` Lars Ingebrigtsen
2019-07-10 14:56 ` Eli Zaretskii
2019-07-11 15:05 ` Lars Ingebrigtsen
2019-07-09 18:58 ` Basil L. Contovounesios
2019-07-09 19:19 ` Eli Zaretskii
2019-07-09 16:17 ` Andreas Schwab
2019-07-10 12:04 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83bly35igd.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=36490@debbugs.gnu.org \
--cc=erik_hahn@gmx.de \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.