diff --git a/ChangeLog b/ChangeLog index ec8e7a9..e5090ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-04-28 Michael Herstine + + Fix issue #14. + Embarrasingly, I forgot to update 'elfeed-score-serde-link-rules' + in 'elfeed-score-serde-load-score-file'-- fixed. Thanks to + @jpowellrussell for pointing it out. + 2021-03-02 Michael Herstine Upgrade the score file on initial load. diff --git a/NEWS b/NEWS index d51ed93..7bee994 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,12 @@ elfeed-score News -- history of user-visible changes -*- outline -*- +* Changes in elfeed-score 0.7.8 + +** Bugfixes + +** Address issue 12 + +'link' rules were not being read in correctly--fixed. * Changes in elfeed-score 0.7.7 ** New Features diff --git a/README.org b/README.org index 481ffa0..4d2d935 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: <2021-03-02 Tue 08:24> +#+DATE: <2021-04-28 Wed 18:14> #+AUTODATE: t #+OPTIONS: toc:nil org-md-headline-style:setext *:t ^:nil @@ -17,7 +17,7 @@ [[https://github.com/skeeto/elfeed][Elfeed]] is an extensible web feed reader for Emacs. By default, it will display entries in reverse chronological order. This package defines a bit of metadata for each of your feed entries: a "score". A score is an integer (negative or positive), and higher scores denote entries of greater interest to you. This package also (optionally) installs a new sort function, so that Elfeed will display entries with higher scores before entries with lower scores (entries with the same scores will still be sorted in reverse chronological order). It also provides an entry display function for the elfeed search buffer that displays each entry's score, should you choose to install it. -While you can manually assign a score to an entry, you will likely find it more convenient to create rules for scoring that will be automatically applied to each new entry every time you update Elfeed. You can score against title, feed, content & authors by defining strings that will be matched against those attributes by substring, regexp or whole-word match. You can score against the feed (on the basis of title, URL, or feed author). You can also score against the presence or absence of tags. Rules can be scoped by Elfeed entry tags or by their feed, so that a rule will only be applied to a subset of your entries. Each rule defines an integral value, and the rules are applied in order of definition. The new entry's score begins at zero, and is adjusted by the value defined by each matching scoring rule. +While you can manually assign a score to an entry, you will likely find it more convenient to create rules for scoring that will be automatically applied to each new entry every time you update Elfeed. You can score against title, feed, content, authors & entry link by defining strings that will be matched against those attributes by substring, regexp or whole-word match. You can score against the feed (on the basis of title, URL, or feed author). You can also score against the presence or absence of tags. Rules can be scoped by Elfeed entry tags or by their feed, so that a rule will only be applied to a subset of your entries. Each rule defines an integral value, and the rules are applied in order of definition. The new entry's score begins at zero, and is adjusted by the value defined by each matching scoring rule. For instance, here's a subset of my scoring file at the moment: @@ -71,7 +71,7 @@ The easiest way to install elfeed-score is [[https://github.com/melpa/melpa][MEL 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-0.7.7.tar") +(package-install-file "elfeed-score-0.7.8.tar") #+END_SRC ** Autotools Source Distributions @@ -80,8 +80,8 @@ You can also download Autotools source tarballs (again available either on the G #+BEGIN_SRC bash cd /tmp -curl -L --output elfeed-score-0.7.7.tar.gz https://github.com/sp1ff/elfeed-score/releases/download/0.7.7/elfeed-score-0.7.7.tar.gz -tar xvf elfeed-score-0.7.7.tar.gz && cd elfeed-score-0.7.7 +curl -L --output elfeed-score-0.7.8.tar.gz https://github.com/sp1ff/elfeed-score/releases/download/0.7.8/elfeed-score-0.7.8.tar.gz +tar xvf elfeed-score-0.7.8.tar.gz && cd elfeed-score-0.7.8 export EMACSLOADPATH=$HOME/.emacs.d/elpa/elfeed-20200209.1942:$EMACSLOADPATH ./configure make @@ -96,16 +96,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-0.7.7.tar.gz https://github.com/sp1ff/elfeed-score/releases/download/0.7.7/elfeed-score-0.7.7.tar.gz -tar xvf elfeed-score-0.7.7.tar.gz && cd elfeed-score-0.7.7 -export EMACSLOADPATH=/tmp/elfeed-score-0.7.7:/tmp/elfeed:/tmp/elfeed/tests:$EMACSLOADPATH +curl -L --output=elfeed-score-0.7.8.tar.gz https://github.com/sp1ff/elfeed-score/releases/download/0.7.8/elfeed-score-0.7.8.tar.gz +tar xvf elfeed-score-0.7.8.tar.gz && cd elfeed-score-0.7.8 +export EMACSLOADPATH=/tmp/elfeed-score-0.7.8:/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-0.7.7:/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-0.7.8:/tmp/elfeed:/tmp/elfeed/tests:/usr/share/emacs/25.2/lisp=. ** Building From Source diff --git a/configure.ac b/configure.ac index d59b50a..3a931d7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,8 @@ -AC_INIT([elfeed-score], [0.7.7], [sp1ff@pobox.com], [elfeed-score], [https://github.com/sp1ff/elfeed-score]) +AC_PREREQ([2.69]) +AC_INIT([elfeed-score], [0.7.8], [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 AM_INIT_AUTOMAKE([-Wall -Werror gnits std-options dist-bzip2 dist-xz]) diff --git a/doc/version.texi b/doc/version.texi index ba4955f..3bae2dd 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,4 +1,4 @@ @set UPDATED 2 March 2021 @set UPDATED-MONTH March 2021 -@set EDITION 0.7.7 -@set VERSION 0.7.7 +@set EDITION 0.7.8 +@set VERSION 0.7.8 diff --git a/elfeed-score-pkg.el b/elfeed-score-pkg.el index f9dbcff..f2ccf44 100644 --- a/elfeed-score-pkg.el +++ b/elfeed-score-pkg.el @@ -1,5 +1,5 @@ (define-package "elfeed-score" - "0.7.7" + "0.7.8" "Gnus-style scoring for Elfeed" '((emacs "26.1") (elfeed "3.3.0"))) diff --git a/elfeed-score-serde.el b/elfeed-score-serde.el index 604b5c3..de1c28c 100644 --- a/elfeed-score-serde.el +++ b/elfeed-score-serde.el @@ -859,6 +859,7 @@ Read SCORE-FILE, store scoring rules into elfeed-score-serde-title-or-content-rules (plist-get score-entries :title-or-content) elfeed-score-serde-tag-rules (plist-get score-entries :tag) elfeed-score-serde-authors-rules (plist-get score-entries :authors) + elfeed-score-serde-link-rules (plist-get score-entries :link) elfeed-score-serde-score-mark (plist-get score-entries :mark) elfeed-score-serde-adjust-tags-rules (plist-get score-entries :adjust-tags)) ;; If this is an upgrade in file format; re-write the score file in the new diff --git a/elfeed-score.el b/elfeed-score.el index e727369..270447e 100644 --- a/elfeed-score.el +++ b/elfeed-score.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2019-2021 Michael Herstine ;; Author: Michael Herstine -;; Version: 0.7.7 +;; Version: 0.7.8 ;; Package-Requires: ((emacs "26.1") (elfeed "3.3.0")) ;; Keywords: news ;; URL: https://github.com/sp1ff/elfeed-score @@ -43,7 +43,7 @@ (require 'elfeed-score-scoring) (require 'elfeed-score-maint) -(defconst elfeed-score-version "0.7.7") +(defconst elfeed-score-version "0.7.8") (defgroup elfeed-score nil "Gnus-style scoring for Elfeed entries." diff --git a/test/test-serde b/test/test-serde index dbc4c5d..ef69f8c 100755 --- a/test/test-serde +++ b/test/test-serde @@ -1,3 +1,3 @@ #!/bin/bash EMACS=${EMACS:-emacs} -${EMACS} -batch -L ${srcdir}/.. -l ${srcdir}/test-serde.el --eval '(let ((ert-batch-backtrace-right-margin 120)) (ert-run-tests-batch-and-exit t))' +${EMACS} -batch -L . -L ${srcdir}/.. -l ${srcdir}/test-serde.el --eval '(let ((ert-batch-backtrace-right-margin 120)) (ert-run-tests-batch-and-exit t))' diff --git a/test/test-serde.el b/test/test-serde.el index ea29f0b..54da4c7 100644 --- a/test/test-serde.el +++ b/test/test-serde.el @@ -27,6 +27,7 @@ (require 'elfeed-lib) (require 'elfeed-score) (require 'elfeed-db-tests) +(require 'elfeed-score-tests) (ert-deftest score-files-smoke-test () "Smoke test reading/writing score files. @@ -486,5 +487,18 @@ cf. `test-issue-12'." (eq elfeed-score-serde-current-format (plist-get (elfeed-score-serde--parse-score-file score-file) :version))))) +(ert-deftest test-issue-14 () + "Test my fix to issue #14 (and that there is no regression)." + (let* ((score-entries + '((version 7) + ("link" + (:text "reddit" :value 30 :type s) + (:text "twitter" :value 30 :type s)))) + (score-text (pp-to-string score-entries)) + (score-file (make-temp-file "elfeed-score-test-" nil nil score-text))) + (with-elfeed-score-test + (elfeed-score-serde-load-score-file score-file) + (should elfeed-score-serde-link-rules)))) + (provide 'test-serde) ;;; test-serde.el ends here