Commit Graph

48 Commits

Author SHA1 Message Date
930524f3ac Apply spell-fu blacklist to derived modes 2020-12-12 23:23:13 -05:00
d149c59d2e Add emacs mode checks to insert mode checks
This is to accommodate users who default to emacs mode, rather than
insert mode. The two are also very alike, so many of these checks should
apply to both (almost) equally.
2020-12-11 17:38:09 -05:00
448bff2fd8 Implement cleaner version 2020-12-06 23:57:40 +01:00
a51be66d30 Add word existence checking for +spell/correct
`(bounds-of-thing-at-point 'word)` can return `nil`. This checks that it
does not, giving an `user-error` if no word is found.
2020-12-06 19:18:36 +01:00
719147cf8d fix nix aspell installation instructions
The original instruction made nix install the language packages in different directories than the `aspell` package.

Use solution provided here https://github.com/hlissner/doom-emacs/issues/4138#issuecomment-717266771


closes https://github.com/hlissner/doom-emacs/issues/4138
2020-12-02 15:39:57 -08:00
a31dced7bc Requested changes -- move defvar to preface
We can now remove the redundant hack.
2020-11-13 20:51:54 +01:00
ea16bb66c3 Fix behaviour without aspell
If aspell (or a spell-fu acceptable equivalent) warn the user. If it
failed to bind +spell-correct-interface, and bind that.

Remove previous hack. It prevents use of +spell/correct if spell-fu does
not try to highlight a word. This is extreamly common is docstrings, for
example. I think having +spell/correct should check any word it is
called upon, even without general text highlighting.
2020-11-13 15:37:20 +01:00
c4e259162b Bump :checkers
d12frosted/flyspell-correct@dea1290 -> d12frosted/flyspell-correct@6d603a1
flycheck/flycheck@c02cd77 -> flycheck/flycheck@cd8e0a2
ideasman42/emacs-spell-fu@e94d01c -> ideasman42/emacs-spell-fu@a7db587
2020-10-11 23:32:51 -04:00
77646c5f42 Merge pull request #3994 from akirabaruah/fix-ispell-default-dict
checkers/spell: fix default ispell dict
2020-10-08 14:01:04 -04:00
426e3c6aa6 Merge pull request #3920 from asymmetric/aspell-tex-config
modules/checkers/spell: remove tex option
2020-10-05 21:04:12 -04:00
4d42347032 Merge pull request #3841 from Ban3/enchant-spell
checkers/spell: add support for using enchant
2020-10-04 20:24:57 -04:00
38a5965704 Merge pull request #3938 from karvus/fix-spell-add-word-for-flyspell
Fix `+spell/add-word` when using flyspell
2020-10-04 17:05:29 -04:00
385e3c20da Move +spell/add-word from zq -> zg
I misread the key that this functionality is on in vim.
2020-10-04 16:15:26 -04:00
289369f191 checkers/spell: fix default ispell dict
Changes the default ispell dictionary from "en" to "english" since the
former isn't actually a default dictionary name listed in ispell. See
9f30a6b1a4/lisp/textmodes/ispell.el (L471)

Otherwise, enabling checkers/spell doesn't do anything even if aspell and the
aspell-en dictionary are installed according to the module README file.
2020-09-29 01:19:31 -07:00
90b330bbc5 Fix +spell/add-word when using flyspell
``+spell/add-word`` expects `flyspell-get-word` to return as a string
the current word. Instead, it returns a list of the form
`(<word> <start-pos> <end-pos>)`.
2020-09-14 13:02:35 +02:00
021a2d3c64 modules/checkers/spell: remove tex option
It causes aspell 0.60.8 to fail with message `the key "check-tex-comments" is unknown`.
2020-09-09 23:04:38 +02:00
b0cd0e5efe Change scope of +spell/add-word with universal arg
C-u +spell/add-word -> add word for current buffer
C-u C-u +spell/add-word -> add word for session buffer
2020-09-02 14:07:22 -04:00
3963b83e2a checkers/spell: update readme 2020-09-02 14:07:10 -04:00
91c1e705e6 checkers/spell: add add/remove word & next/prev error commands
So both spell-fu and flyspell users have a more consistent interface.
2020-09-02 13:58:27 -04:00
79c1fcefcf Fix #3863: "load" ispell after flyspell
Emacs loads both ispell and flyspell at startup, so to lazy load user
configuration to either package, we fool Emacs into thinking neither is
loaded yet.

