tmalsburg / guess-language.el

Emacs minor mode that detects the language you're typing in. Automatically switches spell checker. Supports multiple languages per document.
119 stars 14 forks source link

problems with the set up, I need to restart flyspell mode for each paragraph!? #43

Closed ouboub closed 4 days ago

ouboub commented 1 month ago

Hi

I am long time user of ispell, flyspell (pluas own language dependend abbrev table) Usually I have 4 functions, for switching the ispell-dictionary for the for languages I use most (plus their corresponding abbrev tables) and bind this to 4 different keys. The ispell dictionaries I have are:

american.hash -> /var/lib/ispell/american.hash
british.hash -> /var/lib/ispell/british.hash
british-insane.hash -> /var/lib/ispell/british-insane.hash
castellano.hash -> espa~nol.hash
odeutsch.hash -> ogerman.hash
francais.hash -> french.hash

So I changed the setting of guess-language-langcodes according of what is to be used for ispell-change-dictionary which results in (just listing the differences)


(
 (de "deutsch8" "German" "🇩🇪" "German")
 (en "british" "English" "🇬🇧" "English")
 (es "castellano8" nil "🇪🇸" "Spanish")
 (fr "francais" "French" "🇫🇷" "French"))

Now I open a new file, start guess-language-mode (flyspell-mode is on) and type


Damit sind die Voraussetzungen des lokalen Existenzsatzes für
Anfangsdaten $U(T)$ gegeben und man erhält die Existenz einer Lösung
auf dem Intervall $[T,T+\epsilon]$. Aber warum ist das wahr?

Now let us look whether this true.  But then what to we see

Jetzt geht es zurück nach Deutsch. Aber es passiert nichts.

The first paragraph is correctly identified as German, but the second not. Only if I restart flyspell-mode, English is chosen. Is this the expected behaviour? Because if this is not done automatically then I can hit also 2 keys, one for changing the language manually, one for restarting flyspell-mode.

What do I miss? Regards Uwe Brauer

tmalsburg commented 1 week ago

The first paragraph is correctly identified as German, but the second not. Only if I restart flyspell-mode, English is chosen. Is this the expected behaviour?

No, this is not the expected behavior. Everything should be completely automatic. I've recently also experienced similar issues but haven't yet figured out what's wrong. Must be due to a change in Emacs because nothing has changed in guess-language in recent times.

tmalsburg commented 4 days ago

The issue is no longer present on my system after installing the latest development version of Emacs (31.0.50). I'm assuming that it happened due to a bug in Emacs and will close this issue. But feel free to reopen if you think something needs to be fixed in guess-language.