|
From: | Marcus Harnisch |
Subject: | bug#40949: 26.3; substitute-env-in-file-name: Undefined variables not substituted |
Date: | Wed, 29 Apr 2020 14:06:11 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 29/04/2020 13.27, Eli Zaretskii wrote:
The definition is special-cased for MS-Windows (passes result of getenv as opposed to a hardcoded t as optional argument to substitute-env-vars) and I am not able to check the relevant behaviour on that platform. That's why I pointed it out.Your report seems to imply that the behavior on MS-Windows is different, but it isn't: if the variable is undefined, we leave it unaltered on those systems as well.
It is probably moot to argue against long-standing practice, but the behaviour could perhaps benefit from a note in docstrings of functions that rely on `s-e-i-f-n'. Having used Emacsen and POSIX systems for about the same number of decades, I found this difference (Emacs vs shell) rather surprising.Whether Emacs should follow what the shell does is a separate issue. In this case, since we use this function in substitute-in-file-name, what it does should serve what substitute-in-file-name was always doing: it left the $foo constructs unaltered.
Thanks, Marcus
[Prev in Thread] | Current Thread | [Next in Thread] |