1

still have some problem to configure emacs:

I use orgmode to write principally in italian, but also in english. So i want to use flyspell to check either language. I google and i find this blog. After i launch brew install hunspell, downloaded the dictionary files and run hunspell -D, i modify my configuration.org file like this:

EDIT: i rewrite the code to include ispell-dictionary-alist

Enable spell-checking in Org-mode.

#+BEGIN_SRC emacs-lisp
   (add-hook 'org-mode-hook 'flyspell-mode)
#+END_SRC

setting flyspell in all my language by using hunspell

#+BEGIN_SRC emacs-lisp
 (require 'ispell)
 (setq-default ispell-program-name (executable-find "hunspell")
           ispell-dictionary "it_IT")
 (setq ispell-dictionary-alist
 (append '(("italian"
      "[AÀÁB-EÈÉF-IÌÍJ-OÒÓP-UÙÚV-Zaàáb-eèéf-iìíj-oòóp-uùúv-z]"
      "[^AÀÁB-EÈÉF-IÌÍJ-OÒÓP-UÙÚV-Zaàáb-eèéf-iìíj-oòóp-uùúv-z]"
      "[---']" t nil "~iso" iso-latin-1)
 ("english"
      "[A-Za-z]" "[^A-Za-z]" "[']" nil
      ("-d" "en_GB") nil utf-8))
 ispell-dictionary-alist))
 (setq ispell-menu-map nil)
 (load-library "ispell")
 (eval-after-load "ispell"
 (progn
 (setq ispell-dictionary "english"
      ispell-extra-args '("-a" "-i" "utf-8")
      ispell-silently-savep t)))

    (bind-key "C-c ì"
            (lambda ()
              (interactive)
              (ispell-change-dictionary "it_IT")
              (flyspell-buffer)))

  (bind-key "C-c è"
            (lambda ()
              (interactive)
              (ispell-change-dictionary "en_GB")
              (flyspell-buffer)))
#+END_SRC

But when i start emacs doesn't work flyspell, if i tipe C-c ì it say wrong type argument:stringp,nil and if i type C-c è it return Undefined dictionary: en_GB. Guesses?

EDIT: now the bind work, also code compile correctly, but when i change dictionary emacs say Undefine dictionary: yada_YADA with each of two dictionaries.

  • The code looks good so far. Maybe, you bind C-c i to some other command later on in your config file. Find the real binding with C-h k C-c i. Furthermore, it looks like you don't have en_GB in your ispell-dictionary-alist. – Tobias Jul 14 '18 at 11:34
  • To not interfire with other function i use accented letter (easi to entry in italian layout). Thankyou for the command C-h k it will be very usefull. The shorcut are very usefull. The binds return the function i define above. Did i need to include ispell-dictionary-alist even if i use hunspell? – acidwinzip 77 Jul 14 '18 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.