From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#40949: 26.3; substitute-env-in-file-name: Undefined variables not substituted Date: Wed, 29 Apr 2020 14:27:35 +0300 Message-ID: <83k11yzg48.fsf@gnu.org> References: <1eb1b018-e7c6-848d-21ef-6078a3258789@gmx.net> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="98139"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40949@debbugs.gnu.org To: Marcus Harnisch , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 29 13:31:04 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTkvf-000PQU-CF for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Apr 2020 13:31:03 +0200 Original-Received: from localhost ([::1]:52380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTkve-0003Z9-Ct for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Apr 2020 07:31:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48330) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTkuj-0002tS-45 for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2020 07:30:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTkti-0002x2-QQ for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2020 07:30:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59274) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jTkti-0002wx-Eo for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2020 07:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jTkti-00012b-AS for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2020 07:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Apr 2020 11:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40949 X-GNU-PR-Package: emacs Original-Received: via spool by 40949-submit@debbugs.gnu.org id=B40949.15881596823920 (code B ref 40949); Wed, 29 Apr 2020 11:29:02 +0000 Original-Received: (at 40949) by debbugs.gnu.org; 29 Apr 2020 11:28:02 +0000 Original-Received: from localhost ([127.0.0.1]:42587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTksj-000116-UX for submit@debbugs.gnu.org; Wed, 29 Apr 2020 07:28:02 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTksi-00010p-6F for 40949@debbugs.gnu.org; Wed, 29 Apr 2020 07:28:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52880) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTksc-0002V4-DN; Wed, 29 Apr 2020 07:27:54 -0400 Original-Received: from [176.228.60.248] (port=4115 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jTksb-0002Qb-PY; Wed, 29 Apr 2020 07:27:54 -0400 In-Reply-To: <1eb1b018-e7c6-848d-21ef-6078a3258789@gmx.net> (message from Marcus Harnisch on Tue, 28 Apr 2020 22:38:14 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:179300 Archived-At: > From: Marcus Harnisch > Date: Tue, 28 Apr 2020 22:38:14 +0200 > > With commit ee041f2d07b6ed485dc34c115588f973f046c9d4 the function > `substitute-env-in-file-name' was introduced. > > The function substitutes environment variable references in filenames > with the help of `substitute-env-vars'. On systems that are neither > windows-nt nor ms-dos, the optional argument to that function is set to > t with the consequence that references to undefined variables are not > substituted. This is unexpected, IMHO. > Expected behaviour would match that of shell expansion, which > substitutes undefined variables with the empty string. 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. 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.