all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Trevor Arjeski <tmarjeski@gmail.com>
To: 75327@debbugs.gnu.org
Subject: bug#75327: 31.0.50; ERC 5.6.1-git: M-TAB not autocorrecting with erc-spelling module and flyspell
Date: Sat, 04 Jan 2025 08:51:31 +0300	[thread overview]
Message-ID: <87zfk7qg7w.fsf@gmail.com> (raw)
In-Reply-To: <877c7bim53.fsf@gmail.com> (Trevor Arjeski's message of "Sat, 04 Jan 2025 01:10:48 +0300")

[-- Attachment #1: Type: text/plain, Size: 86 bytes --]

Trevor Arjeski <tmarjeski@gmail.com> writes:

Here is a patch to resolve this issue:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch file --]
[-- Type: text/x-patch, Size: 1962 bytes --]

From 3d32aea96cc6ec020e35901d35f1d02994912215 Mon Sep 17 00:00:00 2001
From: Trevor Arjeski <tmarjeski@gmail.com>
Date: Sat, 4 Jan 2025 08:45:29 +0300
Subject: [PATCH] erc: bug#75327 fix flyspell verify

Slightly refactored `erc-spelling-flyspell-verify' to use
`flyspell-get-word', which in turn, allows M-TAB to call
`flyspell-auto-correct-word'.
---
 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."
-  ;; FIXME: Don't use `flyspell-word'!
-  (let ((word-data (and (boundp 'flyspell-word)
-                        flyspell-word)))
-    (when word-data
-      (cond ((< (point) erc-input-marker)
-             nil)
-            ;; 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)))))
+  (when-let* (((>= (point) erc-input-marker))
+              (word-data (flyspell-get-word)))
+    (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
-- 
2.47.1


  reply	other threads:[~2025-01-04  5:51 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 [this message]
2025-01-05 19:33   ` J.P.
     [not found]   ` <874j2drr6m.fsf@neverwas.me>
2025-01-05 20:34     ` Trevor Arjeski

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zfk7qg7w.fsf@gmail.com \
    --to=tmarjeski@gmail.com \
    --cc=75327@debbugs.gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.