1

I've been using MinGW compiled native windows 64-bit Emacs for a while, and I paired it with Cygwin to use especially Texlive, as well as other common linux and shell programs and commands.

I am considering switching to Windows Subsystem for Linux (WSL) as I am using Windows 10, and WSL allows me to install genuine linux distributions (esp. the case of WSL2).

I notice two important differences between Cygwin and WSL, which may make pairing up with them for my native windows Emacs different or potentially problematic:

  1. WSL uses linux native binary files for their executables. It can run downloaded linux binary executable files. I believe it is only their executables and they can edit and make changes to other files as usual.

  2. WSL sets the root directories and home directories in a hidden folder.

Does anyone have experience of making the switch to WSL and using Emacs with it?

1

I am (almost exclusively) using Emacs on WSL1.

  • I've got X11 support by VcXsrv. It is very stable.
  • You can mount Windows paths as drvfs. No problem there! My $HOME is my %USERPROFILE%. You can even mount windows network paths and usb drives.
  • File access is much faster under WSL1 and even once more faster under WSL2. It is even possible to use magit under WSL. (Under Cygwin magit is deadly slow for the projects I am working on.)
  • You can call windows apps directly from Linux.
  • You can convert paths from/to windows with /bin/wslpath. (That is almost like cygpath.exe.)
  • I am using the Powershell to copy paste images from Windows to Emacs and direct HTML contents from Emacs to Web-applications working in the Windows browser. Export of Orgmode stuff (regions, subtrees, files) without immediate HTML files directly over the Windows-Clipboard.

I do not know much about WSL2, but some yt-video, I don't remember right now, showed that starting windows applications from WSL2 works too.

Having said all the good stuff I have also to mention that I keep my Cygwin environment alive because one never knows when M$ decides to start with compatibility breaking changes or with discontinuing support for WSL.

8
  • Sounds great. Is your Emacs from the WSL (via apt-get install) or a Windows compiled Emacs? – menuhin Mar 18 '20 at 22:19
  • @menuhin It is the Ubuntu 18.04 version installed with aptitude install emacs26 (when I remember right). I think that is what counts as "from the WSL". – Tobias Mar 18 '20 at 22:25
  • Now I know what you and quite a few other guides are talking about - using Emacs from within WSL. I am not ready to take this big step, and thinking of using WSL as my Cygwin replacement and pair it with my 64-bit Windows compiled Emacs 26.2. I can see that everything will run smooth in your case as both the linux system and Emacs are from the same (WSL) environment. – menuhin Mar 18 '20 at 22:42
  • @menuhin In my experience Windows Emacs is not worth the trouble. Emacs often works with the file system and everything related to the file system is slow in Windows compared to Linux. WSL1 stuff is faster in this aspect than Windows native (in spite of the fact that WSL1 is heavily based on Windows) and you get a factor of 10 again with WSL2. That is really a killing argument if you are working with magit. Also the tool support is better under Linux. E.g., pdftools works out of the box. – Tobias Mar 18 '20 at 23:03
  • I should bite the bullet and give it a try then, given drvfs makes working on both filesystems not a problem. One last concern: when I call programs from within native Windows Emacs, e.g. a windows version of python or lisp, there won't be any problem. I will have to switch all these programs to linux (WSL) based then? – menuhin Mar 18 '20 at 23:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.