2

How can I enable greek language spellchecking in Emacs to be the default spellchecking language, and how can change spellchecking between greek and english language? (My system is Ubuntu 14.04 64bit).

  • I believe that would depend on which spellchecking program you are using (aspell or hunspell?). – wvxvw Mar 1 '16 at 20:48
  • i think aspell. How can I find out? – Yorgos Mar 1 '16 at 21:28
  • See the value of ispell-program-name (you might need to (require 'ispell), this variable isn't autoloaded). Also see this question, even though it deals with hunspell, the procedure should be somewhat similar: unix.stackexchange.com/questions/86554/… – wvxvw Mar 1 '16 at 23:08
  • How do I change ispell private dictionary: stackoverflow.com/a/27551890/2112489 – lawlist Mar 1 '16 at 23:19
1

Using Hunspell spellchecking program

First of all, you should install hunspell and after that add Greek Dictionary

sudo apt install hunspell

Download and Add greek dictionary to Hunspell dictionaries' path

cp el_GR.dic el_GR.aff /usr/share/hunspell

Let's test Hunspell at terminal: hunspell -d el_GR and then mistype a greek word.

Secondly, it be required ispell and flycheck emacs' packages as also a bit configuration in init.el

Add greek and english dic to ispell local dictionary

(require 'ispell)
(add-to-list 'ispell-local-dictionary-alist '("greek-hunspell"
                                          "[[:alpha:]]"
                                          "[^[:alpha:]]"
                                          "[']"
                                          t
                                          ("-d" "el_GR"); Dictionary file name
                                          nil
                                          iso-8859-1))

(add-to-list 'ispell-local-dictionary-alist '("english-hunspell"
                                          "[[:alpha:]]"
                                          "[^[:alpha:]]"
                                          "[']"
                                          t
                                          ("-d" "en_US")
                                          nil
                                          iso-8859-1))

(setq ispell-program-name "hunspell"          ; Use hunspell to correct mistakes
  ispell-dictionary   "english-hunspell") ; Default dictionary to use

Define a function for switching dictionaries

(defun  fd-switch-dictionary()
"Switch greek and english dictionaries."
(interactive)
(let* ((dict ispell-current-dictionary)
     (new (if (string= dict "greek-hunspell") "english-hunspell"
               "greek-hunspell")))
(ispell-change-dictionary new)
(message "Switched dictionary from %s to %s" dict new)))

(global-set-key (kbd "<f8>") 'fd-switch-dictionary)

Open a text file in emacs use F8 to switch dictionary and then enable flyspell minor mode

M-x flyspell-mode

I hope it helps.

|improve this answer|||||

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.