hkjels · 2022-10-05 07:18
It's been about 20 years since I used Windows, but I just started in a new position where I need to get up and running with it. I've got a lot of my config working already, but I don't get how to do external package-management at all. My config is littered with `:ensure-system-package` statements that all fail. I've installed Debian subsystem and also mingw, but I don't get how I can tie either of them in. I have found a few blog-posts about Emacs on Windows, but those were more about trivial things that I were able to figure out on my own.
So.
1) Does the concept of `PATH` exist on Windows? \
1.1) Can the `PATH` be changed to include something either from mingw or Debian subsystem?
Looks like starting up the subsystem takes some time, so I'm also worried about performance. \
2) Should I be going about this in another way entirely?
FrozenOnPluto · 2022-10-05 12:25
Yes there is a path, both global and user. Check google for your version of Windows .. used to be a right click on Computer or whatever and dig down through tabs, but on Win10 or 11 I wouldnt know..
Mingw probably depends which shared libs are pulled in; theres so many alternate unix like environments for Windows hard to remember .. cygwin, mingw, msys etc. just fire up the regular shell and try running the command in question to see if it has linker errors or goes to weird paths etc
For wsl it depends which kind of install perhaps. Wsl1 was basically a vm with portmapping if I recall, so not much integration between the wsl and windows host? Not sure about newer wsl2 etc.
Tru some googling :)
redguardtoo · 2022-10-05 12:35
Yes, environment variable PATH and HOME exists on Windows.
Windows native Emacs' performance is better than WSL and MSYS2. On my 10 year old computer, its starts up in 2 seconds.
See [https://github.com/redguardtoo/emacs.d#windows](https://github.com/redguardtoo/emacs.d#windows)
BillDStrong · 2022-10-05 14:39
Now, I am assuming you are on Windows 11 and WSL2, which is that Debian subsystem. If you are on 10 then most of this advice is still true, I will point out where it differs. MingW is a different thing again. You really don't want to try and tie WSL2 and mingw together. WSL2 is Linux, mingw is targeting windows environment. If you are using emacs in WSL2, you want to keep your applications emacs uses in WSL2, and use emacs to edit files in both systems.
It sounds as if you are a little confused about the integration of Windows and the WSL. So picture WSL as a seperate machine that has a preset up network mountto all your Windows drives under /mnt/\[leter\].
Now, technically, WSL does allow you to execute Windows programs, so you can do say:
`notepad.exe some.txt`
and it will open up a windows program from a Linux command line. So if you need to call to say Visual C++ compiler from WSL, you can.
It sounds as if you are a little confused about the integration of Windows and the WSL. So picture WSL as a seperate machine that has a preset up network mountto all your Windows drives under /mnt/\[leter\].
It is really a VM, so it has a PATH and HOME and works just like Debian for you mostly. You can install and run your current Emacs config in that, with no changes. WSL2 on Windows 11 allows you to use GUI apps, so you can just use emacs like normal. WSL 2
Emacs on Windows is a different beast, mainly because a lot of the power of emacs comes from its use of external utilities that are a little more work on Windows.
You have to download them, find replacements for ones that don't work, and then make sure emacs can see them.
You make sure emacs can see them by either placing the files in the emacs bin directory, which emacs searches, or by creating a directory and placing that in Windows PATH.
Windows PATH is not put in by a command, it is located in the Environment Variables button in the System Properties app. Under Windows 11, you right click the start button, and in the menu that pops up, click system. In the app that pops up, In a row called Related Links, is an option called Advanced system settings. This gets you to the System Properties app, open to the correct tab. At the bottom of this app, right above the OK|Cancel|Apply, is Environment Variables.
Windows 10 has this System Properties app, but they moved around how to get to it, so click on the start button and start typing control panel, and click that option. You can find System in there and that should take you to the same place.
Here you will find the HOME variable, which emacs uses to find its config files, and the Path settings.
There are two sets of settings on this page, the top is for your current user account, the bottom is for the whole computer. Be careful with the bottom one if anyone else uses your computer.
Now, you don't have to use the Windows version of emacs, you can just use the normal emacs you use in your current linux. Just do what you normally do in WSL.