[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can we assume HOME is defined in the environment?
From: |
Jose E. Marchesi |
Subject: |
Re: Can we assume HOME is defined in the environment? |
Date: |
Mon, 22 Feb 2021 00:56:09 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>> In other words: can we safely assume HOME
>> is defined? I am thinking on mingw targets here..
>
> Good point. Indeed, while on Unix you can assume that HOME is set,
> except in services that get started during boot time, on Windows
> HOME is not set by default; instead you need to use the concatenation
> of ${HOMEDRIVE} and ${HOMEPATH}. It was like this in Windows 95, and
> is still like this in Windows 10.
Well, since XDG is probably useless in Windows systems (lucky Windows
users :P) I am going with this:
try map_load_path = getenv ("XDG_DATA_HOME") + map_load_path;
catch if E_inval {
try map_load_path = getenv ("HOME") + "/.local/share/poke:" + map_load_path;
catch if E_inval {}
}