Some users complained about slowness when opening files due to
spell-checking being activated. This commit revert to old behaviour
checking only the words under the cursor and not the whole buffer.
When `auto-dictionary-mode` is activated, it tries to guess the
dictionary no matter if a dictionary was manually selected before, what
is annoying when toggling spell-checking off/on. To avoid this, a piece
of code was added to the spell-checking toggle to select the
buffer-local dictionary if it was set.
As mentioned by lunaryorn, this part of code should also be called when
flyspell is enabled/disabled by an other mean than the spacemacs toggle.
This commit move the code to the `auto-dictionary-mode-hook` for this
purpose.
- Disable `auto-dictionary-mode` by default. Add a layer's variable to
enable it. Its behaviour has some impact on user-defined dictionary
preferences, it has some bugs in daemon mode, and not all languages
are supported. It's why it better to have it disabled by default.
- Toggle off `auto-dictionary-mode` when spell-checking is toggled off.
- Call `flyspell-buffer` when toggling **on** spell-checking to reveal
mistakes (probably the wanted behaviour when activating
spell-checking)
- When `auto-dictionary-mode` is enabled, if a buffer's dictionary is
manually changed with `SPC S d`, it is restored after toggling
spell-checking on/off, otherwise `auto-dictionary` will thy to guess
it again.
This commit moves the – previously disabled – `auto-dictionary` code to
the `spell-checking` layer and activate it. It is now enabled by
default, but can be disabled by setting `spell-checking-auto-dictionary`
to `nil`.
`auto-dictionary` comes with some interesting improvements:
- Tries to automatically detect what is the language of the buffer and
activate the corresponding dictionary.
- When a buffer is opened, all spelling mistakes are shown without
needing first to be under the cursor.
- When the dictionary is changed, the whole buffer is reanalyzed for
spelling mistakes (close#2088).
- Rename contrib directory to layers
- Add new variable dotspacemacs-distribution
- Move spacemacs layer to layers/!distribution
- New layer spacemacs-core in layers/!distribution
- User can now set dotspacemacs-distribution to spacemacs or
spacemacs-core (default spacemacs)
spacemacs-core is very lightweight layer sufficient to build upon
spacemacs.