Hi all,
I’ve just got Emacs 28.1 running on WSL2. I’ve been using Emacs on Windows for many years and I now want to switch to WSL for the speed benefit. However, I’d like to keep the ability to run my Windows installation of Emacs, using the same packages and configuration files as my WSL version.
The Home directory for my Windows Emacs installation is C:\Dropbox\Home, therefore I added the following lines to the init.el file loaded by the WSL Emacs installation:
(setq user-init-file "/mnt/c/Dropbox/Home/.emacs")
(setq user-emacs-directory "/mnt/c/Dropbox/Home")
(add-to-list 'load-path "/mnt/c/Dropbox/Home/.emacs.d")
(add-to-list 'load-path "/mnt/c/Dropbox/Home/.emacs.d/elpa")
The first line works, in that it does read the specified .emacs file. However, when it attempts to load some of the packages (specifically those found in C:\Dropbox\Home\.emacs.d\elpa) it fails, saying it cannot find the file or folder specified.
I can’t figure out where it’s looking for those packages and why it cannot find them despite me adding the package folders to the load-path var. Any help much appreciated.
Try setting
package-user-dir
to the elpa directory.Thanks for the suggestion, but it didn’t work. I updated my post with the solution that worked for me, maybe it will help others in the future.