diff --git a/ChangeLog b/ChangeLog index b5bef19..ac6bac9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2022-04-27 Michael Herstine + + Resolve issue #22. + +2022-02-01 Michael Herstine + + Merge branch 'master' of github.com:sp1ff/elfeed-score + 2022-02-01 Michael Herstine Fix issue #21. @@ -13,6 +21,16 @@ This commit *also* fixes a few lints and updates the copyright years throughout. +2021-12-30 Michael + + Merge pull request #20 from fclaude/patch-1 + Fix example for setting debug mode + +2021-12-29 Francisco Claude + + Fix example for setting debug mode + The example in the documentation contains a duplicated `-log` in the variable name. + 2021-11-23 Michael Herstine Updating the version post-merge because I accidentally tagged the alpha release. diff --git a/NEWS b/NEWS index b040ddd..01fab98 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,11 @@ elfeed-score News -- history of user-visible changes -*- outline -*- * elfeed-score 1.2 +** changes in elfeed-score 1.2.3 +*** address issue 22 + +'adjust-tags' rules just didn't work due to an embarassing omission on my part. ** changes in elfeed-score 1.2.2 *** update copyright statements diff --git a/README.org b/README.org index d0f7277..642c2d3 100644 --- a/README.org +++ b/README.org @@ -2,7 +2,7 @@ #+DESCRIPTION: Gnus-style scoring for Elfeed #+AUTHOR: Michael Herstine #+EMAIL: sp1ff@pobox.com -#+DATE: <2022-02-01 Tue 17:40> +#+DATE: <2022-04-27 Wed 18:01> #+AUTODATE: t #+OPTIONS: toc:nil org-md-headline-style:setext *:t ^:nil #+STARTUP: overview @@ -73,7 +73,7 @@ The easiest way to install elfeed-score is [[https://github.com/melpa/melpa][MEL If you would prefer to install the package manually, you can also download the Emacs package file on the GitHub releases [[https://github.com/sp1ff/elfeed-score/releases][page]] or from my personal [[https://www.unwoundstack/distros.html][page]]. Then say: #+BEGIN_SRC elisp -(package-install-file "elfeed-score-1.2.2.tar") +(package-install-file "elfeed-score-1.2.3.tar") #+END_SRC ** Autotools Source Distributions @@ -82,8 +82,8 @@ You can also download Autotools source tarballs (again available either on the G #+BEGIN_SRC bash cd /tmp -curl -L --output elfeed-score-1.2.2.tar.gz https://github.com/sp1ff/elfeed-score/releases/download/1.2.2/elfeed-score-1.2.2.tar.gz -tar xvf elfeed-score-1.2.2.tar.gz && cd elfeed-score-1.2.2 +curl -L --output elfeed-score-1.2.3.tar.gz https://github.com/sp1ff/elfeed-score/releases/download/1.2.3/elfeed-score-1.2.3.tar.gz +tar xvf elfeed-score-1.2.3.tar.gz && cd elfeed-score-1.2.3 export EMACSLOADPATH=$HOME/.emacs.d/elpa/elfeed-20200209.1942:$EMACSLOADPATH ./configure make @@ -98,16 +98,16 @@ The unit tests require some macros defined by the [[https://github.com/skeeto/el #+BEGIN_SRC bash cd /tmp git clone https://github.com/skeeto/elfeed.git -curl -L --output=elfeed-score-1.2.2.tar.gz https://github.com/sp1ff/elfeed-score/releases/download/1.2.2/elfeed-score-1.2.2.tar.gz -tar xvf elfeed-score-1.2.2.tar.gz && cd elfeed-score-1.2.2 -export EMACSLOADPATH=/tmp/elfeed-score-1.2.2:/tmp/elfeed:/tmp/elfeed/tests:$EMACSLOADPATH +curl -L --output=elfeed-score-1.2.3.tar.gz https://github.com/sp1ff/elfeed-score/releases/download/1.2.3/elfeed-score-1.2.3.tar.gz +tar xvf elfeed-score-1.2.3.tar.gz && cd elfeed-score-1.2.3 +export EMACSLOADPATH=/tmp/elfeed-score-1.2.3:/tmp/elfeed:/tmp/elfeed/tests:$EMACSLOADPATH ./configure make make check sudo make install #+END_SRC -Again, unless you already use =EMACSLOADPATH=, you'll need to set =EMACSLOADPATH= appropriately to your system, something like =EMACSLOADPATH=/tmp/elfeed-score-1.2.2:/tmp/elfeed:/tmp/elfeed/tests:/usr/share/emacs/25.2/lisp=. +Again, unless you already use =EMACSLOADPATH=, you'll need to set =EMACSLOADPATH= appropriately to your system, something like =EMACSLOADPATH=/tmp/elfeed-score-1.2.3:/tmp/elfeed:/tmp/elfeed/tests:/usr/share/emacs/25.2/lisp=. ** Building From Source Finally, you can of course just clone this repo & build there. I've started a [[https://github.com/sp1ff/elfeed-score/wiki][wiki]], whose intended audience are people looking to hack on elfeed-score, that includes build instructions. diff --git a/configure.ac b/configure.ac index 25eb9f7..58ad730 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.69]) -AC_INIT([elfeed-score], [1.2.2], [sp1ff@pobox.com], [elfeed-score], [https://github.com/sp1ff/elfeed-score]) +AC_INIT([elfeed-score], [1.2.3], [sp1ff@pobox.com], [elfeed-score], [https://github.com/sp1ff/elfeed-score]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([./elfeed-score.el]) AC_PROG_MAKE_SET diff --git a/doc/version.texi b/doc/version.texi index 2b00bf3..18aeeb7 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,4 +1,4 @@ @set UPDATED 2 February 2022 @set UPDATED-MONTH February 2022 -@set EDITION 1.2.2 -@set VERSION 1.2.2 +@set EDITION 1.2.3 +@set VERSION 1.2.3 diff --git a/elfeed-score-pkg.el b/elfeed-score-pkg.el index 7d3c834..dd8b9ed 100644 --- a/elfeed-score-pkg.el +++ b/elfeed-score-pkg.el @@ -1,5 +1,5 @@ (define-package "elfeed-score" - "1.2.2" + "1.2.3" "Gnus-style scoring for Elfeed" '((emacs "26.1") (elfeed "3.3.0"))) diff --git a/elfeed-score-scoring.el b/elfeed-score-scoring.el index 0efda26..cef521d 100644 --- a/elfeed-score-scoring.el +++ b/elfeed-score-scoring.el @@ -606,7 +606,7 @@ On match, ON-MATCH will be called with the matching rule." (let* ((thresh (elfeed-score-adjust-tags-rule-threshold adj-tags)) (threshold-switch (car thresh)) (threshold-value (cdr thresh))) - (if (or (and threshold-switch ) + (if (or (and threshold-switch (>= score threshold-value)) (and (not threshold-switch) (<= score threshold-value))) (let* ((rule-tags (elfeed-score-adjust-tags-rule-tags adj-tags)) (rule-switch (car rule-tags)) diff --git a/elfeed-score.el b/elfeed-score.el index e378bab..7498b41 100644 --- a/elfeed-score.el +++ b/elfeed-score.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2019-2022 Michael Herstine ;; Author: Michael Herstine -;; Version: 1.2.2 +;; Version: 1.2.3 ;; Package-Requires: ((emacs "26.1") (elfeed "3.3.0")) ;; Keywords: news ;; URL: https://github.com/sp1ff/elfeed-score @@ -44,7 +44,7 @@ (require 'elfeed-score-scoring) (require 'elfeed-score-maint) -(defconst elfeed-score-version "1.2.2") +(defconst elfeed-score-version "1.2.3") (defgroup elfeed-score nil "Gnus-style scoring for Elfeed entries." diff --git a/test/test-scoring.el b/test/test-scoring.el index 7855a63..5a22875 100644 --- a/test/test-scoring.el +++ b/test/test-scoring.el @@ -504,18 +504,43 @@ parameter." (stats2 (elfeed-score-rule-stats-get (nth 0 elfeed-score-serde-udf-rules))) (stats3 (elfeed-score-rule-stats-get (nth 1 elfeed-score-serde-udf-rules))) (stats4 (elfeed-score-rule-stats-get (nth 2 elfeed-score-serde-udf-rules)))) - (message "CP1") (should (eq score 3)) - (message "CP2") (should (eq 1 (elfeed-score-rule-stats-hits stats1))) - (message "CP3: %s" stats2) (should (eq 0 (elfeed-score-rule-stats-hits stats2))) - (message "CP4") (should (eq 1 (elfeed-score-rule-udf-stats-errors stats2))) - (message "CP5") (should (eq nil stats3)) ;; never matches, no errors => no stats - (message "CP6") (should (eq 1 (elfeed-score-rule-stats-hits stats4))))))))) +(ert-deftest test-issue-22 () + "Regression test for Github issue #22." + + (let* ((lorem-ipsum "Lorem ipsum dolor sit amet") + (entry-title "foo bar splat")) + (with-elfeed-test + (let* ((feed (elfeed-test-generate-feed)) + (entry (elfeed-score-test-generate-entry + feed entry-title lorem-ipsum))) + (elfeed-db-add entry) + ;; case-insensitive + (with-elfeed-score-test + (let* ((elfeed-score-serde-title-rules + ;; This was a bug where tags meant to be set above a certain score were applied to ALL entries. + ;; So, setup a list with a matching title rule that will give the entry a score of 10. Then + ;; setup two adjust-tags rules: one that should match & one that should not. + (list (elfeed-score-title-rule--create :text "Bar" :value 10 :type 's))) + (elfeed-score-serde-adjust-tags-rules + (list + (elfeed-score-adjust-tags-rule--create :threshold '(t . 10) :tags '(t . (a))) + (elfeed-score-adjust-tags-rule--create :threshold '(t . 11) :tags '(t . (b))))) + (score (elfeed-score-scoring-score-entry entry)) + (tags-stats (elfeed-score-rule-stats-get (car elfeed-score-serde-adjust-tags-rules)))) + ;; Ho-kay. The entry score should be 10... + (should (eq score 10)) + ;; we should have ONE adjust-tags rule hit... + (should (eq 1 (elfeed-score-rule-stats-hits tags-stats))) + (let ((tags (elfeed-entry-tags entry))) + (should (memq 'a tags)) + (should (not (memq 'b tags)))))))))) + (provide 'test-scoring) ;;; test-scoring.el ends here