* PATH, exxec-path and early-init file [Windows]
@ 2020-08-11 23:05 Angelo Graziosi
2020-08-12 12:45 ` Richard Copley
0 siblings, 1 reply; 4+ messages in thread
From: Angelo Graziosi @ 2020-08-11 23:05 UTC (permalink / raw)
To: emacs-devel@gnu.org
The following regards the build of EMACS MASTER on Windows with MSYS2/MINGW64, whose tree is installed in C:\Emacs.
Trying to not add "C:/msys64/mingw64/bin" at level of Windows PATH, I added this to the init.el file (from https://emacs.stackexchange.com/questions/27326/gui-emacs-sets-the-exec-path-only-from-windows-environment-variable-but-not-from):
(add-to-list 'exec-path "C:/msys64/mingw64/bin")
(setenv "PATH" (mapconcat #'identity exec-path path-separator))
This almost works in the sense that I lose a few graphics elements (the tool bar icons are grayed, those of speed bar are completely lost etc.). So I moved those line to an early-init.el file. Indeed the Emacs manual says:
"...early-init.el. This file is loaded before the package system and GUI is initialized..."
"We do not recommend that you move into early-init.el customizations that can be left in the normal init files. That is because the early init file is read before the GUI is initialized..."
But the result is the same.
In short without a correct Windows PATH it does not find all the libraries it needs.
It seems that what stated by the manual is a bit confusing: if early-init.el is loaded before GUI initialization, why shouldn't it work?
In any case is there a way to avoid to modify Windows PATH?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PATH, exxec-path and early-init file [Windows]
2020-08-11 23:05 PATH, exxec-path and early-init file [Windows] Angelo Graziosi
@ 2020-08-12 12:45 ` Richard Copley
2020-08-12 12:54 ` Angelo Graziosi
0 siblings, 1 reply; 4+ messages in thread
From: Richard Copley @ 2020-08-12 12:45 UTC (permalink / raw)
To: Angelo Graziosi; +Cc: emacs-devel@gnu.org
On Wed, 12 Aug 2020 at 00:06, Angelo Graziosi <angelo.g0@libero.it> wrote:
> [...]
> In any case is there a way to avoid to modify Windows PATH?
One way is to install Emacs to c:\msys64\mingw64\bin, by running 'make
install'. The default library search path includes the invocation
directory. Installing comes with its own disadvantages.
Another is to call SetDllDirectory (and optionally
SetDefaultDllDirectories) from "main". I don't know how well that
works out.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PATH, exxec-path and early-init file [Windows]
2020-08-12 12:45 ` Richard Copley
@ 2020-08-12 12:54 ` Angelo Graziosi
2020-08-12 13:58 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Angelo Graziosi @ 2020-08-12 12:54 UTC (permalink / raw)
To: Richard Copley; +Cc: emacs-devel@gnu.org
> Il 12/08/2020 14:45 Richard Copley ha scritto:
>
>
> On Wed, 12 Aug 2020 at 00:06, Angelo Graziosi wrote:
> > [...]
> > In any case is there a way to avoid to modify Windows PATH?
>
> One way is to install Emacs to c:\msys64\mingw64\bin, by running 'make
> install'. The default library search path includes the invocation
> directory. Installing comes with its own disadvantages.
>
> Another is to call SetDllDirectory (and optionally
> SetDefaultDllDirectories) from "main". I don't know how well that
> works out.
..but why early-init.el does not work as one expect?
Anyway, it seem that this solves my problem: I create a Windows link (.lnk) whose target is
C:\msys64\usr\bin\env.exe PATH="/mingw64/bin:$PATH" HOME=/c/Users/utente/AppData/Roaming /c/Emacs/bin/runemacs.exe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PATH, exxec-path and early-init file [Windows]
2020-08-12 12:54 ` Angelo Graziosi
@ 2020-08-12 13:58 ` Eli Zaretskii
0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2020-08-12 13:58 UTC (permalink / raw)
To: Angelo Graziosi; +Cc: rcopley, emacs-devel
> Date: Wed, 12 Aug 2020 14:54:21 +0200 (CEST)
> From: Angelo Graziosi <angelo.g0@libero.it>
> Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
>
> ..but why early-init.el does not work as one expect?
Why do you think it doesn't? I've read your original description, and
didn't understand why you thought moving it from the "normal" init
file to early-init would solve the problem. Perhaps because I don't
understand why you modify PATH from within Emacs, and what does that
have to do with your image DLLs.
> Anyway, it seem that this solves my problem: I create a Windows link (.lnk) whose target is
>
> C:\msys64\usr\bin\env.exe PATH="/mingw64/bin:$PATH" HOME=/c/Users/utente/AppData/Roaming /c/Emacs/bin/runemacs.exe
The recommended way of doing stuff like that is to change the
system-wide environment, i.e. add the above to your environment
variables, so that you don't need to set this up anew each Emacs
invocation.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-08-12 13:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-11 23:05 PATH, exxec-path and early-init file [Windows] Angelo Graziosi
2020-08-12 12:45 ` Richard Copley
2020-08-12 12:54 ` Angelo Graziosi
2020-08-12 13:58 ` Eli Zaretskii
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).