]> git.eshelyaron.com Git - emacs.git/commit
Improve use of Flyspell's API in erc-spelling
authorF. Jason Park <jp@neverwas.me>
Sun, 5 Jan 2025 23:59:46 +0000 (15:59 -0800)
committerEshel Yaron <me@eshelyaron.com>
Wed, 8 Jan 2025 08:58:34 +0000 (09:58 +0100)
commit2a3911dc57219dedd056e14bdb5ed36343f9b804
tree0e22f5372167a68f26872199e209ccb7db8b7994
parent160753c4251df51050c5db81c1c7da26312b74bf
Improve use of Flyspell's API in erc-spelling

* etc/ERC-NEWS: Announce deprecation of `erc-spelling-flyspell-verify'
and `erc-spelling-unhighlight-word'.  A slight behavioral change not
worth mentioning is that, previously, ERC arranged for Flyspell to
ignore any word immediately following a forward slash anywhere in the
prompt input, even those for which the slash served as mere
punctuation (a "stroke"), as in "something/misspelt."  As of this
change, Flyspell only unconditionally exempts an initial slash-prepended
word, like "tableflip" in "ERC> /tableflip", and checks all others that
follow against known slash commands.
* lisp/erc/erc-spelling.el: Change top-level assignment of `erc-mode'
symbol-property `flyspell-mode-predicate' from
`erc-spelling-flyspell-verify' to `erc-spelling--flyspell-input-p'.
(erc-spelling-mode, erc-spelling-disable): Remove local member from
`flyspell-incorrect-hook'.
(erc-spelling-init): Add `erc-spelling--flyspell-check' to
`flyspell-incorrect-hook' locally.  Don't bother explicitly setting
`flyspell-generic-check-word-predicate' because Flyspell already does
that for clients using the `flyspell-mode-predicte' interface.
(erc-spelling-flyspell-verify, erc-spelling-unhighlight-word): Mark
obsolete.
(erc-spelling--flyspell-check, erc-spelling--flyspell-input-p): New
functions, essentially the two halves of a reworked and bifurcated
`erc-spelling-flyspell-verify'.  Though used as a predicate, the first
is not named as such because it performs side effects.
* test/lisp/erc/erc-scenarios-spelling.el: New file.
* test/lisp/erc/resources/spelling/auto-correct.eld: New file.
(Bug#75327)

(cherry picked from commit f9ecde75bbcd315557481585a1146f976f719504)
etc/ERC-NEWS
lisp/erc/erc-spelling.el
test/lisp/erc/erc-scenarios-spelling.el [new file with mode: 0644]
test/lisp/erc/resources/spelling/auto-correct.eld [new file with mode: 0644]