auto-dictionary-mode icon indicating copy to clipboard operation
auto-dictionary-mode copied to clipboard

Easier language customization

Open To1ne opened this issue 9 years ago • 3 comments

It would be nice if it was possible to easily add languages without the need to change the sources. Maybe with a defcustom...

To1ne avatar Sep 07 '16 07:09 To1ne

It also would be nice if it would be possible to set a list of used languages (e.g. I only type Dutch and English) so guessing can be faster and more accurate.

To1ne avatar Sep 07 '16 07:09 To1ne

If I'm reading the following correctly, this can already be done: https://github.com/nschum/auto-dictionary-mode/blob/b364e08009fe0062cf0927d8a0582fad5a12b8e7/auto-dictionary.el#L158

I'll test it shortly. I haven't analysed the whole file yet, but I would imagine that this table is filtered using the defconst adict-language-list as keys, and if a key isn't found in adict-language-list then the negatively matched adict-dictionary-list element is dropped or deactivated.

'hopefully this issue can be solved with a documentation update.

sten0 avatar Nov 23 '19 00:11 sten0

Confirmed fix: The following does the trick for me (I was getting occasional false positives for Slovenian when there weren't enough matches for the heuristic to pick the correct language)

(eval-after-load "auto-dictionary"
  '(setq adict-dictionary-list
        (mapcar 'adict--guess-dictionary-cons
                '(("en" . "en")
                  ("fr" . "fr")))))

sten0 avatar Nov 23 '19 00:11 sten0