From unknown Tue Jun 17 20:39:16 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#47564 <47564@debbugs.gnu.org> To: bug#47564 <47564@debbugs.gnu.org> Subject: Status: text-property-search-forward does not behave as advertized Reply-To: bug#47564 <47564@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:39:16 +0000 retitle 47564 text-property-search-forward does not behave as advertized reassign 47564 emacs submitter 47564 Nicolas Graner severity 47564 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 02 10:08:37 2021 Received: (at submit) by debbugs.gnu.org; 2 Apr 2021 14:08:37 +0000 Received: from localhost ([127.0.0.1]:60805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lSKTV-0006CB-Jj for submit@debbugs.gnu.org; Fri, 02 Apr 2021 10:08:37 -0400 Received: from lists.gnu.org ([209.51.188.17]:40222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lSKTT-0006C2-JU for submit@debbugs.gnu.org; Fri, 02 Apr 2021 10:08:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSKTQ-0005E0-65 for bug-gnu-emacs@gnu.org; Fri, 02 Apr 2021 10:08:33 -0400 Received: from smtp26.services.sfr.fr ([93.17.128.199]:60057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSKTJ-0003ha-SF for bug-gnu-emacs@gnu.org; Fri, 02 Apr 2021 10:08:30 -0400 Received: from hypra-graner (1.124.67.86.rev.sfr.net [86.67.124.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by msfrf2616.sfr.fr (SMTP Server) with ESMTPS id 9C3751C001405 for ; Fri, 2 Apr 2021 16:08:18 +0200 (CEST) X-mail-filterd: 1.0.0 X-sfr-mailing: LEGIT X-sfr-spamrating: 40 X-sfr-spam: not-spam DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=graner.name; s=202006; t=1617372498; h=From:To:Subject:Date; bh=ARw7QIo0aH7s9t4mB+6cS7UVbAf+RmYBfjV gGnCXrBI=; b=fGbK3lgWfLiA+/ZUNivR8jZOtcoh2zWl13/4/PXdpfgGmrNXrLtr5cvx40S4fRT vJ1Ck9+169+zsAyopvndV0eU1ot0c1MJZM1yjONYb6eTBsTSn+HOAcQK1MCpmnSkFEKAu4laxMFs Q0hG6vyD3O3E/vgp1GZSxcs4fZrUeUC6HhsuGCg+/G7iFDLWWZlc6tRb/Mzk8Cgy1oBmScvhvgCR vECTofa7EIErZaobBj/1gjRtYt1O87PCADdAxA2oA44LBqgFKqmSb2o8PAdzPB7sq1NQ/hb//dYJ 3WksGxeZWr+dBTFHv4QkeeeyJSBZYYaIhoimJuSv7ntY2zcB07w==; Received: from hypra-graner (1.124.67.86.rev.sfr.net [86.67.124.1]) by msfrf2616.sfr.fr (SMTP Server) with ESMTP id 7999F1C001407 for ; Fri, 2 Apr 2021 16:08:18 +0200 (CEST) Received: from hypra-graner (1.124.67.86.rev.sfr.net [86.67.124.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by msfrf2616.sfr.fr (SMTP Server) with ESMTPS for ; Fri, 2 Apr 2021 16:08:18 +0200 (CEST) From: Nicolas Graner To: bug-gnu-emacs@gnu.org Subject: text-property-search-forward does not behave as advertized Date: Fri, 02 Apr 2021 16:08:17 +0200 Message-ID: <868s60wzhq.fsf@universite-paris-saclay.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=93.17.128.199; envelope-from=nicolas.graner@sfr.fr; helo=smtp26.services.sfr.fr X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) I found some discrepancies between the behavior of text-property-search-forward and text-property-search-backward, and what the doc says they should do. I am not sure whether they are bugs or documentation errors, except for the last one below which is clearly a bug. Here is how to reproduce starting from an empty buffer, tested on 28.0.50. I have inserted comments with my observations. (insert "12345678") (put-text-property 3 6 'foo 'bar) (goto-char 1) (text-property-search-forward 'foo 'bar t) ;; moves point to 6 and returns range 3 to 6 ;; Doc says it should move the point to start of range, but it ;; consistently moves to end of range. (goto-char 1) (text-property-search-forward 'foo 'bar nil) ;; moves point to 3 and returns range 1 to 3, whre property foo is nil. ;; Doc says: with PREDICATE nil, a value will match if it is ;; non-nil and is NOT =E2=80=98equal=E2=80=99 to VALUE. ;; In fact, the condition "it is non-nil" is apparently ignored. (goto-char 9) (text-property-search-backward 'foo 'bar t) ;; moves point to 3 and returns range 3 to 6 ;; As above, consistently moves to beginning of range instead of end. (goto-char 7) (text-property-search-backward 'foo 'bar t) ;; returns nil. This one is really weird, considering it works OK from ;; position 6 or 8. As if there was something special when you start 1 ;; after the end of a range. Hope this helps, Nicolas From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 10 12:27:54 2021 Received: (at 47564) by debbugs.gnu.org; 10 Apr 2021 16:27:54 +0000 Received: from localhost ([127.0.0.1]:53116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVGSf-0004df-Ou for submit@debbugs.gnu.org; Sat, 10 Apr 2021 12:27:54 -0400 Received: from sonic312-26.consmr.mail.ir2.yahoo.com ([77.238.178.97]:40440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lVGSc-0004dN-Du for 47564@debbugs.gnu.org; Sat, 10 Apr 2021 12:27:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1618072063; bh=3PQaIkYTzWHr2S6ZoxOTc3jZAPMWgBRAiDpOYxIPOOE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=XNLjqzyly+T1FtJ5JbtntnEJqad2GsxHlVVZvu0aT5vhzk3jbFFIQK1dqZQZ4i4e3LCmirL3h5jqMdN9Dg3FQToH0FOcU7DfPXOvAhIiORWN01zgBljWS5n9wVY5zO1mfy7qEm2+WzCNnclKv5QHgqIKHRo/9npJQorLLsuJwXLl3MLioCIrDGrQ0CKshH1ZioVnXPUSHA3tEyxm6aWf5yBUeo0uofwpYKVsxpSqMX9qvKLa2tyODTlVIPJ7Dk+DfWXGrKvvTHZAs9czACNWvb1NbyKRG3gtQLC+5svn5WQsmLz2q2T3EK2+3bRnd0ETbIoirLuxYlqSgUfkCcCIaA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1618072063; bh=s2ssCyyTcefGRkCQCum00C/YERu+82PcQ6cmhbU+mH2=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Q/Gb1YTskA1tDiMGr/GLKTRv0WfQBEhqAPyZ419gVcXvBMHNrqHc103ZJfqOPxUuq0aDXr+9ib78xnFN7ssizEnUsS7wcTW+SwKTK9JxITZk4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vwO0KBvD56RKMSiMAB.SefMH47cDOs rd0KI2lNFQllYPgCMnRjMoO5LPEszDbstILb68ZyZvjarY6GbsZgwKPFWU_MBlYeSa9eKAi.goOS iMQtr55n7dks0yo4toFylGPEBKtW2bhNlB28IC4hBfQKXEQKfQc2GSV7C3ClqfBtXClAIHV7VLhM MWE8phlKoiFfRfDgzzeYp2lfN0U1mTErgYia6DnLcfC3Zxdxj26OX7LJBbMn6rS8ng5dF9nW9Cm5 ocOFhe.gx5y6D5GgVZZLiuiVOKT88XLRG7VLyaNaPybi7ggv.1tcCZ_7xlZfnem8d0xdI4bCu8VN Z1hRBFpj.9M0bv2cLWSkOuVWHytbko8CaFXay9_WOFteki_QG5wJQgvaM3JLMLckXVNYvSS9JK3r lc0JMA1f.hd_Lj8B8y.ptCbnqhfGcgSxju5iN6Kaw0Rv7DWPuRGuGX1SojihEzuF0w9ycfUAwVu0 4y3EH3w_KavBu9OV351fDNddf8UmQUMHdQbudA0EemGAsOhuC3tY_Mg1ESsH2WUvRr.EoOUmDyHa s52POn_RMb.Jaid_TKxwAlYeRJKjgYZinsBSZCi9KgO1R9jGfQMm2fJgOsiDzlqHWIW4YYXyFq4B bmckVIAhHjf6kO_M_C5BXK.2jx2Ovvp7hD8wu6Djh0fY6G7ejlc9SDYBxsD95D_.H6QUeNCpGc1g YuqGnhfTWJre22_JC4Kp.IXnuM47bNj7xb9gBwhxYrSamtOV6aUMegiE5vTfO7ylPo5O1rDAeyEP gA.3RKPzM1.jBugbdLnuSz5So3dmUZHsEp3vOz2s8fOBlljcIFDnYGQ-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ir2.yahoo.com with HTTP; Sat, 10 Apr 2021 16:27:43 +0000 Received: by kubenode532.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 14d753fc106af02f903b2f70d8661a5c; Sat, 10 Apr 2021 16:27:42 +0000 (UTC) From: =?utf-8?Q?Daniel_Mart=C3=ADn?= To: Nicolas Graner Subject: Re: bug#47564: text-property-search-forward does not behave as advertized References: <868s60wzhq.fsf@universite-paris-saclay.fr> Date: Sat, 10 Apr 2021 18:27:41 +0200 In-Reply-To: <868s60wzhq.fsf@universite-paris-saclay.fr> (Nicolas Graner's message of "Fri, 02 Apr 2021 16:08:17 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.18121 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/16) Content-Length: 2006 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 47564 Cc: stefan@marxist.se, 47564@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Nicolas Graner writes: > > (insert "12345678") > (put-text-property 3 6 'foo 'bar) > (goto-char 1) > (text-property-search-forward 'foo 'bar t) > ;; moves point to 6 and returns range 3 to 6 > ;; Doc says it should move the point to start of range, but it > ;; consistently moves to end of range. I see this was changed in https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3Db295174210465c4285= 729c67ec014e0f5b53f741, but I don't know about the reasons for the change. In any case, the docstring is now inconsistent with the documentation in the Elisp manual, which says that point is placed at the end (which matches the implementation). I've CC Stefan, but I think the docstring error is that `text-property-search-forward' moves point to the end of the matched region, and `text-property-search-backward' moves point to the beginning of the matched region. > (goto-char 1) > (text-property-search-forward 'foo 'bar nil) > ;; moves point to 3 and returns range 1 to 3, whre property foo is nil. > ;; Doc says: with PREDICATE nil, a value will match if it is > ;; non-nil and is NOT =E2=80=98equal=E2=80=99 to VALUE. > ;; In fact, the condition "it is non-nil" is apparently ignored. After reading the code, I'd say you're correct and the "non-nil" is ignored in the implementation. This part was added in response to this bug report: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D37488, perhaps I'm missing something. > (goto-char 9) > (text-property-search-backward 'foo 'bar t) > ;; moves point to 3 and returns range 3 to 6 > ;; As above, consistently moves to beginning of range instead of end. I think this is the same documentation bug as the first one. > (goto-char 7) > (text-property-search-backward 'foo 'bar t) > ;; returns nil. This one is really weird, considering it works OK from > ;; position 6 or 8. As if there was something special when you start 1 > ;; after the end of a range. Yes, this seems like an off-by-one error in the implementation. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 29 06:44:32 2022 Received: (at 47564) by debbugs.gnu.org; 29 Jun 2022 10:44:32 +0000 Received: from localhost ([127.0.0.1]:57714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6VBM-00024a-CL for submit@debbugs.gnu.org; Wed, 29 Jun 2022 06:44:32 -0400 Received: from quimby.gnus.org ([95.216.78.240]:58440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6VBK-00024G-1X for 47564@debbugs.gnu.org; Wed, 29 Jun 2022 06:44:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=X27882Jfw2aDZ4QJrdu0nSfgIDgogFZOPaRwYkkFvHA=; b=K+kOkAVZtdPB3AMI5rPhZozNRY HkFjDqSoFYBi9QivQP6swXgPfSP0434jYF6kaJbrn+iy1WXUKRJfu4rvt7W3ct0IisflEAR+4b86z 5h5Oj/mgPYwFfVQ60iYjn4bUkGZI3IqKIZ5u3yTT2+YzHjihYzhH4thvDTMKbQI6N4qM=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6VB8-0006Ux-NI; Wed, 29 Jun 2022 12:44:17 +0200 From: Lars Ingebrigtsen To: Daniel =?utf-8?Q?Mart=C3=ADn?= Subject: Re: bug#47564: text-property-search-forward does not behave as advertized References: <868s60wzhq.fsf@universite-paris-saclay.fr> X-Now-Playing: The Body's _I've Seen All I Need To See_: "A Pain Of Knowing" Date: Wed, 29 Jun 2022 12:44:14 +0200 In-Reply-To: ("Daniel =?utf-8?Q?Mart=C3=ADn=22's?= message of "Sat, 10 Apr 2021 18:27:41 +0200") Message-ID: <87k08zkav5.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Daniel Martín writes: > Nicolas Graner writes: >> (insert "12345678") >> (put-text-property 3 6 'foo 'bar) >> (goto-char 1) >> (text-property-search-forward 'foo 'bar t) >> ;; moves point to 6 and returns range 3 to 6 >> ;; Doc says it should move [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 47564 Cc: stefan@marxist.se, 47564@debbugs.gnu.org, Nicolas Graner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Daniel Mart=C3=ADn writes: > Nicolas Graner writes: >> (insert "12345678") >> (put-text-property 3 6 'foo 'bar) >> (goto-char 1) >> (text-property-search-forward 'foo 'bar t) >> ;; moves point to 6 and returns range 3 to 6 >> ;; Doc says it should move the point to start of range, but it >> ;; consistently moves to end of range. > > I see this was changed in > https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=3Db295174210465c42= 85729c67ec014e0f5b53f741, > but I don't know about the reasons for the change. In any case, the > docstring is now inconsistent with the documentation in the Elisp > manual, which says that point is placed at the end (which matches the > implementation). I've CC Stefan, but I think the docstring error is > that `text-property-search-forward' moves point to the end of the > matched region, and `text-property-search-backward' moves point to the > beginning of the matched region. (I'm going through old bug reports that unfortunately weren't resolved at the time.) Looking at the manual and the doc strings, they seem to be in agreement on this point (in Emacs 29, at least). >> (goto-char 1) >> (text-property-search-forward 'foo 'bar nil) >> ;; moves point to 3 and returns range 1 to 3, whre property foo is nil. >> ;; Doc says: with PREDICATE nil, a value will match if it is >> ;; non-nil and is NOT =E2=80=98equal=E2=80=99 to VALUE. >> ;; In fact, the condition "it is non-nil" is apparently ignored. > > After reading the code, I'd say you're correct and the "non-nil" is > ignored in the implementation. This part was added in response to this > bug report: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D37488, perhaps > I'm missing something. I've re-re-rewritten the documentation here after that a while ago (because most of the additions there weren't correct). >> (goto-char 7) >> (text-property-search-backward 'foo 'bar t) >> ;; returns nil. This one is really weird, considering it works OK from >> ;; position 6 or 8. As if there was something special when you start 1 >> ;; after the end of a range. > > Yes, this seems like an off-by-one error in the implementation. Looks like this has been fixed in the meantime. So I think that everything here has been fixed by now (at least in Emacs 29), so I'm closing this bug report. If any of these issues still remain, please open a new bug report for those issues. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 29 06:44:33 2022 Received: (at control) by debbugs.gnu.org; 29 Jun 2022 10:44:33 +0000 Received: from localhost ([127.0.0.1]:57717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6VBR-00024v-AT for submit@debbugs.gnu.org; Wed, 29 Jun 2022 06:44:33 -0400 Received: from quimby.gnus.org ([95.216.78.240]:58454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6VBN-00024O-U6 for control@debbugs.gnu.org; Wed, 29 Jun 2022 06:44:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Vt49JKzZ0OycRLZZcWfEJG3+Aka4ktFTA7FCRGluBQ4=; b=PxBd3qI3xueB0fpMKbIjsxsChA mI8UV2WNId6md8+ThU1S/a+s/f5nWZNGSOLR0Sm9g+ji2ZW3L1FKLLroOaakpJJHFJndTO9hk1Ie8 aitkb+LH6puXfUWCXmKWwFzd5ruqdQz4C598vookhfZhI5bbl8G8D489yGniDaB1zTcc=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6VBF-0006V5-RU for control@debbugs.gnu.org; Wed, 29 Jun 2022 12:44:23 +0200 Date: Wed, 29 Jun 2022 12:44:21 +0200 Message-Id: <87ilojkauy.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #47564 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 47564 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 47564 quit From unknown Tue Jun 17 20:39:16 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 27 Jul 2022 11:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator