From: Trevor Arjeski <tmarjeski@gmail.com>
To: "J.P." <jp@neverwas.me>
Cc: 75327@debbugs.gnu.org, emacs-erc@gnu.org
Subject: bug#75327: 31.0.50; ERC 5.6.1-git: M-TAB not autocorrecting with erc-spelling module and flyspell
Date: Sun, 05 Jan 2025 23:34:29 +0300 [thread overview]
Message-ID: <87h66dgfu2.fsf__30390.7497016311$1736109334$gmane$org@gmail.com> (raw)
In-Reply-To: <874j2drr6m.fsf@neverwas.me> (J. P.'s message of "Sun, 05 Jan 2025 11:33:53 -0800")
"J.P." <jp@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.
prev parent reply other threads:[~2025-01-05 20:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-03 22:10 bug#75327: 31.0.50; ERC 5.6.1-git: M-TAB not autocorrecting with erc-spelling module and flyspell Trevor Arjeski
2025-01-04 5:51 ` Trevor Arjeski
2025-01-05 19:33 ` J.P.
[not found] ` <874j2drr6m.fsf@neverwas.me>
2025-01-05 20:34 ` Trevor Arjeski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='87h66dgfu2.fsf__30390.7497016311$1736109334$gmane$org@gmail.com' \
--to=tmarjeski@gmail.com \
--cc=75327@debbugs.gnu.org \
--cc=emacs-erc@gnu.org \
--cc=jp@neverwas.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).