Replies: 2 comments
-
Mulla on tämmöistä .emacs'issa
(setq wcheck-language-data
'(("British English"
(program . "/usr/bin/ispell")
(args "-l" "-d" "british")
(action-program . "/usr/bin/ispell")
(action-args "-a" "-d" "british")
(action-parser . wcheck-parser-ispell-suggestions))
("Finnish"
(program . "/usr/bin/enchant")
(args "-l" "-d" "fi")
(syntax . my-finnish-syntax-table)
(action-program . "/usr/bin/enchant")
(action-args "-a" "-d" "fi")
(action-parser . wcheck-parser-ispell-suggestions))
("Voikko"
(program . "/usr/local/bin/voikkospell")
(args "ignore_dot=1")
(parser . wcheck-parser-voikkospell)
;; (regexp-discard . "\\`[.'-]+\\'")
;; LaTeX-komennot ja alkuperäinen regexp-discard.
(regexp-discard . "\\(\\\\[[:alpha:]]+\\)\\|\\(\\`[.'-]+\\'\\)")
(syntax . voikko-syntax-table)
(action-program . "/usr/local/bin/voikkospell")
(action-args "-s" "ignore_dot=1")
(action-parser . wcheck-parser-voikkospell-suggestions)
(suggestion-program . "/usr/local/bin/voikkospell")
(suggestion-args . ("-a" "-d" "fi"))
(suggestion-parser . wcheck-parse-suggestions-ispell)
)))
(defvar my-finnish-syntax-table
(copy-syntax-table text-mode-syntax-table))
(modify-syntax-entry ?- "w" my-finnish-syntax-table)
(autoload 'wcheck-mode "wcheck-mode"
"Toggle wcheck-mode." t)
(autoload 'wcheck-change-language "wcheck-mode"
"Switch wcheck-mode languages." t)
(autoload 'wcheck-actions "wcheck-mode"
"Open actions menu." t)
(autoload 'wcheck-jump-forward "wcheck-mode"
"Move point forward to next marked text area." t)
(autoload 'wcheck-jump-backward "wcheck-mode"
"Move point backward to previous marked text area." t)
;;; Wcheck-moden kieliasetukset
(defun wcheck-parser-voikkospell-engine (prefix)
(let (words)
(while (re-search-forward prefix nil t)
(push (buffer-substring-no-properties
(point) (line-end-position))
words))
words))
(defun wcheck-parser-voikkospell ()
(wcheck-parser-voikkospell-engine "^W: "))
(defun wcheck-parser-voikkospell-suggestions (&rest ignored)
(wcheck-parser-voikkospell-engine "^S: "))
(setq voikko-syntax-table (copy-syntax-table text-mode-syntax-table))
(dolist (i '((?- . "w") (?% . ".") (?$ . ".") (?. . "w")))
(modify-syntax-entry (car i) (cdr i) voikko-syntax-table))
(modify-syntax-entry ?\\ "w" voikko-syntax-table)
;;(setq wcheck-language "Finnish")
(setq wcheck-language "Voikko")
(global-set-key (kbd "C-c s") 'wcheck-mode)
(global-set-key (kbd "C-c l") 'wcheck-change-language)
(global-set-key (kbd "C-c c") 'wcheck-actions)
(global-set-key (kbd "C-c n") 'wcheck-jump-forward)
(global-set-key (kbd "C-c p") 'wcheck-jump-backward)
(custom-set-variables
'(ispell-local-dictionary-alist (quote
(("suomi"
"[%.0-9A-Za-z\247\300-\326\330-\366\370-\377-]"
"[^.%0-9A-Za-z\247\300-\326\330-\366\370-\377-]"
"[':]" nil nil nil utf-8)))))
(setq ispell-dictionary "suomi")
|
Beta Was this translation helpful? Give feedback.
0 replies
-
En osaa sanoa, mikä on paras tai suositeltavin tapa, mutta kaikki, mikä toimii, toimii. :-) Kiitokset huomioista. Muokkasin verkkosivun Emacs-kohtaa ja mainitsin Enchantin. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Voikon kotisivulla suositellaan tmispelliä Emacsin kanssa, mutta ilmeisesti tmispell en ole enää aktiivisessa kehityksessä. Vaikuttaisi siltä, että helpoin tapa käyttää voikkoa Emacsisa on Enchant ja sen voikko-liitännäinen (Debianissa libenchang-2-voikko). Asettamalla muuttujaan
ispell-program-name
arvoksi"/usr/bin/enchant-2"
jaispell-local-dictionary
arvoksi"fi"
vaikuttaisi homma toimivan heittämällä. Onko tämä suositeltavin tapa nykyään? Mikäli on, kannattaisi kotisivua ehkä päivittää.Beta Was this translation helpful? Give feedback.
All reactions