Support scoring on article age interactively in Gnus

* lisp/gnus/gnus-score.el (gnus-summary-score-entry): Support
scoring on article age in interactive scoring (bug#43270).
This commit is contained in:
Alex Bochannek 2020-09-12 14:04:02 +02:00 committed by Lars Ingebrigtsen
parent a4bfb0bc5c
commit 4c3f3bf256

View file

@ -862,6 +862,18 @@ If optional argument `EXTRA' is non-nil, it's a non-standard overview header."
(setq match (string-to-number match)))
(set-text-properties 0 (length match) nil match))
;; Modify match and type for article age scoring.
(if (string= "date" (nth 0 (assoc header gnus-header-index)))
(let ((age (string-to-number match)))
(if (or (< age 0)
(string= "0" match))
(user-error "Article age must be a positive number"))
(setq match age
type (cond ((eq type 'after)
'<)
((eq type 'before)
'>)))))
(unless (eq date 'now)
;; Add the score entry to the score file.
(when (= score gnus-score-interactive-default-score)