reddit / emacs

spell checking with wucuo

junglee33 · 2022-02-09 09:05
hi all, i have started using [wucuo](https://github.com/redguardtoo/wucuo) for spell checking. my configuration is pretty straightforward (use-package wucuo :ensure t :config ;; ------------------------------------------------------------------------- ;; spell checking via `aspell' (setq ispell-program-name "aspell") (setq ispell-extra-args '("--sug-mode=ultra" "--lang=en_US" "--run-together" "--run-together-limit=16")) ;; ------------------------------------------------------------------------- ;; disable spell checking in some major-modes (setq wucuo-spell-check-buffer-predicate (lambda () (not (memq major-mode '(dired-mode log-edit-mode compilation-mode help-mode profiler-report-mode speedbar-mode gud-mode calc-mode Info-mode))))) :hook (prog-mode . wucuo-start) (text-mode . wucuo-start) ) this starts the spell checking as expected, and that works too. however, for source code buffers, i would like to run spell checker on comments only and not on the code itself. how do i do that ?
redguardtoo · 2022-02-09 22:16
Make sure `flyspell-mode` and `flyspell-prog-mode` are turned off. You don't need extra set up to spell check code. See `wucuo-font-faces-to-check`. But maybe your major mode use its own font face for name of functions&variable. You can just `(push my-font-face wucuo-font-faces-to-check)`.
junglee33 · 2022-02-10 07:32
thanks for the hint. i updated my config to this (use-package wucuo :ensure t :custom (wucuo-font-faces-to-check '(font-lock-doc-face font-lock-comment-face)) .... ) this seems to do the thing that i want. fwiw, i am mostly dealing with c/c++ code... -- best regards !