From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Trevor Arjeski Newsgroups: gmane.emacs.bugs 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 Message-ID: <87zfk7qg7w.fsf@gmail.com> References: <877c7bim53.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2059"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 75327@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 04 06:52:31 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tTx5K-0000PA-WE for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jan 2025 06:52:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTx4x-0000yD-CQ; Sat, 04 Jan 2025 00:52:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tTx4t-0000xy-HK for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 00:52:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTx4s-0002F2-T9 for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 00:52:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=5a2qZu7ZYhaIImTuvO2FlUC8ns1t1/Pfw1NBJgpme1U=; b=V3bIRRtJc78JivmtJRPSaY5scVCt2gQqLv46OSc228Jm2U3duFRF6Q8gxj05zk5s9R59ApUrcdgoFwiJWiyNz+qY6g2UEK4PD3JtaASumsOf6IGkK+2ieOQpevQ1fVRUv2M6O/6GMCRoqI9imIKXLXwPDmvYrHsYEKOAgllTV4PFHKo2kee/aWyBbfjwllaUMhSbnFZG4vNGVYfi0l7kjFGHjiDODNMHYIMVoffO79pVMomyQ64lFfYWXd+moh6KRR0NAPDLIIb7moQeiu+Wa4sWQSt2TuQdrVqylWNMYMoDhtIt0ucnemmJ/ZRzHTYaXs+mzvhF/JdEEBIDAnwaUw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTx4s-0003Qz-GQ for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 00:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Trevor Arjeski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Jan 2025 05:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75327 X-GNU-PR-Package: emacs Original-Received: via spool by 75327-submit@debbugs.gnu.org id=B75327.173596989913170 (code B ref 75327); Sat, 04 Jan 2025 05:52:02 +0000 Original-Received: (at 75327) by debbugs.gnu.org; 4 Jan 2025 05:51:39 +0000 Original-Received: from localhost ([127.0.0.1]:53052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTx4U-0003QL-UC for submit@debbugs.gnu.org; Sat, 04 Jan 2025 00:51:39 -0500 Original-Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:46203) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tTx4S-0003QC-D7 for 75327@debbugs.gnu.org; Sat, 04 Jan 2025 00:51:37 -0500 Original-Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43622267b2eso135045565e9.0 for <75327@debbugs.gnu.org>; Fri, 03 Jan 2025 21:51:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735969895; x=1736574695; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=5a2qZu7ZYhaIImTuvO2FlUC8ns1t1/Pfw1NBJgpme1U=; b=l7LfvfQWpbgN3r8IhVJFcMth/hBm8lNcxdjoy8wI0sRySO/Z18VUyTKe18p57d/jap c6yxi1ku3cCgHhQT2hqdVw+5AXdjwZgxtbi6X7mCZLStfnsbk33E9ME4QPxCobVtk6ym 0d6CqF85MnNzr/zI5NXGWi72yoi3IVJ8IpVScR1TyXNEkmw1WFiE6zovWi9LUSTL+gcl MI3U01Wvgl5TZY3n1PJa8w8V0I1Kd6hT5qyZifeyAFhg0meMa5QLmfzKrm2JCVcYiw96 6UhtiaLZRlUPv2EXrfUNkHV3W1Y3sbx0RpJiUb0gTjfHJKEtLy6kmXc3KdxteaM/vUNY PCXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735969895; x=1736574695; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5a2qZu7ZYhaIImTuvO2FlUC8ns1t1/Pfw1NBJgpme1U=; b=kYAG+UAQT1O/L2L5mglic/mTnJXCBaj4HO/GjafuF42HCYcJU7hX4k4TaarTbJoUt0 mZGr7XXDD33od8FF15sGdCPo658YTDrzlDj9NG1DAII5PjBV+bXpjbuW4KSGKYpgQ9LT uxDmFUp0+PXqvNqg87scRdaFVXTs1T6LhfOZCCpFaAMZTGiIKD8CX4oUfvFtCv4IYGa7 CP9xaWOQf9N+oMKdDpkhb2MwiYvQPEASHfH5c0EFgqd6UrXJHMKOXybT9RBh7TBG08kb z4mI2pncUZGtZOCjkZf5h6j2MffUddemvvBcArUad587xWMmdCXpsG/3vf1xoMA28q6s /WKQ== X-Gm-Message-State: AOJu0YzOMrCfh7HmwRJ1eeNrqVqdSvnFeckLo5BuA3G6CdrxDL3k11RK 13USML2sWBfG6INzWQHGjGVEqWjETFkuDmCO+9psXfCEvsgRnT0VH6vl7w== X-Gm-Gg: ASbGnctF5w2lHn7rveP4zR6LMDLKLOOyOTvZT4KGGc8TLVTZp/76U3InGcgNpGPXv3C pFykp50p1B1IAqg/hPL4icz77fUYsjNYBX3NVQMybs7nhtIGEnOscGj097s8W7HaWw7i+jhLsUn HNSTYuXZvTe6hZh26Z50tGXHZOSQcRk0gPQQPJEBqRfqxSgdtKZoqk7eTN3ztTIx9vg7gLcAV7W V+MRi58JiR61m49/wJlu8mgWBmsK/ispk4tMnh7kuzVDl5TAaOYy28= X-Google-Smtp-Source: AGHT+IFhxcqwfE+DJhIsBqHPRQaYpTIbN3tfD501lqCUjUJr6GSAfXx1Oo6vptvu5pGSxcQDeB+cjQ== X-Received: by 2002:a05:600c:4f11:b0:435:9ed3:5698 with SMTP id 5b1f17b1804b1-43668b5e09bmr397546395e9.24.1735969894770; Fri, 03 Jan 2025 21:51:34 -0800 (PST) Original-Received: from trevarch ([2a00:1370:817a:57c:3ad5:47ff:fe7e:7eb3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436840b35b5sm355991545e9.39.2025.01.03.21.51.32 for <75327@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2025 21:51:33 -0800 (PST) In-Reply-To: <877c7bim53.fsf@gmail.com> (Trevor Arjeski's message of "Sat, 04 Jan 2025 01:10:48 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298324 Archived-At: --=-=-= Content-Type: text/plain Trevor Arjeski writes: Here is a patch to resolve this issue: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-erc-bug-75327-fix-flyspell-verify.patch Content-Description: patch file >From 3d32aea96cc6ec020e35901d35f1d02994912215 Mon Sep 17 00:00:00 2001 From: Trevor Arjeski 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 --=-=-=--