Emacs:Spelling

From AliceWiki
Jump to: navigation, search

Emacs defaultne pracuje s Aspell-om, resp. "Ispell compatibility script for Aspell" ale aj s Ispell-om a Hunspell-om.

Pouzivanie roznych spell checker-ov v emacs-e
Spell checker customizations in the .emacs file [1]
M-x ispell-check-version [2]
Ispell
(setq ispell-program-name "ispell")
(setq flyspell-default-dictionary "russian")
@(#) International Ispell Version 3.3.02 12 Jun 2005, ispell.el 3.6 - 7-Jan-2003
Aspell
(setq ispell-program-name "aspell")                  ;; default
(setq flyspell-default-dictionary "ru-lebedev-io")
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.5), ispell.el 3.6 - 7-Jan-2003
Hunspell [3]
(setq ispell-program-name "hunspell"
      ispell-local-dictionary "ru_RU"
      ispell-local-dictionary-alist '(("ru_RU"
                                       "[АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя]"
                                       "[^АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя]"
                                       "" nil nil nil utf-8)))
@(#) International Ispell Version 3.2.06 (but really Hunspell 1.2.1), ispell.el 3.6 - 7-Jan-2003
  1. GNU Emacs 23.0.60.2 (i686-pc-linux-gnu, GTK+ Version 2.12.11)
  2. Fedora 9, september 2008
  3. Spell checker funguje spravne, problem vsak nastava v flyspell-mode. Pri stlaceni mouse-2 sa okrem samotnej opravy slova niekedy tento prikaz interpretuje aj ako klasicka funkcia paste (mouse-2 funguje prave ako paste)

Praca so slovnikmi

(setq ispell-program-name "/path/to/checker/xxxspell")           ;; pouzivanie konkretneho spell checker-a
(setq ispell-dictionary "nazov_slovnika")                        ;; nastavenie default dictionary
-*- ispell-dictionary: "nazov_slovnika" -*-                      ;; nastavenie dictionary pre konkretny subor (umiestnit na zaciatok suboru)
(setq flyspell-default-dictionary "nazov_slovnika")              ;; default dictionary v flyspell-mode
M-x ispell-check-version informacia o spell checker-y, ktory momentalne pouziva emacs
M-x ispell-change-dictionary RET SPC prepinanie medzi dictionaries
M-x flyspell-mode zapnutie/vypnutie flyspell-mode
;; slovak
(setq ispell-program-name "hunspell"
      ;;      ispell-extra-args '("-a" "-i" "utf-8")
      ispell-local-dictionary "sk_SK"
      ispell-local-dictionary-alist '(("sk_SK"
     				       "[A-Za-z]"                  ;; ?! treba dodat vsetky nase znaky !?
       				       "[^A-Za-z]"
				       "[']" nil nil nil utf-8)))
;; (global-unset-key [mouse-2])