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: Sun, 05 Jan 2025 23:34:29 +0300 Message-ID: <87h66dgfu2.fsf__30390.7497016311$1736109334$gmane$org@gmail.com> References: <877c7bim53.fsf@gmail.com> <87zfk7qg7w.fsf@gmail.com> <874j2drr6m.fsf@neverwas.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28123"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 75327@debbugs.gnu.org, emacs-erc@gnu.org To: "J.P." Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 05 21:35:26 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 1tUXLH-00070l-S1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jan 2025 21:35:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUXKy-0004BJ-HJ; Sun, 05 Jan 2025 15:35:04 -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 1tUXKx-0004AJ-AF for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 15:35:03 -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 1tUXKx-0005FB-1T for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 15:35: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=phFDHgzPV6kc1LEyqv2jTEA9zk+Vd5a/m5qQcDkndBc=; b=unFEaiz9u3jltGMEHZcs66WlftyFTVfEyOntV1t/QFraBAecUrJztX69zKiSqDIVdb3Bw0hOyQ/lXasRd/vJYza1vvy5TjlTT+nXbJ5Ayu7lImt/KSP6VCyfYGDuLDsCy0Fn6FDVbOvldg3XYblgIfT86cGuQlqZnwGUWmq31VwXrV8M/8GD4Vbt5ZhktCrq4Y6MwfCTnxDvH8pJ/nNvjEIgzTtb3UqkdwmNtLZrIHF5Q1EJ+NVjvQqN6Mb38IFjsp749vW/bn8+nYhyPxm7Grua82awofYRMZZ8AfkGfOwbuJjyYmGcIC0c5CpJsEBMXtTs/84N6bCRIvBeRCFYow==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUXKw-0008RH-TL for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 15:35: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: Sun, 05 Jan 2025 20:35: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.173610927932386 (code B ref 75327); Sun, 05 Jan 2025 20:35:02 +0000 Original-Received: (at 75327) by debbugs.gnu.org; 5 Jan 2025 20:34:39 +0000 Original-Received: from localhost ([127.0.0.1]:35422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUXKY-0008QI-Q9 for submit@debbugs.gnu.org; Sun, 05 Jan 2025 15:34:39 -0500 Original-Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:54662) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tUXKW-0008Q9-SY for 75327@debbugs.gnu.org; Sun, 05 Jan 2025 15:34:38 -0500 Original-Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-54025432becso14623900e87.1 for <75327@debbugs.gnu.org>; Sun, 05 Jan 2025 12:34:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736109275; x=1736714075; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=phFDHgzPV6kc1LEyqv2jTEA9zk+Vd5a/m5qQcDkndBc=; b=ib3e0H1SN53EYMgu4yPH/YFTvvVEVCfbMsLgOkSwJGV+FSiLAsNYtc++sO44yqfZlt NvA0zBnJhXZlf5bhknUSIIqA0m04Bi4GekuJU00pX0SyNk4BTTIaZq+CT+foQTVU6XD8 LeMqOR1+b4J2cXsMHOzgmcrgtVG4RgYNjlxv4gG26kbw61atwP1f56hh3ye7XoU+Xxon ABQpYGC8kR3ZQIGuzjhswtBO/UxhVfBS1IFEKgfkfHf8Jlmkn6ek/BKV6pjGcXRFCnv2 6leSWfUBtPthwHWVzR2iYh7Lj/dC2kXOygcAjsX4dz+lNSPyhXuCTjztC1HtDhG7CX/Q nuAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736109275; x=1736714075; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=phFDHgzPV6kc1LEyqv2jTEA9zk+Vd5a/m5qQcDkndBc=; b=QkykzlSxHl5rh/NVDK+0efo6HuoYUzTFCoKQYyiUsjaJ11chlLcI81qII5RZOSRFC8 8h+l3oi/iKhots5r3GB5q4tu5zzecAQFujlpzWiu5wfDcU8ZFUTrjfM9g8ARwvEFM/aN ZZk9uwX4maPAFJuOuqT1L9Zyf+pvJoG7XdntF1ueT/vEaHVVl7eOPzpKE3k/nFGA7Iov ltfTbjPPWeCPCPEuXsr+Upr0eol9aIUt6eRTShbgTNZiiY79T9fwx75NyTIUn+8aYU/r xW7VYzBLN5xw9JIQzopP6fw/2lkx1wuudz/tMXPFHR1Uc7xkRmuF88JgZ+hgwgyN55V3 o7kA== X-Gm-Message-State: AOJu0YxQgqLuzpKyT7A+c1NRgsG/VLP2dXEQftoMpZFtcVj+XxHZENWf WDSUsV8FVBMYTMzCwOtxAqqTjt6xfovj+m6le9YVI98TESadmZFlce9A9H45 X-Gm-Gg: ASbGncshtFqVGLnSmtjPXnDlAvOQweKd1p1dCTccBbZiUrqc18bFo2kDZblwoDtKlgE db01vrYeBfu6mp6YXvCj1fHkrh/UExUEaJFFDAztEWjNGNL9ScDql/OUZLG9tAz0sBiYjdAAE8y tab6iBIJElU9Z5FuD1t85pmKe3OF0ci8GXqnTn3spF4qypV3p7t20WSCR0iYc+B3BiPU8SAn2lp HPmgxZ7ICRTsRjeQXlymm44c/Yg3vLUKZJFzGQ1y3RAV2KGfg== X-Google-Smtp-Source: AGHT+IHjeq7kD4235sChIODVJXkFLT29WtGT9HDDE1O3ctrI94NraFdtErrc7w8jh0xB6qlK+x8Yiw== X-Received: by 2002:a05:6512:683:b0:542:2f0f:66d9 with SMTP id 2adb3069b0e04-5422f0f69d8mr18248578e87.16.1736109274741; Sun, 05 Jan 2025 12:34:34 -0800 (PST) Original-Received: from trevarch ([193.42.63.43]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5423bfa6bbbsm3437450e87.276.2025.01.05.12.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2025 12:34:33 -0800 (PST) In-Reply-To: <874j2drr6m.fsf@neverwas.me> (J. P.'s message of "Sun, 05 Jan 2025 11:33:53 -0800") 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:298608 Archived-At: "J.P." 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.