From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#47790: 27.2; XDG_DATA_HOME evaluation in move-file-to-trash Date: Thu, 15 Apr 2021 11:20:49 +0300 Message-ID: <83y2dkx8ke.fsf@gnu.org> References: <871rbcnfb5.fsf@posteo.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32265"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47790@debbugs.gnu.org To: Thierry Volpiatto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 15 10:22:10 2021 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 1lWxGM-0008F1-3I for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Apr 2021 10:22:10 +0200 Original-Received: from localhost ([::1]:37162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWxGL-0002h1-0X for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Apr 2021 04:22:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWxGE-0002d9-Rl for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2021 04:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53139) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWxGE-0002nT-Jb for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2021 04:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lWxGE-0005Gz-EY for bug-gnu-emacs@gnu.org; Thu, 15 Apr 2021 04:22: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: Thu, 15 Apr 2021 08:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47790 X-GNU-PR-Package: emacs Original-Received: via spool by 47790-submit@debbugs.gnu.org id=B47790.161847487120202 (code B ref 47790); Thu, 15 Apr 2021 08:22:02 +0000 Original-Received: (at 47790) by debbugs.gnu.org; 15 Apr 2021 08:21:11 +0000 Original-Received: from localhost ([127.0.0.1]:36452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWxFO-0005Fm-7p for submit@debbugs.gnu.org; Thu, 15 Apr 2021 04:21:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWxFJ-0005Eu-P2 for 47790@debbugs.gnu.org; Thu, 15 Apr 2021 04:21:08 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59861) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWxFE-00022G-G9; Thu, 15 Apr 2021 04:21:00 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3824 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lWxFC-0008Pq-IT; Thu, 15 Apr 2021 04:21:00 -0400 In-Reply-To: <871rbcnfb5.fsf@posteo.net> (message from Thierry Volpiatto on Thu, 15 Apr 2021 10:05:04 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:204049 Archived-At: > From: Thierry Volpiatto > Date: Thu, 15 Apr 2021 10:05:04 +0200 > > > In `move-file-to-trash` there is this code: > > (or (getenv "XDG_DATA_HOME") > "~/.local/share") > > If XDG_DATA_HOME is not set getenv returns nil and that's fine, if > XDG_DATA_HOME is set to a file path this path is returned and it's fine > as well, however if user follow recommendations of > https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html > and set XDG_DATA_HOME to "$HOME/.local/share" then the above block will > return this value from getenv which is wrong, `substitute-in-file-name` > should be used here. > > (setenv "XDG_DATA_HOME" "$HOME/.local/share") Is this a valid setting of an environment variable? IOW, are values of environment variables allowed to reference other environment variables, and thus are applications required to recursively expand the values of environment variables until no references are left? And, as a corollary, does it mean that '$' in file names are not supported by environment variables whose values are file names?