Gnus development mailing list
 help / color / mirror / Atom feed
* how long is a temporary down score in effect?
@ 2022-03-14 19:19 Emanuel Berg
  2022-03-14 19:26 ` Emanuel Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg @ 2022-03-14 19:19 UTC (permalink / raw)
  To: ding

how long is a temporary down score in effect?

In (info "(gnus) Score File Format") lines 72-77 it says:

  If the third element is present it [...] says when the last
  time this score entry matched, which provides a mechanism
  for expiring the score entries. [...] The date is
  represented by the number of days since December 31, 1 BCE.

The number that I get in the score file is 738228.

So I wrote this:

(defun days-since (year month day)
  (string-to-number
    (format-seconds "%d"
      (float-time (time-since (encode-time 0 0 0 day month year))) )))

However

  (- 738228 (days-since 0 0 0)) ; -397

which doesn't make sense (temporary ban for a negative period
of time - is it some other date?).

Why does it have to be so complicated BTW?

So how long is it?

I'd like to set the temporary down score time to _1 month_ to
begin with ... Is there really no variable (option) for that?

-- 
underground experts united
https://dataswamp.org/~incal



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how long is a temporary down score in effect?
  2022-03-14 19:19 how long is a temporary down score in effect? Emanuel Berg
@ 2022-03-14 19:26 ` Emanuel Berg
  2022-04-06 16:36   ` Felix Dietrich
  0 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg @ 2022-03-14 19:26 UTC (permalink / raw)
  To: ding

> However
>
>   (- 738228 (days-since 0 0 0)) ; -397
>
> which doesn't make sense (temporary ban for a negative
> period of time - is it some other date?).

Okay, I see, no year 0 so it should be

(defun days-since (year month day)
  (string-to-number
    (format-seconds "%d"
      (float-time (time-since (encode-time 0 0 0 day month year))) )))

;; (- 738228 (days-since 1 1 1)) ; 1

Okay, so a single day?! Well, better than negative three
hundred and ninety seven I guess! LOL

I also don't find where this is computed in the Gnus
source ...

-- 
underground experts united
https://dataswamp.org/~incal



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how long is a temporary down score in effect?
  2022-03-14 19:26 ` Emanuel Berg
@ 2022-04-06 16:36   ` Felix Dietrich
  2022-04-06 22:18     ` Emanuel Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Felix Dietrich @ 2022-04-06 16:36 UTC (permalink / raw)
  To: ding

Emanuel Berg <moasenwood@zoho.eu> writes:

> how long is a temporary down score in effect?

> I'd like to set the temporary down score time to _1 month_ to
> begin with ... Is there really no variable (option) for that?

Does ‘gnus-score-expiry-days’ do what you want?

    Number of days before unused score file entries are expired.
    If this variable is nil, no score file entries will be expired.

> In (info "(gnus) Score File Format") lines 72-77 it says:
> 
>   If the third element is present it [...] says when the last
>   time this score entry matched, which provides a mechanism
>   for expiring the score entries. [...] The date is
>   represented by the number of days since December 31, 1 BCE.
> 
> The number that I get in the score file is 738228.
>
> I also don't find where this is computed in the Gnus
> source ...

The function ‘gnus-score-headers’ does:

  #+begin_src emacs-lisp
    (let ;; [elided assignments]
         (now (time-to-days nil))
         (expire (and gnus-score-expiry-days
                 (- now gnus-score-expiry-days)))
  #+end_src

And the various scoring functions have:

  #+begin_src emacs-lisp
  (cond
   ;; [elided conditions]
   ;; This entry has expired, so we remove it.
   ((and expire (< date expire))
    (gnus-score-set 'touched '(t) alist)
    (setcdr entries (cddr entries)))
   ;; [elided conditons]
   )
  #+end_src

I donʼt know if these really do what I suspect, but they are the best
candidates I could find with a short ‘apropos’ and ‘occur’.
-- 
Felix Dietrich



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how long is a temporary down score in effect?
  2022-04-06 16:36   ` Felix Dietrich
@ 2022-04-06 22:18     ` Emanuel Berg
  2022-04-07  5:09       ` Felix Dietrich
  0 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg @ 2022-04-06 22:18 UTC (permalink / raw)
  To: ding

Felix Dietrich wrote:

>> [...] how long is a temporary down score in effect?
>>
>> I'd like to set the temporary down score time to _1 month_
>> to begin with ... Is there really no variable (option)
>> for that?
>
> Does ‘gnus-score-expiry-days’ do what you want?
>
>   Number of days before unused score file entries are
>   expired. If this variable is nil, no score file entries
>   will be expired.

I don't know, it sounds like it. That is set to 7 days so
I don't have to change that if it is in effect.

But wasn't there some other thing mentioned that indicated
something much smaller? Or was that a miscalculation, simply?

7 days seems a good start ...

-- 
underground experts united
https://dataswamp.org/~incal



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how long is a temporary down score in effect?
  2022-04-06 22:18     ` Emanuel Berg
@ 2022-04-07  5:09       ` Felix Dietrich
  2022-04-07  5:20         ` Emanuel Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Felix Dietrich @ 2022-04-07  5:09 UTC (permalink / raw)
  To: ding

Emanuel Berg <moasenwood@zoho.eu> writes:

> Felix Dietrich wrote:
>
>>> [...] how long is a temporary down score in effect?
>>>
>>> I'd like to set the temporary down score time to _1 month_
>>> to begin with ... Is there really no variable (option)
>>> for that?
>>
>> Does ‘gnus-score-expiry-days’ do what you want?
>>
>>   Number of days before unused score file entries are
>>   expired. If this variable is nil, no score file entries
>>   will be expired.
>
> I don't know, it sounds like it. That is set to 7 days so
> I don't have to change that if it is in effect.
>
> But wasn't there some other thing mentioned that indicated
> something much smaller? Or was that a miscalculation, simply?

Mentioned where?  This does not ring any bells for me.  Maybe you can
find what you are looking for by (re)reading (info "(gnus) Scoring")?
-- 
Felix Dietrich



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how long is a temporary down score in effect?
  2022-04-07  5:09       ` Felix Dietrich
@ 2022-04-07  5:20         ` Emanuel Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Emanuel Berg @ 2022-04-07  5:20 UTC (permalink / raw)
  To: ding

Felix Dietrich wrote:

>>>> [...] how long is a temporary down score in effect?
>>>>
>>>> I'd like to set the temporary down score time to _1
>>>> month_ to begin with ... Is there really no variable
>>>> (option) for that?
>>>
>>> Does ‘gnus-score-expiry-days’ do what you want?
>>>
>>>   Number of days before unused score file entries are
>>>   expired. If this variable is nil, no score file entries
>>>   will be expired.
>>
>> I don't know, it sounds like it. That is set to 7 days so
>> I don't have to change that if it is in effect.
>>
>> But wasn't there some other thing mentioned that indicated
>> something much smaller? Or was that
>> a miscalculation, simply?
>
> Mentioned where? This does not ring any bells for me.

Didn't someone say it lasted just one day?

-- 
underground experts united
https://dataswamp.org/~incal



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-07  5:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 19:19 how long is a temporary down score in effect? Emanuel Berg
2022-03-14 19:26 ` Emanuel Berg
2022-04-06 16:36   ` Felix Dietrich
2022-04-06 22:18     ` Emanuel Berg
2022-04-07  5:09       ` Felix Dietrich
2022-04-07  5:20         ` Emanuel Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).