GNU bug report logs - #47790
27.2; XDG_DATA_HOME evaluation in move-file-to-trash

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thievol <at> posteo.net>

Date: Thu, 15 Apr 2021 08:06:01 UTC

Severity: normal

Tags: notabug

Found in version 27.2

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Thierry Volpiatto <thievol <at> posteo.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 47790-done <at> debbugs.gnu.org
Subject: bug#47790: 27.2; XDG_DATA_HOME evaluation in move-file-to-trash
Date: Sat, 24 Apr 2021 13:19:46 +0100
tags 47790 notabug
close 47790
quit

Thierry Volpiatto <thievol <at> posteo.net> writes:

> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>
>> Thierry Volpiatto <thievol <at> posteo.net> writes:
>>
>>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>>
>>>>> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
>>>>> Cc: Eli Zaretskii <eliz <at> gnu.org>,  47790 <at> debbugs.gnu.org
>>>>> Date: Thu, 15 Apr 2021 13:12:29 +0100
>>>>> 
>>>>> IME when someone says "set FOO to $HOME/.foo" without any further
>>>>> qualification they are implicitly referring to the expansion of
>>>>> $HOME.
>>>>
>>>> That's what I knew, but Thierry seems to say otherwise.
>>>
>>> Well, it is common to set PATH like this:
>>>
>>> PATH="$HOME/bin:$PATH"
>>>
>>> you find this in ~/.profile or ~/.bashrc on many distros.
>>
>> Any variables enclosed in double quotes "..." are expanded when this
>> expression is evaluated by the shell.
>>
>> You can confirm this by running 'echo "$PATH"'.
>
> I already know this.
>
>>> I didn't find documentaion about this though.
>>
>> See one of the following:
>> - 'man 1 dash', headings 'Double Quotes' and 'Parameter Expansion'.
>> - 'man 1 bash', headings 'QUOTING' and 'Parameter Expansion'.
>> - (info "(bash) Double Quotes")
>>   https://gnu.org/software/bash/manual/html_node/Double-Quotes.html
>
> I know this as well... but this is unrelated to the problem you have in
> emacs.

I never said it was related, but you used these shell examples to argue
that Emacs should expand shell variables present in environment variable
strings.

I was pointing out that your examples imply the opposite: that the shell
expands the variables long before they enter the environment (equivalent
to the use of substitute-in-file-name in the OP).

So Emacs is not necessarily behaving any differently to other programs
that query their environment, based on these examples.

>>> Anyway the problem is if one do this with XDG_DATA_HOME and trash files
>>> from different directories, a copy of his home directory will be done in
>>> each of those directories under literally "$HOME/user".
>>
>> But this only happens when you set XDG_DATA_HOME to a string that
>> includes shell variables, right?  If so...
>>
>>> If you consider this is fine and normal you can close this bug report.
>>
>> ...then I don't think that was ever implied as being supported, and I
>> don't see the need to support it, but that's just one impression.
>
> Fair enough, so you can close this.

Thanks, done.  We can always reopen it if new information comes to
light.

-- 
Basil




This bug report was last modified 4 years and 89 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.