zrzz on Nostr: I've been thinking about how to best set the right dictionary for ispell/flyspell in ...
I've been thinking about how to best set the right dictionary for ispell/flyspell in #emacs. I know about [guess-language.el](
https://github.com/tmalsburg/guess-language.el ) but I want to keep it simple and predictable. So I am thinking that I could simply set it whenever the input method changes. This is what I've come up with so far, seems to work ok:<code>(add-hook 'input-method-activate-hook<br> (lambda ()<br> (cond ((string= current-input-method "german")<br> (ispell-change-dictionary "de")))))<br><br>(add-hook 'input-method-deactivate-hook<br> (lambda ()<br> (ispell-change-dictionary "en")))<br><br></code>
Published at
2024-09-02 21:06:09Event JSON
{
"id": "acd20fcadb5cb12763afe09279b1e963fd9a562859287a5937b2460c3c6a02cf",
"pubkey": "2383ca3693ec231ee8d4d3c064bca9625b7bfa0e8374c123cdb4c24e5631822a",
"created_at": 1725311169,
"kind": 1,
"tags": [
[
"proxy",
"https://emacs.ch/@zrzz/113069992776848686",
"web"
],
[
"t",
"emacs"
],
[
"proxy",
"https://emacs.ch/users/zrzz/statuses/113069992776848686",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://emacs.ch/users/zrzz/statuses/113069992776848686",
"pink.momostr"
],
[
"-"
]
],
"content": "I've been thinking about how to best set the right dictionary for ispell/flyspell in #emacs. I know about [guess-language.el](https://github.com/tmalsburg/guess-language.el ) but I want to keep it simple and predictable. So I am thinking that I could simply set it whenever the input method changes. This is what I've come up with so far, seems to work ok:\u003ccode\u003e(add-hook 'input-method-activate-hook\u003cbr\u003e (lambda ()\u003cbr\u003e (cond ((string= current-input-method \"german\")\u003cbr\u003e (ispell-change-dictionary \"de\")))))\u003cbr\u003e\u003cbr\u003e(add-hook 'input-method-deactivate-hook\u003cbr\u003e (lambda ()\u003cbr\u003e (ispell-change-dictionary \"en\")))\u003cbr\u003e\u003cbr\u003e\u003c/code\u003e",
"sig": "7f86a97c2575b0a7c6f464682bddfd94baf61dc71aa9e9232ce3f666dc27eaa4aa611a5a414619a3ce680bb1db77c5921bb5c8ba75c5e75254bb73be38877fc0"
}