However, this means we need a trigger to eventually "load" ispell, which
we didn't have until now, causing #3863.
2020-08-31 23:19:31 -04:00
518c97a2ac Rename {if,when}! -> eval-{if,when}!
To better represent its purpose, as extensions to Emacs' eval-when*
API (for control flow at compile time).
2020-08-27 01:10:08 -04:00
bfd71a8bb9 Fix #3827: void-variable flyspell-delayed-commands
This occurs in org-compat.el:

  (eval-after-load "flyspell"
    '(add-to-list 'flyspell-delayed-commands 'org-self-insert-command))

By not using a package symbol, this code runs whenever any file named
flyspell.el is loaded. Guess what one of the :checkers spell module's
autoloads files is named? flyspell.el
2020-08-26 19:33:24 -04:00
1a3326be53 checkers/spell: add support for using enchant 2020-08-26 13:57:06 +03:00
c0a3c6f977 Add latex faces to +spell-excluded-faces-alist 2020-08-24 16:16:19 +03:00
e3750dbf66 checkers/spell: add +flyspell flag
spell-fu lacks support for multiple dictionaries, affix expansion, and
many non-English dictionaries, so I've added back flyspell support to
the spell module, but opt-in, because it is still the significantly
slower option and spell-fu may support them one day.

If not, tlikonen/wcheck-mode is another alternative to consider.

Fixes #3813
2020-08-23 18:48:50 -04:00
c497cdabc7 checkers/spell: fix z=, zq, zw & personal dictionary
+ Fixes ispell not noticing allowed words in your personal dictionary.
  So +spell/correct would sometimes correct words that spell-fu wasn't
  highlighting as incorrect, and sometimes wouldn't correct words that
  were.
+ Fixes spell-fu refusing to read or write to the personal dictionary if
  the file didn't already exist beforehand (for zq and zw).
+ Change ispell-dictionary fallback from "en_US" (which aspell won't
  always recognize) to "en".
+ Moved ispell-personal-dictionary to ~/.emacs.d/.local/etc/ispell/ by
  default.
2020-08-23 02:32:58 -04:00
d393d3e0cd checkers/spell: add doctor.el; no-op without aspell
Aspell is a hard dependency of this module, even if you use hunspell as
a backend. The spellchecker will simply bow out if aspell isn't present
on your system at startup.
2020-08-21 22:01:50 -04:00
ff9c1ace22 checkers/spell: replace flyspell with spell-fu
Spell-fu is significantly faster, but does produce more false
positives (more faces must be added to spell-fu-faces-exclude to reduce
these).

Unfortunately, there is no fancy "correction" interface for spell-fu
yet, so we'll have to resort to ispell-word (on z=) for now.
2020-08-21 18:57:10 -04:00
2c435a04cf Bump :checkers
d12frosted/flyspell-correct@fd8ac7a -> d12frosted/flyspell-correct@dea1290
flycheck/flycheck@246e1d4 -> flycheck/flycheck@c02cd77
mhayashi1120/Emacs-langtool@a71ed02 -> mhayashi1120/Emacs-langtool@8276ecc
2020-07-23 01:31:36 -04:00
cda1d0f81c Fix typo in checkers/spell/README 2020-07-21 13:53:11 +02:00
bd3f89ab3c Fix typo in modules/checkers/spell/README.org 2020-07-13 07:30:47 +02:00
a0e4219a32 :checkers spell documentation (#3462)
* :checkers spell documentation

* Fix based on changes

Fix date and version
Create TOC
Remove indentation
Remove blank lines
Hard-wrapped paragraphs
Remove comments
2020-07-12 22:11:39 -04:00
7ecda0d8e7 checkers/spell: fix end-of-file error
Closes #3300
2020-06-05 04:05:29 -04:00
5b8b04f0c8 Properly lazy load flyspell
Package was eagerly loaded at startup, so we must pretend it hasn't to
defer it and future configuration.

And generalize defer-feature! macro.
2020-06-05 01:41:49 -04:00
8bf902d5f4 General refactors & reformatting across the board 2020-06-04 20:13:28 -04:00
46c1f7a7b4 Fix #3282: activate flyspell-lazy-mode 2020-06-02 23:18:01 -04:00
00ddb2eba6 Only rebind ispell-word if flyspell-correct is enabled
flyspell-correct-at-point is not defined unless the the spell module is
enabled.
2020-05-16 22:33:33 -06:00
8b5525049d Bump :checkers
d12frosted/flyspell-correct@e765d1a -> d12frosted/flyspell-correct@fd8ac7a
flycheck/flycheck@f19a51c -> flycheck/flycheck@246e1d4

We're also transitioning from abbreviated SHA1 hashes to full ones. See
45cdfb125 for why.
2020-04-30 01:28:02 -04:00
169f9a6121 General, minor refactor & reformatting 2020-03-27 01:25:30 -04:00
e46cd73f3d Bump :checkers spell
d12frosted/flyspell-correct@b0353a4 -> d12frosted/flyspell-correct@e765d1a
2020-02-29 12:34:28 -05:00
7f6876d85b Enable flyspell in git-commit-mode 2020-02-13 18:09:09 +08:00
ef472d7c1a Add flyspell-lazy package
To hopefully speed up flyspell.
2020-02-08 20:43:29 -05:00
a9402cfb55 Fix #2373: bring back package pinning
This needs some serious refactoring...
2020-01-25 19:02:00 -05:00
b2e6a069f0 Move an aspell specific argument to appropriate block 2020-01-23 10:52:44 +00:00
206d0d9d92 Prevent flycheck-correct if region/insert mode is active 2020-01-20 22:23:40 -05:00
fb24a8deec Activate flyspell-mode in specific modes
yaml-mode is derived from text-mode, rather than prog or conf-mode. This
may be true for other major modes, so we must be more judicious about
where we activate flyspell-mode.
2020-01-20 19:31:35 -05:00
4cc14389e8 PIN ALL THE PACKAGES 2020-01-14 22:32:11 -05:00
b89992624b Move :tools fly{check,spell} to :checkers {syntax,spell}
These modules were renamed so we can later generalize their
implementations, such as adding flymake support to the syntax checker.
2020-01-09 22:56:26 -05:00