GNU bug report logs -
#75327
31.0.50; ERC 5.6.1-git: M-TAB not autocorrecting with erc-spelling module and flyspell
Previous Next
Reported by: Trevor Arjeski <tmarjeski <at> gmail.com>
Date: Fri, 3 Jan 2025 22:12:01 UTC
Severity: normal
Found in version 31.0.50
Done: "J.P." <jp <at> neverwas.me>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
"J.P." <jp <at> neverwas.me> writes:
Thanks for the bug explanation!
> In the future, please use the GNU ChangeLog style for commit messages,
> as described in CONTRIBUTE.
Noted.
>> ---
>> lisp/erc/erc-spelling.el | 29 +++++++++++++----------------
>> 1 file changed, 13 insertions(+), 16 deletions(-)
>>
>> diff --git a/lisp/erc/erc-spelling.el b/lisp/erc/erc-spelling.el
>> index 01e587af368..0bfb20fce2e 100644
>> --- a/lisp/erc/erc-spelling.el
>> +++ b/lisp/erc/erc-spelling.el
>> @@ -92,22 +92,19 @@ erc-spelling-unhighlight-word
>>
>> (defun erc-spelling-flyspell-verify ()
>> "Flyspell only the input line, nothing else."
> [...]
>> + (when-let* (((>= (point) erc-input-marker))
>> + (word-data (flyspell-get-word)))
>
> While calling `flyspell-get-word' definitely seems to work and is
> probably harmless, I'm not sure Flyspell's authors intended these
> predicates to know about the current candidate, much less modify
> existing overlays based on that info (both preexisting transgressions
> and obviously not your doing).
>
> There's also the small matter of `flyspell-get-word' running twice in
> quick succession during the course of a normal `flyspell-word' call.
> Again, probably harmless, but if there's a more idiomatic way to get at
> this, we should probably abide (see attached), just in case future
> flyspell.el hackers decide to assume all "consumers" of its API are well
> behaved citizens.
>
>> + (cond
>> + ;; don't spell-check names of users
>> + ((and erc-channel-users
>> + (erc-get-channel-user (car word-data)))
>> + (erc-spelling-unhighlight-word word-data)
>> + nil)
>> + ;; if '/' occurs before the word, don't spell-check it
>> + ((eq (char-before (nth 1 word-data)) ?/)
>> + (erc-spelling-unhighlight-word word-data)
>> + nil)
>> + (t t))))
>>
>> (put 'erc-mode
>> 'flyspell-mode-predicate
>
> Please see the attached iteration, which has a few more changes than
> your v1 patch. If we go with something similar, that would, by my
> uninformed figuring, put you right at the copyright-exempt limit of
> 12-ish nontrivial lines (though we may be pushing the envelope a tad).
>
> Thanks.
Looks good to me, as long as it fixes the issue I will be glad. You
could just remove my name from the commit, since the changes in the
patches don't really resemble my crude fix.
> P.S. Have you already (or will you) put in for a copyright assignment?
I have not. Not sure if I will do it. I am content with my patches just
being guides to help a maintainer, since I am not really familiar with
the true inner workings of emacs or erc.
This bug report was last modified 130 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.