From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.bugs Subject: bug#36697: 27.0.50; gnus: some articles with score 0 are killed Date: Thu, 23 Jul 2020 16:04:35 -0400 Message-ID: References: <87tv924nad.fsf@gnus.org> <87a7au2lma.fsf@gnus.org> <87tv90v80p.fsf@gnus.org> <8736c7y7nr.fsf@gnus.org> <87d04ro6m2.fsf@gnus.org> <87lfjanxmv.fsf@gnus.org> Reply-To: sds@gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37634"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Cc: 36697@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 23 22:05:10 2020 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 1jyhSo-0009hX-H4 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Jul 2020 22:05:10 +0200 Original-Received: from localhost ([::1]:34310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyhSn-0007LR-D1 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Jul 2020 16:05:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyhSg-0007LK-41 for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2020 16:05:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34571) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyhSf-00063n-Qy for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2020 16:05:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jyhSf-0002WK-Io; Thu, 23 Jul 2020 16:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sam Steingold Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Thu, 23 Jul 2020 20:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36697 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 36697-submit@debbugs.gnu.org id=B36697.15955346939672 (code B ref 36697); Thu, 23 Jul 2020 20:05:01 +0000 Original-Received: (at 36697) by debbugs.gnu.org; 23 Jul 2020 20:04:53 +0000 Original-Received: from localhost ([127.0.0.1]:46117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jyhSQ-0002Vj-1c for submit@debbugs.gnu.org; Thu, 23 Jul 2020 16:04:53 -0400 Original-Received: from mail-qt1-f170.google.com ([209.85.160.170]:42880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jyhSN-0002VU-Cp for 36697@debbugs.gnu.org; Thu, 23 Jul 2020 16:04:45 -0400 Original-Received: by mail-qt1-f170.google.com with SMTP id e12so5339449qtr.9 for <36697@debbugs.gnu.org>; Thu, 23 Jul 2020 13:04:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:in-reply-to:references:user-agent :return-receipt-to:reply-to:date:message-id:mime-version :content-transfer-encoding; bh=6CFFrg1vnWbxb1UYasXx8P6HL/Y9AQ5Ys1ICgRccN/E=; b=BsLsEqoOMZ09v3TqBmb7Pa3jv/fr0T+BUXmXG2nf7LAF3airwcV/XBT2jStyk0iQz/ fc1tIYcD+qmAPv7pk5beCF8+PuvkQJqDjlmZs4MeKSH7PDPUUcd+WpOJ5z3tlnxnFGmz J3jkOQdWyqv8BqTg4Zs5TZvv4urgbA/YgKS2BY0Zs0dFG6wey+0ZmMPpPSACvWPU5mZc 36eKtcKTq3fSo2jd8rClZ65tlCUNu+g/m7ZSBBaLc5AveRooLQLm9mgrwpBvpA+BrZzJ 4kJZN8gZ3CSUmsADWcJ8njt3/Wyp0V/EpyVEtCDPoFQ1lcHdQno94c/VCJddjzzzYDIH WCzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :user-agent:return-receipt-to:reply-to:date:message-id:mime-version :content-transfer-encoding; bh=6CFFrg1vnWbxb1UYasXx8P6HL/Y9AQ5Ys1ICgRccN/E=; b=gdChd87uPRvj58djC14DEt7rwPcxclwsIUXjBzaW44pfCJhEgKStofY+lg+L3QQ2Tc 4jRW91KGBXg9rZ8MfGaAvl4Dmqqa5ZF4PWsZpD1/OqPQh2ATS6A3nW0gtFQhfbQgIdXf W/r0q2Tk2G8rbOAoaXpyQHA1tpSh9v4Xp3BAyeDBMu+xRXoZzRLKRflI2P1aB5JRPlIx gR38d2Tzi2xjG7m9gpAoRBeNrySfAsNEmNW727oCvgR514QVuTpDlrE7XSFpXNPrDvx4 W+3ZwrD5SOfr0Mq8SNMJY+W00Hujj5RmreFxBUiRBUfcin+bcA7z6yli42CZCuf4uTjq wxtg== X-Gm-Message-State: AOAM533X182yVqrTu/pJX2EXL+RN5kIQJpKciMjgxstHy47U3h1ij83B PSdSDuafttrHMD40o9rHVw== X-Google-Smtp-Source: ABdhPJxWlV3cnRzWWNQW4U5htG7F9OWoJaXAhnpoW9lIT4x/Mpw9JM8xRE7xl2tnvQ09q7xFZ/3RyA== X-Received: by 2002:ac8:4408:: with SMTP id j8mr5996918qtn.46.1595534677634; Thu, 23 Jul 2020 13:04:37 -0700 (PDT) Original-Received: from BZ-C02XR5CGJG5L (pool-108-30-23-113.nycmny.fios.verizon.net. [108.30.23.113]) by smtp.gmail.com with ESMTPSA id u188sm1436988qkb.23.2020.07.23.13.04.36 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 13:04:36 -0700 (PDT) In-Reply-To: <87lfjanxmv.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 23 Jul 2020 15:56:08 +0200") X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. 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" Xref: news.gmane.io gmane.emacs.bugs:183464 Archived-At: > * Lars Ingebrigtsen [2020-07-23 15:56:08 +0200]: > > Sam Steingold writes: > >> If you tell me something like "function foo should return A in your >> case, figure out why it returns B", I am more than willing to debug. > > The scoring that the "Y-" stuff is coming from is done in the > `gnus-score-headers' function. Thanks. Here is my investigation: `*Headers*` buffer: --8<---------------cut here---------------start------------->8--- =D0=A6=D0=B8=D1=82=D0=B0=D1=82=D0=B0 #462135 =D0=A6=D0=B8=D1=82=D0=B0=D1=82=D0=B0 #462136 =D0=A6=D0=B8=D1=82=D0=B0=D1=82=D0=B0 #462137 =D0=A6=D0=B8=D1=82=D0=B0=D1=82=D0=B0 #462138 --8<---------------cut here---------------end--------------->8--- Here is the score rule: --8<---------------cut here---------------start------------->8--- (("subject" ;; many non-lower-case chars is a bad sign ("[^a-z]\\{50\\}" -100 nil R) ("[^a-z]\\{100\\}" -300 nil R) ("[^a-z]\\{150\\}" -1000 nil R) ...)) --8<---------------cut here---------------end--------------->8--- `gnus-score-string' is called from `gnus-score-headers', `search-func` is `re-search-backward' It is called on line 2148 on `match' which is "[^a-z]\\{50\\}". So, it matches for _all_ subjects - _before_ the last 3 - because it searches _across_ lines! So, the problem is that search-func is applied to the whole *Headers* instead of it being narrowed to the current subject. In fact, if would seem to make sense to pass a list of headers instead of using a buffer and then narrowing to each string in that buffer. I can probably fix it along these lines - unless you would prefer to do it yourself. Thank you very much for your patience and help! PS. The code in gnus-score.el seems to avoid modern Emacs-Lisp features like `dolist' and `when'. Is there a (non-historical) reason for that? Also, the functions are very long and thus hard to edebug. I had to extract some loops into separate functions to speed up stepping. Is it okay to commit? --=20 Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1894 http://childpsy.net http://calmchildstories.com http://steingoldpsychology.= com https://thereligionofpeace.com https://camera.org https://iris.org.il If I had a $ for every time I was rejected, I would no longer be rejected.