Wucuo, a Emacs spell checker that works with camel case code

  |   Source

Now it's possible to spell check camel case code in Emacs using wucuo.

Setup is easy. Add (wucuo-start) into ~/.emacs, then use flyspell as usual.

Flyspell could use either aspell or hunspell. No extra setup for aspell or hunspell is required.

Wucuo starts an independent process to check camel case words. So your original flyspell setup is still valid.

For example, you could still use Spanish and English dictionaries in your existing flyspell setup.

Two flag wucuo-aspell-language-to-use and wucuo-hunspell-dictionary-base-name are used and only used to check camel case word through independent process.

Wucuo is generic enough to handle any programming language if its major mode inherits from prog-mode.

Even if the major mode does not inherit from prog-mode, it's still simple to use wucuo.

You only need find font face the camel case word is used by running M-x wucuo-current-font-face. Say the font face is js2-function-call.

Then we need setup wucuo-personal-font-faces-to-check,

(setq wucuo-personal-font-faces-to-check '(js2-function-call))

That's all.

Some optional tools to help you manage personal dictionaries:

  • M-x wucuo-create-aspell-personal-dictionary creates plain word dictionary ~/.aspell.en.pws for aspell
  • M-x wucuo-create-hunspell-personal-dictionary creates plain word dictionary ~/.hunspell_en_US for hunspell

BTW, please don't start flyspell-prog-mode when using wucuo.

Any suggestion is welcomed. For example, currently wucuo only check English camel case word. Ping me if you want to use other languages.

Comments powered by Disqus