Closed Eason0210 closed 1 year ago
No idea, since I don't use Windows. It is weird that enchant-2
when invoked directly works, but not when used as library. Let me know if you figure something out. Windows is currently unsupported, also because of the module compilation.
Leaving this comment here so others can figure out how to get the compilation working on Windows.
I was able to get the compilation working as expected by installing both enchant and package config in mingw64(msys2). Ensure that you have the path set correctly so emacs can actually run package config while installing the package.
https://packages.msys2.org/package/mingw-w64-x86_64-pkg-config https://packages.msys2.org/package/mingw-w64-x86_64-enchant
I also had to standalone install the required dictionaries manually (aspell-en, hunspell-en etc).
Like @minad and @Eason0210 have pointed out, the enchant executable works standalone. It's the library that keeps crashing emacs for me.
I have a hunch that this may be related to https://github.com/AbiWord/enchant/issues/198.
My plan is to write a standalone c function to check if the library can be reliably accessed.
Posting here so people who have better experience with enchant can point out what is going wrong. I'll continue to debug and post updates here if any.
@swamijee Thanks for investigating. I am sure you can compile the module and libenchant in such a way that it can be loaded reliably. I suppose the enchant binary also loads the enchant.dll? For the record, on Linux I had zero crashes due to jinx-mod.so or libenchant.
@swamijee I was able to install and build jinx but it does not detect any dictionaries, did you manage to make it work?
For the record, I confirm jinx is launched by previously:
Now I must configure dictionaries, etc. but I received no error about dictionaries, it just detects every word as incorrect
Suposedly would be these dictionaries installed?
$ hunspell -D
SEARCH PATH:
.;C:/msys64/mingw64/bin/;Z:\USER\dict_data\Software\Hunspell\share\hunspell;C:/msys64/mingw64/share/
hunspell;C:/msys64/mingw64/share/myspell;C:/msys64/mingw64/share/myspell/dicts;C:/msys64;%USERPROFIL
E%/Application Data/OpenOffice.org 2/user/wordbook;C:/msys64/mingw64/share/dict/ooo;
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
Z:\USER\dict_data\Software\Hunspell\share\hunspell/en_GB
Z:\USER\dict_data\Software\Hunspell\share\hunspell/en_US
Z:\USER\dict_data\Software\Hunspell\share\hunspell/es
Z:\USER\dict_data\Software\Hunspell\share\hunspell/hyph_es
LOADED DICTIONARY:
Z:\USER\dict_data\Software\Hunspell\share\hunspell/es.aff
Z:\USER\dict_data\Software\Hunspell\share\hunspell/es.dic
Although this issue is closed, I didn't see any resolution on it. I installed jinx over the weekend and ran into this issue. I was however able to work around the issue. The following are the steps I took.
I installed the necessary packages in MSYS2 (enchant, Aspell English dictionary, etc.):
pacman -S mingw-w64-x86_64-pkg-config
pacman -S mingw-w64-x86_64-enchant
pacman -S mingw-w64-x86_64-aspell-en
pacman -S mingw-w64-x86_64-gcc
Added the binary directory to the path: C:/msys64/mingw64/bin
With all of this in place, I was able to successfully compile jinx-mod.c but had the same issue as those above where no dictionaries were detected. With some experimenting I was able to determine that the DLLs in the mingw64/bin directory were being located correctly, but it appeared those libraries couldn't find the other libraries and data they use in the "lib" directory (i.e., C:/msys64/mingw64/lib
). I'm not sure if it's a relocation issue or difference in paths between Windows and MSYS2, but it does work if you add the "lib" directories to your emacs installation (it will find the "lib" directory relative to your emacs executable's "bin" directory). I therefore symlinked the enchant and aspell (you may need to do this for other spell checkers if you use them) "lib" directories into my emacs installation and then it correctly found the dictionaries.
mklink /D C:\emacs\29.2\lib\aspell-0.60 C:\msys64\mingw64\lib\aspell-0.60
mklink /D C:\emacs\29.2\lib\enchant-2 C:\msys64\mingw64\lib\enchant-2
msys2/MINGW-packages#11443 seems to be describing this issue too along with confirming that it works relative to your executable location.
Hi @minad,
Jinx works well on macOS, but on Windows Emacs 30.0.50, I got this error:
My configuration
I tried to eval
(mapcar #'jinx--mod-dict (ensure-list "en_US"))
and gotnil
I install enchant with mingw64(msys2):
And get the results as below:
And I can confirm that my flyspell config works well with enchant
enchant configuration in
"C:\Users\<username>\AppData\Local\enchant\enchant.ordering"
is:Do you have any suggestions?