tmalsburg / guess-language.el

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

validate-setq on guess-language-langcodes #7

Closed manuel-uberti closed 7 years ago

manuel-uberti commented 7 years ago

Hi,

just upgraded guess-language from MELPA. I have this snippet in my init file:

(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-langcodes '((en . ("en_GB" "English"))
                                            (it . ("it_IT" "Italian")))
                 guess-language-languages '(en it)
                 guess-language-min-paragraph-length 45)
  :diminish guess-language-mode)

I get this warning upon restarting Emacs:

Error (use-package): guess-language :config: Looking for `(alist :key-type symbol :value-type ...)' in `((en "en_GB" "English") (it "it_IT" "Italian"))' failed because:
Looking for `(repeat (cons symbol list))' in `((en "en_GB" "English") (it "it_IT" "Italian"))' failed because:
Looking for `(cons symbol list)' in `(en "en_GB" "English")' failed because:
Looking for `list' in `("en_GB" "English")' failed because:
  wrong number of elements

I am using validate-setq from @Malabarba's validate to be sure I am setting the right values everywhere in my init file.

Everything's working fine with regular setq, so this is might not be related to your package.

tmalsburg commented 7 years ago

I'm not familiar with validate but as far as I can see it complains that ("en_GB" "English") is not a list which is incorrect. Is it possible that validate is confused?

manuel-uberti commented 7 years ago

Could be, but we need @Malabarba to help us here.

Malabarba commented 7 years ago

Yes, looks like a bug in validate.el. I'll have to check it out.

manuel-uberti commented 7 years ago

Thank you! I'll close this issue, then, since it is not related to guess-language.

manuel-uberti commented 7 years ago

@Malabarba did you have a chance to have a look at this?

Malabarba commented 7 years ago

No, but I'll try to over the weekend. Feel free to ping me if I forget. :-)

manuel-uberti commented 7 years ago

Ok, latest commit by @Malabarba on validate.el fixed this. Thanks!

tmalsburg commented 7 years ago

Great and thanks for your effort @Malabarba and @manuel-uberti.