0

How can I selectively enable spell checking?

Previously I had the same issue as this question and disabled spell checking globally. But now I can't seem to enable it back on buffers that I need it, like org and latex.

I've tried adding (flyspell-mode-on) to the mode hooks, to no effect.

(add-hook 'org-mode-hook
            (lambda ()
              ;...
              (flyspell-mode-on)
              ;...
              ))

Calling it interactively on the buffer seems to work, though.

layer configuration:

(defun dotspacemacs/layers ()
  "Layer configuration:
This function should only modify configuration layer settings."
  (setq-default
   ;...

   ;; List of configuration layers to load.
   dotspacemacs-configuration-layers
   '(
     ;...
     (spell-checking :variables
                     spell-checking-enable-by-default nil
                     spell-checking-enable-auto-dictionary t)
))

I'm using spacemacs 0.999.0 (develop head) @ emacs 27.1

1

1 Answer 1

1

The doc string of flyspell-mode-on says it all:

Turn Flyspell mode on. Do not use this; use ‘flyspell-mode’ instead.

The canonical way for switching Flyspell on in Orgmode is:

(add-hook 'org-mode-hook #'flyspell-mode)

And if you want to use Flyspell with LaTeX you have to consider which exact mode you use. Do you use the built-in latex-mode or do you use the AucTeX version.

For AucTeX you have to set:

(add-hook 'LaTeX-mode-hook #'flyspell-mode)

for the internal latex-mode you have to set

(add-hook 'latex-mode-hook #'flyspell-mode)
1
  • @Luctins I think it is time to delete your last comment. Afterwards I will delete this one.
    – Tobias
    Jun 27, 2022 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.