GNU bug report logs -
#36697
27.0.50; gnus: some articles with score 0 are killed
Previous Next
Reported by: sds <at> gnu.org
Date: Tue, 16 Jul 2019 20:52:01 UTC
Severity: normal
Found in version 27.0.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> * Lars Ingebrigtsen <ynefv <at> tahf.bet> [2020-07-23 15:56:08 +0200]:
>
> Sam Steingold <sds <at> gnu.org> 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---
Цитата #462135
Цитата #462136
Цитата #462137
Цитата #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?
--
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.
This bug report was last modified 3 years and 87 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.