emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4c3f3bf: Support scoring on article age interactively in Gnus


From: Lars Ingebrigtsen
Subject: master 4c3f3bf: Support scoring on article age interactively in Gnus
Date: Sat, 12 Sep 2020 08:04:11 -0400 (EDT)

branch: master
commit 4c3f3bf25623c936ca07249203147ae0332d64ed
Author: Alex Bochannek <alex@bochannek.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/gnus/gnus-score.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index 6a0e8ce..ffc6b8c 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]