unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Thierry Volpiatto <thievol@posteo.net>
Cc: 47790@debbugs.gnu.org
Subject: bug#47790: 27.2; XDG_DATA_HOME evaluation in move-file-to-trash
Date: Thu, 15 Apr 2021 11:20:49 +0300	[thread overview]
Message-ID: <83y2dkx8ke.fsf@gnu.org> (raw)
In-Reply-To: <871rbcnfb5.fsf@posteo.net> (message from Thierry Volpiatto on Thu, 15 Apr 2021 10:05:04 +0200)

> From: Thierry Volpiatto <thievol@posteo.net>
> 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?





  reply	other threads:[~2021-04-15  8:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15  8:05 bug#47790: 27.2; XDG_DATA_HOME evaluation in move-file-to-trash Thierry Volpiatto
2021-04-15  8:20 ` Eli Zaretskii [this message]
2021-04-15 10:37   ` Thierry Volpiatto
2021-04-15 12:12     ` Basil L. Contovounesios
2021-04-15 12:23       ` Eli Zaretskii
2021-04-24  7:14         ` Thierry Volpiatto
2021-04-24 10:58           ` Basil L. Contovounesios
2021-04-24 11:30             ` Thierry Volpiatto
2021-04-24 12:19               ` Basil L. Contovounesios

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83y2dkx8ke.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=47790@debbugs.gnu.org \
    --cc=thievol@posteo.net \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).