Closed sbwcwso closed 1 year ago
I use
wucuo
which bases onflyspell
, so you need set upflyspell
.See http://blog.binchen.org/posts/what-s-the-best-spell-check-set-up-in-emacs/
The cli program could be
aspell
orhunspell
.
Thank you, I found the follow function from EmacsWiki: Fly Spell which works well.
;;; --------------------------------------------------- adding words to flyspell
(eval-when-compile (require 'cl))
(defun append-aspell-word (new-word)
(let ((header "personal_ws-1.1")
(file-name (substitute-in-file-name "$HOME/.aspell.en.pws"))
(read-words (lambda (file-name)
(let ((all-lines (with-temp-buffer
(insert-file-contents file-name)
(split-string (buffer-string) "\n" t))))
(if (null all-lines)
""
(split-string (mapconcat 'identity (cdr all-lines) "\n")
nil
t))))))
(when (file-readable-p file-name)
(let* ((cur-words (eval (list read-words file-name)))
(all-words (delq header (cons new-word cur-words)))
(words (delq nil (remove-duplicates all-words :test 'string=))))
(with-temp-file file-name
(insert (concat header
" en "
(number-to-string (length words))
"\n"
(mapconcat 'identity (sort words #'string<) "\n"))))))
(unless (file-readable-p file-name)
(with-temp-file file-name
(insert (concat header " en 1\n" new-word "\n")))))
(ispell-kill-ispell t) ; restart ispell
(flyspell-mode)
(flyspell-mode))
(defun append-aspell-current ()
"Add current word to aspell dictionary"
(interactive)
(append-aspell-word (thing-at-point 'word)))
See https://github.com/redguardtoo/wucuo#solution-2-create-a-personal-dictionary I usually manually edit my personal dictionary directly.
I use
wucuo
which bases onflyspell
, so you need set upflyspell
.See http://blog.binchen.org/posts/what-s-the-best-spell-check-set-up-in-emacs/
The cli program could be
aspell
orhunspell
.