Closed joostkremers closed 7 years ago
Did you install from MELPA? MELPA changes the directory structure. I pushed a fix in da675df406c2b971b2ad4c8d56ef15ee9920faf1. Let me know whether this fixes it.
Just installed from MELPA, the issue is still here.
If it can help debug the issue, it doesn't work when cloning the repo directly either:
Error in post-command-hook (flyspell-post-command-hook): (file-missing "Opening input file" "No such file or directory" "/home/manuel/githubs/guess-language.el/en")
I know it's not working when you just clone the repository but it should work through MELPA and it does on my machine. @manuel-uberti what error message do you get when you install through MELPA? To make sure you're actually using the MELPA version, please restart Emacs after installing.
Reinstalled through MELPA, restarted Emacs, I get:
Error in post-command-hook (flyspell-post-command-hook): (error "Undefined dictionary: en")
My setup:
(use-package guess-language ; Automatically detect language for Flyspell
:ensure t
:defer t
:init (add-hook 'text-mode-hook #'guess-language-mode)
:config
(validate-setq guess-language-languages '(en it)
guess-language-min-paragraph-length 30)
:diminish guess-language-mode)
@manuel-uberti that's not a problem with my package but with your ispell install. Apparently you don't have the English dictionary. That's at least what the error message is suggesting. You can test by M-x ispell-change-dictionary
and then selecting en
. Alternatively, you have an English dictionary but it's perhaps named differently, english
instead of en
.
Weird, I got this setup for ispell and spell-checking is working just fine:
(validate-setq ispell-program-name (executable-find "hunspell")
ispell-dictionary "en_GB"
ispell-choices-win-default-height 5)
See? The dictionary is called en_GB
on your system not en
. Thing is that guess-language cannot know what dictionary you are using, so you have to configure it. Have a look at the variable guess-language-langcodes
. There you can change en
to en_GB
and then it should work. This needs to be explained in the documentation and guess-language-langcodes
needs to be a defcustom
.
Fantastic, thanks, I didn't know about that variable. It works now. Mind if I blog about your package?
Not at all, go ahead. Where is your blog? And let me know if you have other feedback regarding the package.
https://manuel-uberti.github.io
I already started writing about your package, so I'll update it soon.
@manuel-uberti I added information on changing the default dictionary here: https://github.com/tmalsburg/guess-language.el#configuration
Guess-language-mode should now find the data files irrespectively of whether it was installed through MELPA or not. Fingers crossed. @joostkremers I assume that this is fixed now and will close this issue. Feel free to reopen if necessary.
Yes, the issue is solved for me as well now.
Hi, this looks like it's exactly the thing I've been looking for, but I'm having trouble setting it up. I installed the package and added the following to my init file:
But when I open a text file,
flyspell
doesn't work (even though I get a message about it starting up). The*Messages*
buffer contains a message such as the following:The directory in the error message is the one containing the file I just opened.
Am I doing something wrong or is this a bug somewhere?