Run aspell from Windows Emacs using WSL

If you have the Windows Subsystem for Linux, you can use its spell checker from Emacs. I have had to resort to this because hunspell.exe does no longer find my dictionaries and Emacs' code for hunspell is broken on Windows.

Step 1: Create a script called aspell.cmd with this content

@echo off
wsl aspell %1 %2 %3 %4 %5 %6 %7

Step 2: In your .emacs file, tell it to use this script for spell checking. Simply enter

(setq ispell-program-name "your/path/to/aspell.cmd")

If you now type M-$ (Escape key followed by $ sign) you will enter the ispell mode. However, use of flyspell is more recommended.