From bdc448d12618b9d2198a1f0dc3474cd719927b79 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 31 Oct 2019 15:03:53 +0100 Subject: [PATCH] update elfeed --- bba.org | 2 +- elpa/elfeed-20181127.1943/elfeed-autoloads.el | 141 --------------- elpa/elfeed-20190903.1137/elfeed-autoloads.el | 88 ++++++++++ .../elfeed-csv.el | 0 .../elfeed-curl.el | 2 + .../elfeed-db.el | 0 .../elfeed-lib.el | 52 ++++-- .../elfeed-link.el | 0 .../elfeed-log.el | 0 .../elfeed-pkg.el | 2 +- .../elfeed-search.el | 99 ++++++++--- .../elfeed-show.el | 160 +++++++++++------- .../elfeed.el | 65 +++++-- .../xml-query.el | 0 14 files changed, 347 insertions(+), 264 deletions(-) delete mode 100644 elpa/elfeed-20181127.1943/elfeed-autoloads.el create mode 100644 elpa/elfeed-20190903.1137/elfeed-autoloads.el rename elpa/{elfeed-20181127.1943 => elfeed-20190903.1137}/elfeed-csv.el (100%) rename elpa/{elfeed-20181127.1943 => elfeed-20190903.1137}/elfeed-curl.el (99%) rename elpa/{elfeed-20181127.1943 => elfeed-20190903.1137}/elfeed-db.el (100%) rename elpa/{elfeed-20181127.1943 => elfeed-20190903.1137}/elfeed-lib.el (88%) rename elpa/{elfeed-20181127.1943 => elfeed-20190903.1137}/elfeed-link.el (100%) rename elpa/{elfeed-20181127.1943 => elfeed-20190903.1137}/elfeed-log.el (100%) rename elpa/{elfeed-20181127.1943 => elfeed-20190903.1137}/elfeed-pkg.el (55%) rename elpa/{elfeed-20181127.1943 => elfeed-20190903.1137}/elfeed-search.el (91%) rename elpa/{elfeed-20181127.1943 => elfeed-20190903.1137}/elfeed-show.el (76%) rename elpa/{elfeed-20181127.1943 => elfeed-20190903.1137}/elfeed.el (92%) rename elpa/{elfeed-20181127.1943 => elfeed-20190903.1137}/xml-query.el (100%) diff --git a/bba.org b/bba.org index d2a2efe8..3c41540d 100644 --- a/bba.org +++ b/bba.org @@ -2409,7 +2409,7 @@ necessary. #+BEGIN_SRC emacs-lisp :tangle yes (if (>= emacs-major-version 24) (progn - (add-to-list 'load-path "~/.emacs.d/elpa/elfeed-20181127.1943") + (add-to-list 'load-path "~/.emacs.d/elpa/elfeed-20190903.1137") (add-to-list 'load-path "~/.emacs.d/elpa/elfeed-org-20181015.1100") (require 'elfeed-org) (elfeed-org) diff --git a/elpa/elfeed-20181127.1943/elfeed-autoloads.el b/elpa/elfeed-20181127.1943/elfeed-autoloads.el deleted file mode 100644 index 24f4e004..00000000 --- a/elpa/elfeed-20181127.1943/elfeed-autoloads.el +++ /dev/null @@ -1,141 +0,0 @@ -;;; elfeed-autoloads.el --- automatically extracted autoloads -;; -;;; Code: - -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) - - -;;;### (autoloads nil "elfeed" "elfeed.el" (0 0 0 0)) -;;; Generated autoloads from elfeed.el - -(autoload 'elfeed-update "elfeed" "\ -Update all the feeds in `elfeed-feeds'. - -\(fn)" t nil) - -(autoload 'elfeed "elfeed" "\ -Enter elfeed. - -\(fn)" t nil) - -(autoload 'elfeed-load-opml "elfeed" "\ -Load feeds from an OPML file into `elfeed-feeds'. -When called interactively, the changes to `elfeed-feeds' are -saved to your customization file. - -\(fn FILE)" t nil) - -(autoload 'elfeed-export-opml "elfeed" "\ -Export the current feed listing to OPML-formatted FILE. - -\(fn FILE)" t nil) - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed" '("elfeed-"))) - -;;;*** - -;;;### (autoloads nil "elfeed-csv" "elfeed-csv.el" (0 0 0 0)) -;;; Generated autoloads from elfeed-csv.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-csv" '("elfeed-csv-"))) - -;;;*** - -;;;### (autoloads nil "elfeed-curl" "elfeed-curl.el" (0 0 0 0)) -;;; Generated autoloads from elfeed-curl.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-curl" '("elfeed-curl-"))) - -;;;*** - -;;;### (autoloads nil "elfeed-db" "elfeed-db.el" (0 0 0 0)) -;;; Generated autoloads from elfeed-db.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-db" '("elfeed-" "with-elfeed-db-visit"))) - -;;;*** - -;;;### (autoloads nil "elfeed-lib" "elfeed-lib.el" (0 0 0 0)) -;;; Generated autoloads from elfeed-lib.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-lib" '("elfeed-"))) - -;;;*** - -;;;### (autoloads nil "elfeed-link" "elfeed-link.el" (0 0 0 0)) -;;; Generated autoloads from elfeed-link.el - -(autoload 'elfeed-link-store-link "elfeed-link" "\ -Store a link to an elfeed search or entry buffer. - -When storing a link to an entry, automatically extract all the -entry metadata. These can be used in the capture templates as -%:elfeed-entry-. See `elfeed-entry--create' for the list -of available props. - -\(fn)" nil nil) - -(autoload 'elfeed-link-open "elfeed-link" "\ -Jump to an elfeed entry or search. - -Depending on what FILTER-OR-ID looks like, we jump to either -search buffer or show a concrete entry. - -\(fn FILTER-OR-ID)" nil nil) - -(eval-after-load 'org `(funcall ',(lambda nil (if (version< (org-version) "9.0") (with-no-warnings (org-add-link-type "elfeed" #'elfeed-link-open) (add-hook 'org-store-link-functions #'elfeed-link-store-link)) (with-no-warnings (org-link-set-parameters "elfeed" :follow #'elfeed-link-open :store #'elfeed-link-store-link)))))) - -;;;*** - -;;;### (autoloads nil "elfeed-log" "elfeed-log.el" (0 0 0 0)) -;;; Generated autoloads from elfeed-log.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-log" '("elfeed-log"))) - -;;;*** - -;;;### (autoloads nil "elfeed-search" "elfeed-search.el" (0 0 0 0)) -;;; Generated autoloads from elfeed-search.el - -(autoload 'elfeed-search-bookmark-handler "elfeed-search" "\ -Jump to an elfeed-search bookmarked location. - -\(fn RECORD)" nil nil) - -(autoload 'elfeed-search-desktop-restore "elfeed-search" "\ -Restore the state of an elfeed-search buffer on desktop restore. - -\(fn FILE-NAME BUFFER-NAME SEARCH-FILTER)" nil nil) - -(add-to-list 'desktop-buffer-mode-handlers '(elfeed-search-mode . elfeed-search-desktop-restore)) - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-search" '("elfeed-s"))) - -;;;*** - -;;;### (autoloads nil "elfeed-show" "elfeed-show.el" (0 0 0 0)) -;;; Generated autoloads from elfeed-show.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "elfeed-show" '("elfeed-"))) - -;;;*** - -;;;### (autoloads nil "xml-query" "xml-query.el" (0 0 0 0)) -;;; Generated autoloads from xml-query.el - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "xml-query" '("xml-query"))) - -;;;*** - -;;;### (autoloads nil nil ("elfeed-pkg.el") (0 0 0 0)) - -;;;*** - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; coding: utf-8 -;; End: -;;; elfeed-autoloads.el ends here diff --git a/elpa/elfeed-20190903.1137/elfeed-autoloads.el b/elpa/elfeed-20190903.1137/elfeed-autoloads.el new file mode 100644 index 00000000..2ff865f6 --- /dev/null +++ b/elpa/elfeed-20190903.1137/elfeed-autoloads.el @@ -0,0 +1,88 @@ +;;; elfeed-autoloads.el --- automatically extracted autoloads +;; +;;; Code: +(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +;;;### (autoloads nil "elfeed" "elfeed.el" (23994 46772 779889 431000)) +;;; Generated autoloads from elfeed.el + +(autoload 'elfeed-update "elfeed" "\ +Update all the feeds in `elfeed-feeds'. + +\(fn)" t nil) + +(autoload 'elfeed "elfeed" "\ +Enter elfeed. + +\(fn)" t nil) + +(autoload 'elfeed-load-opml "elfeed" "\ +Load feeds from an OPML file into `elfeed-feeds'. +When called interactively, the changes to `elfeed-feeds' are +saved to your customization file. + +\(fn FILE)" t nil) + +(autoload 'elfeed-export-opml "elfeed" "\ +Export the current feed listing to OPML-formatted FILE. + +\(fn FILE)" t nil) + +;;;*** + +;;;### (autoloads nil "elfeed-link" "elfeed-link.el" (23994 46772 +;;;;;; 776361 167000)) +;;; Generated autoloads from elfeed-link.el + +(autoload 'elfeed-link-store-link "elfeed-link" "\ +Store a link to an elfeed search or entry buffer. + +When storing a link to an entry, automatically extract all the +entry metadata. These can be used in the capture templates as +%:elfeed-entry-. See `elfeed-entry--create' for the list +of available props. + +\(fn)" nil nil) + +(autoload 'elfeed-link-open "elfeed-link" "\ +Jump to an elfeed entry or search. + +Depending on what FILTER-OR-ID looks like, we jump to either +search buffer or show a concrete entry. + +\(fn FILTER-OR-ID)" nil nil) + +(eval-after-load 'org `(funcall ',(lambda nil (if (version< (org-version) "9.0") (with-no-warnings (org-add-link-type "elfeed" #'elfeed-link-open) (add-hook 'org-store-link-functions #'elfeed-link-store-link)) (with-no-warnings (org-link-set-parameters "elfeed" :follow #'elfeed-link-open :store #'elfeed-link-store-link)))))) + +;;;*** + +;;;### (autoloads nil "elfeed-search" "elfeed-search.el" (23994 46772 +;;;;;; 775272 903000)) +;;; Generated autoloads from elfeed-search.el + +(autoload 'elfeed-search-bookmark-handler "elfeed-search" "\ +Jump to an elfeed-search bookmarked location. + +\(fn RECORD)" nil nil) + +(autoload 'elfeed-search-desktop-restore "elfeed-search" "\ +Restore the state of an elfeed-search buffer on desktop restore. + +\(fn FILE-NAME BUFFER-NAME SEARCH-FILTER)" nil nil) + +(add-to-list 'desktop-buffer-mode-handlers '(elfeed-search-mode . elfeed-search-desktop-restore)) + +;;;*** + +;;;### (autoloads nil nil ("elfeed-csv.el" "elfeed-curl.el" "elfeed-db.el" +;;;;;; "elfeed-lib.el" "elfeed-log.el" "elfeed-pkg.el" "elfeed-show.el" +;;;;;; "xml-query.el") (23994 46772 783267 598000)) + +;;;*** + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: +;;; elfeed-autoloads.el ends here diff --git a/elpa/elfeed-20181127.1943/elfeed-csv.el b/elpa/elfeed-20190903.1137/elfeed-csv.el similarity index 100% rename from elpa/elfeed-20181127.1943/elfeed-csv.el rename to elpa/elfeed-20190903.1137/elfeed-csv.el diff --git a/elpa/elfeed-20181127.1943/elfeed-curl.el b/elpa/elfeed-20190903.1137/elfeed-curl.el similarity index 99% rename from elpa/elfeed-20181127.1943/elfeed-curl.el rename to elpa/elfeed-20190903.1137/elfeed-curl.el index 627c41fb..9e3308d8 100644 --- a/elpa/elfeed-20181127.1943/elfeed-curl.el +++ b/elpa/elfeed-20190903.1137/elfeed-curl.el @@ -110,6 +110,7 @@ output format." (13 . "FTP weird PASV reply.") (14 . "FTP weird 227 format.") (15 . "FTP can't get host.") + (16 . "A problem was detected in the HTTP2 framing layer.") (17 . "FTP couldn't set binary.") (18 . "Partial file. Only a part of the file was transferred.") (19 . "FTP couldn't download/access the given file, the RETR (or similar) command failed.") @@ -287,6 +288,7 @@ Use `elfeed-curl--narrow' to select a header." URL can be a string or a list of URL strings." (let* ((args ()) (capabilities (elfeed-curl-get-capabilities))) + (push "--disable" args) (when (plist-get capabilities :compression) (push "--compressed" args)) (push "--silent" args) diff --git a/elpa/elfeed-20181127.1943/elfeed-db.el b/elpa/elfeed-20190903.1137/elfeed-db.el similarity index 100% rename from elpa/elfeed-20181127.1943/elfeed-db.el rename to elpa/elfeed-20190903.1137/elfeed-db.el diff --git a/elpa/elfeed-20181127.1943/elfeed-lib.el b/elpa/elfeed-20190903.1137/elfeed-lib.el similarity index 88% rename from elpa/elfeed-20181127.1943/elfeed-lib.el rename to elpa/elfeed-20190903.1137/elfeed-lib.el index b4941467..5168a390 100644 --- a/elpa/elfeed-20181127.1943/elfeed-lib.el +++ b/elpa/elfeed-20190903.1137/elfeed-lib.el @@ -36,14 +36,21 @@ (end-of-line) (delete-region start (point)))) -(defun elfeed-time-duration (time) +(defun elfeed-time-duration (time &optional now) "Turn a time expression into a number of seconds. Uses -`timer-duration' but allows a bit more flair." - (if (numberp time) - time - (when (string-match-p "[[:alpha:]]" time) - (let ((clean (replace-regexp-in-string "\\(ago\\|old\\|-\\)" " " time))) - (timer-duration clean))))) +`timer-duration' but allows a bit more flair. + +If `now' is non-nil, use it as the current time (`float-time'). This +is mostly useful for testing." + (cond + ((numberp time) time) + ((let ((iso-time (elfeed-parse-simple-iso-8601 time))) + (when iso-time (- (or now (float-time)) iso-time)))) + ((string-match-p "[[:alpha:]]" time) + (let* ((clean (replace-regexp-in-string "\\(ago\\|old\\|-\\)" " " time)) + (duration (timer-duration clean))) + ;; convert to float since float-time is used elsewhere + (when duration (float duration)))))) (defun elfeed-looks-like-url-p (string) "Return true if STRING looks like it could be a URL." @@ -71,21 +78,29 @@ Align should be a keyword :left or :right." (defun elfeed-cleanup (name) "Trim trailing and leading spaces and collapse multiple spaces." - (let ((trim (replace-regexp-in-string "[\n\t]+" " " (or name "")))) + (let ((trim (replace-regexp-in-string "[\f\n\r\t\v ]+" " " (or name "")))) (replace-regexp-in-string "^ +\\| +$" "" trim))) (defun elfeed-parse-simple-iso-8601 (string) "Attempt to parse STRING as a simply formatted ISO 8601 date. Examples: 2015-02-22, 2015-02, 20150222" - (save-match-data - (let ((re "^\\([0-9]\\{4\\}\\)-?\\([0-9]\\{2\\}\\)-?\\([0-9]\\{2\\}\\)?$") - (clean (elfeed-cleanup string))) - (when (string-match re clean) - (let ((year (string-to-number (match-string 1 clean))) - (month (string-to-number (match-string 2 clean))) - (day (string-to-number (or (match-string 3 clean) "1")))) - (when (and (>= year 1900) (< year 2200)) - (float-time (encode-time 0 0 0 day month year t)))))))) + (let* ((re (cl-flet ((re-numbers (num) (format "\\([0-9]\\{%s\\}\\)" num))) + (format "^%s-?%s-?%s?\\(T%s:%s:?%s?\\)?" + (re-numbers 4) + (re-numbers 2) + (re-numbers 2) + (re-numbers 2) + (re-numbers 2) + (re-numbers 2)))) + (matches (save-match-data + (when (string-match re string) + (cl-loop for i from 1 to 7 + collect (let ((match (match-string i string))) + (and match (string-to-number match)))))))) + (when matches + (cl-multiple-value-bind (year month day _ hour min sec) matches + (float-time (encode-time (or sec 0) (or min 0) (or hour 0) + (or day 1) month year t)))))) (defun elfeed-new-date-for-entry (old-date new-date) "Decide entry date, given an existing date (nil for new) and a new date. @@ -242,7 +257,8 @@ systems." (funcall interprogram-paste-function)) (and (fboundp 'w32-get-clipboard-data) (funcall 'w32-get-clipboard-data)) - (current-kill 0 :non-destructively)))) + (ignore-errors + (current-kill 0 :non-destructively))))) (defun elfeed-get-link-at-point () "Try to a link at point and return its URL." diff --git a/elpa/elfeed-20181127.1943/elfeed-link.el b/elpa/elfeed-20190903.1137/elfeed-link.el similarity index 100% rename from elpa/elfeed-20181127.1943/elfeed-link.el rename to elpa/elfeed-20190903.1137/elfeed-link.el diff --git a/elpa/elfeed-20181127.1943/elfeed-log.el b/elpa/elfeed-20190903.1137/elfeed-log.el similarity index 100% rename from elpa/elfeed-20181127.1943/elfeed-log.el rename to elpa/elfeed-20190903.1137/elfeed-log.el diff --git a/elpa/elfeed-20181127.1943/elfeed-pkg.el b/elpa/elfeed-20190903.1137/elfeed-pkg.el similarity index 55% rename from elpa/elfeed-20181127.1943/elfeed-pkg.el rename to elpa/elfeed-20190903.1137/elfeed-pkg.el index d6d11c96..d192f366 100644 --- a/elpa/elfeed-20181127.1943/elfeed-pkg.el +++ b/elpa/elfeed-20190903.1137/elfeed-pkg.el @@ -1,4 +1,4 @@ -(define-package "elfeed" "20181127.1943" "an Emacs Atom/RSS feed reader" +(define-package "elfeed" "20190903.1137" "an Emacs Atom/RSS feed reader" '((emacs "24.3"))) ;; Local Variables: ;; no-byte-compile: t diff --git a/elpa/elfeed-20181127.1943/elfeed-search.el b/elpa/elfeed-20190903.1137/elfeed-search.el similarity index 91% rename from elpa/elfeed-20181127.1943/elfeed-search.el rename to elpa/elfeed-20190903.1137/elfeed-search.el index 5f903b8a..2731a225 100644 --- a/elpa/elfeed-20181127.1943/elfeed-search.el +++ b/elpa/elfeed-20190903.1137/elfeed-search.el @@ -107,24 +107,39 @@ When live editing the filter, it is bound to :live.") (elfeed-db-save) (quit-window)) +(defun elfeed-search-last-entry () + "Place point on first entry." + (interactive) + (setf (point) (point-max)) + (forward-line -2)) + +(defun elfeed-search-first-entry () + "Place point on last entry." + (interactive) + (setf (point) (point-min))) + (defvar elfeed-search-mode-map (let ((map (make-sparse-keymap))) (prog1 map (suppress-keymap map) - (define-key map "q" 'elfeed-search-quit-window) - (define-key map "g" 'elfeed-search-update--force) - (define-key map "G" 'elfeed-search-fetch) - (define-key map (kbd "RET") 'elfeed-search-show-entry) - (define-key map "s" 'elfeed-search-live-filter) - (define-key map "S" 'elfeed-search-set-filter) - (define-key map "b" 'elfeed-search-browse-url) - (define-key map "y" 'elfeed-search-yank) - (define-key map "u" 'elfeed-search-tag-all-unread) - (define-key map "r" 'elfeed-search-untag-all-unread) - (define-key map "n" 'next-line) - (define-key map "p" 'previous-line) - (define-key map "+" 'elfeed-search-tag-all) - (define-key map "-" 'elfeed-search-untag-all))) + (define-key map "h" #'describe-mode) + (define-key map "q" #'elfeed-search-quit-window) + (define-key map "g" #'elfeed-search-update--force) + (define-key map "G" #'elfeed-search-fetch) + (define-key map (kbd "RET") #'elfeed-search-show-entry) + (define-key map "s" #'elfeed-search-live-filter) + (define-key map "S" #'elfeed-search-set-filter) + (define-key map "c" #'elfeed-search-clear-filter) + (define-key map "b" #'elfeed-search-browse-url) + (define-key map "y" #'elfeed-search-yank) + (define-key map "u" #'elfeed-search-tag-all-unread) + (define-key map "r" #'elfeed-search-untag-all-unread) + (define-key map "n" #'next-line) + (define-key map "p" #'previous-line) + (define-key map "+" #'elfeed-search-tag-all) + (define-key map "-" #'elfeed-search-untag-all) + (define-key map "<" #'elfeed-search-first-entry) + (define-key map ">" #'elfeed-search-last-entry))) "Keymap for elfeed-search-mode.") (defun elfeed-search--intro-header () @@ -352,6 +367,7 @@ The customization `elfeed-search-date-format' sets the formatting." "Parse the elements of a search filter into a plist." (let ((must-have ()) (must-not-have ()) + (before nil) (after nil) (matches ()) (not-matches ()) @@ -368,16 +384,26 @@ The customization `elfeed-search-date-format' sets the formatting." (let ((symbol (intern (substring element 1)))) (unless (eq '## symbol) (push symbol must-not-have)))) - (?@ (setf after (elfeed-time-duration (substring element 1)))) + (?@ (cl-multiple-value-bind (a b) + (split-string (substring element 1) "--") + (let ((duration-a (elfeed-time-duration a)) + (duration-b (and b (elfeed-time-duration b)))) + (when (and duration-b (> duration-b duration-a)) + (cl-rotatef duration-a duration-b)) + (when duration-b (setf before duration-b)) + (setf after duration-a)))) (?! (let ((re (substring element 1))) (when (elfeed-valid-regexp-p re) (push re not-matches)))) (?# (setf limit (string-to-number (substring element 1)))) - (?= (let ((url (substring element 1))) - (push url feeds))) + (?= (let ((re (substring element 1))) + (when (elfeed-valid-regexp-p re) + (push re feeds)))) (otherwise (when (elfeed-valid-regexp-p element) (push element matches))))) - `(,@(when after + `(,@(when before + (list :before before)) + ,@(when after (list :after after)) ,@(when must-have (list :must-have must-have)) @@ -392,7 +418,7 @@ The customization `elfeed-search-date-format' sets the formatting." ,@(when feeds (list :feeds feeds))))) -(defun elfeed-search--recover-units (seconds) +(defun elfeed-search--recover-time (seconds) "Pick a reasonable filter representation for SECONDS." (let ((units '((60 1 "minute") (60 1 "hour") @@ -409,7 +435,15 @@ The customization `elfeed-search-date-format' sets the formatting." do (setf name unit value next-value)) (let ((count (format "%.4g" value))) - (format "@%s-%s%s-ago" count name (if (equal count "1") "" "s"))))) + (format "%s-%s%s-ago" count name (if (equal count "1") "" "s"))))) + +(defun elfeed-search--recover-units (after-seconds &optional before-seconds) + "Stringify the age or optionally the date range specified by +AFTER-SECONDS and BEFORE-SECONDS." + (apply 'concat "@" + (elfeed-search--recover-time after-seconds) + (when before-seconds + (list "--"(elfeed-search--recover-time before-seconds))))) (defun elfeed-search-unparse-filter (filter) "Inverse of `elfeed-search-parse-filter', returning a string. @@ -418,6 +452,7 @@ The time (@n-units-ago) filter may not exactly match the original, but will be equal in its effect." (let ((output ())) (let ((after (plist-get filter :after)) + (before (plist-get filter :before)) (must-have (plist-get filter :must-have)) (must-not-have (plist-get filter :must-not-have)) (matches (plist-get filter :matches)) @@ -425,7 +460,7 @@ original, but will be equal in its effect." (limit (plist-get filter :limit)) (feeds (plist-get filter :feeds))) (when after - (push (elfeed-search--recover-units after) output)) + (push (elfeed-search--recover-units after before) output)) (dolist (tag must-have) (push (format "+%S" tag) output)) (dolist (tag must-not-have) @@ -492,6 +527,7 @@ This function must *only* be called within the body of Executing a filter in bytecode form is generally faster than \"interpreting\" the filter with `elfeed-search-filter'." (let ((after (plist-get filter :after)) + (before (plist-get filter :before)) (must-have (plist-get filter :must-have)) (must-not-have (plist-get filter :must-not-have)) (matches (plist-get filter :matches)) @@ -541,7 +577,9 @@ Executing a filter in bytecode form is generally faster than `((or ,@(cl-loop for regex in feeds collect `(string-match-p ,regex feed-id) - collect `(string-match-p ,regex feed-title)))))))))) + collect `(string-match-p ,regex feed-title))))) + ,@(when before + `((> age ,before)))))))) (defun elfeed-search--prompt (current) "Prompt for a new filter, starting with CURRENT." @@ -553,6 +591,12 @@ Executing a filter in bytecode form is generally faster than (concat current " ")) nil nil 'elfeed-search-filter-history)) +(defun elfeed-search-clear-filter () + "Reset the search filter to the default value of `elfeed-search-filter'." + (interactive) + (setf elfeed-search-filter (default-value 'elfeed-search-filter)) + (elfeed-search-update--force)) + (defun elfeed-search-set-filter (new-filter) "Set a new search filter for the elfeed-search buffer. @@ -565,8 +609,15 @@ Any component beginning with a + or - is treated as a tag. If + the tag must be present on the entry. If - the tag must *not* be present on the entry. Ex. \"+unread\" or \"+unread -comic\". -Any component beginning with an @ is an age limit. No posts older -than this are allowed. Ex. \"@3-days-ago\" or \"@1-year-old\". +Any component beginning with an @ is an age limit or an age +range. If a limit, no posts older than this are allowed. If a +range, posts dates have to be inbetween the specified date +range. Examples: +- \"@3-days-ago\" +- \"@1-year-old\" +- \"@2019-06-24\" +- \"@2019-06-24--2019-06-24\" +- \"@5-days-ago--1-day-ago\" Any component beginning with a # is an entry count maximum. The number following # determines the maxiumum number of entries diff --git a/elpa/elfeed-20181127.1943/elfeed-show.el b/elpa/elfeed-20190903.1137/elfeed-show.el similarity index 76% rename from elpa/elfeed-20181127.1943/elfeed-show.el rename to elpa/elfeed-20190903.1137/elfeed-show.el index 2b8f9c95..d3893f85 100644 --- a/elpa/elfeed-20181127.1943/elfeed-show.el +++ b/elpa/elfeed-20190903.1137/elfeed-show.el @@ -45,26 +45,28 @@ Defaults to `elfeed-kill-buffer'.") (let ((map (make-sparse-keymap))) (prog1 map (suppress-keymap map) - (define-key map "d" 'elfeed-show-save-enclosure) - (define-key map "q" 'elfeed-kill-buffer) - (define-key map "g" 'elfeed-show-refresh) - (define-key map "n" 'elfeed-show-next) - (define-key map "p" 'elfeed-show-prev) - (define-key map "s" 'elfeed-show-new-live-search) - (define-key map "b" 'elfeed-show-visit) - (define-key map "y" 'elfeed-show-yank) - (define-key map "u" (elfeed-expose #'elfeed-show-tag 'unread)) - (define-key map "+" 'elfeed-show-tag) - (define-key map "-" 'elfeed-show-untag) - (define-key map (kbd "SPC") 'scroll-up-command) - (define-key map (kbd "DEL") 'scroll-down-command) - (define-key map "\t" 'shr-next-link) - (define-key map [tab] 'shr-next-link) - (define-key map "\e\t" 'shr-previous-link) - (define-key map [backtab] 'shr-previous-link) - (define-key map [mouse-2] 'shr-browse-url) - (define-key map "A" 'elfeed-show-add-enclosure-to-playlist) - (define-key map "P" 'elfeed-show-play-enclosure))) + (define-key map "h" #'describe-mode) + (define-key map "d" #'elfeed-show-save-enclosure) + (define-key map "q" #'elfeed-kill-buffer) + (define-key map "g" #'elfeed-show-refresh) + (define-key map "n" #'elfeed-show-next) + (define-key map "p" #'elfeed-show-prev) + (define-key map "s" #'elfeed-show-new-live-search) + (define-key map "b" #'elfeed-show-visit) + (define-key map "y" #'elfeed-show-yank) + (define-key map "u" #'elfeed-show-tag--unread) + (define-key map "+" #'elfeed-show-tag) + (define-key map "-" #'elfeed-show-untag) + (define-key map "<" #'beginning-of-buffer) + (define-key map ">" #'end-of-buffer) + (define-key map (kbd "SPC") #'scroll-up-command) + (define-key map (kbd "DEL") #'scroll-down-command) + (define-key map (kbd "TAB") #'elfeed-show-next-link) + (define-key map "\e\t" #'shr-previous-link) + (define-key map [backtab] #'shr-previous-link) + (define-key map [mouse-2] #'shr-browse-url) + (define-key map "A" #'elfeed-show-add-enclosure-to-playlist) + (define-key map "P" #'elfeed-show-play-enclosure))) "Keymap for `elfeed-show-mode'.") (defun elfeed-show-mode () @@ -80,6 +82,10 @@ Defaults to `elfeed-kill-buffer'.") (make-local-variable 'elfeed-show-entry) (run-mode-hooks 'elfeed-show-mode-hook)) +(defalias 'elfeed-show-tag--unread + (elfeed-expose #'elfeed-show-tag 'unread) + "Mark the current entry unread.") + (defun elfeed-insert-html (html &optional base-url) "Converted HTML markup to a propertized string." (shr-insert-document @@ -110,13 +116,29 @@ Defaults to `elfeed-kill-buffer'.") (setf (url-target obj) nil) (url-recreate-url obj))) +(defun elfeed--show-format-author (author) + "Format author plist for the header." + (let ((name (plist-get author :name)) + (uri (plist-get author :uri)) + (email (plist-get author :email))) + (cond ((and name uri email) + (format "%s <%s> (%s)" name email uri)) + ((and name email) + (format "%s <%s>" name email)) + ((and name uri) + (format "%s (%s)" name uri)) + (name name) + (email email) + (uri uri) + ("[unknown]")))) + (defun elfeed-show-refresh--mail-style () "Update the buffer to match the selected entry, using a mail-style." (interactive) (let* ((inhibit-read-only t) (title (elfeed-entry-title elfeed-show-entry)) (date (seconds-to-time (elfeed-entry-date elfeed-show-entry))) - (author (elfeed-meta elfeed-show-entry :author)) + (authors (elfeed-meta elfeed-show-entry :authors)) (link (elfeed-entry-link elfeed-show-entry)) (tags (elfeed-entry-tags elfeed-show-entry)) (tagsstr (mapconcat #'symbol-name tags ", ")) @@ -129,9 +151,12 @@ Defaults to `elfeed-kill-buffer'.") (erase-buffer) (insert (format (propertize "Title: %s\n" 'face 'message-header-name) (propertize title 'face 'message-header-subject))) - (when (and author elfeed-show-entry-author) - (insert (format (propertize "Author: %s\n" 'face 'message-header-name) - (propertize author 'face 'message-header-to))) ) + (when elfeed-show-entry-author + (dolist (author authors) + (let ((formatted (elfeed--show-format-author author))) + (insert + (format (propertize "Author: %s\n" 'face 'message-header-name) + (propertize formatted 'face 'message-header-to)))))) (insert (format (propertize "Date: %s\n" 'face 'message-header-name) (propertize nicedate 'face 'message-header-other))) (insert (format (propertize "Feed: %s\n" 'face 'message-header-name) @@ -159,9 +184,25 @@ Defaults to `elfeed-kill-buffer'.") (interactive) (call-interactively elfeed-show-refresh-function)) +(defcustom elfeed-show-unique-buffers nil + "When non-nil, every entry buffer gets a unique name. +This allows for displaying multiple show buffers at the same +time." + :group 'elfeed + :type 'boolean) + +(defun elfeed-show--buffer-name (entry) + "Return the appropriate buffer name for ENTRY. +The result depends on the value of `elfeed-show-unique-buffers'." + (if elfeed-show-unique-buffers + (format "*elfeed-entry-<%s %s>*" + (elfeed-entry-title entry) + (format-time-string "%F" (elfeed-entry-date entry))) + "*elfeed-entry*")) + (defun elfeed-show-entry (entry) "Display ENTRY in the current buffer." - (let ((buff (get-buffer-create "*elfeed-entry*"))) + (let ((buff (get-buffer-create (elfeed-show--buffer-name entry)))) (with-current-buffer buff (elfeed-show-mode) (setq elfeed-show-entry entry) @@ -377,45 +418,40 @@ offer to save a range of enclosures." (elfeed-show-save-enclosure-multi) (elfeed-show-save-enclosure-single))) -(defun elfeed-show-play-enclosure (&optional entry enclosure-index) - "Play enclosure number ENCLOSURE-INDEX from ENTRY using emms. -If ENTRY is nil use the elfeed-show-entry variable. -If ENCLOSURE-INDEX is nil ask for the enclosure number." - (interactive) +(defun elfeed--enclosure-maybe-prompt-index (entry) + "Prompt for an enclosure if there are multiple in ENTRY." + (if (= 1 (length (elfeed-entry-enclosures entry))) + 1 + (elfeed--get-enclosure-num "Enclosure to play" entry))) + +(defun elfeed-show-play-enclosure (enclosure-index) + "Play enclosure number ENCLOSURE-INDEX from current entry using EMMS. +Prompts for ENCLOSURE-INDEX when called interactively." + (interactive (list (elfeed--enclosure-maybe-prompt-index elfeed-show-entry))) + (elfeed-show-add-enclosure-to-playlist enclosure-index) + (with-no-warnings + (with-current-emms-playlist + (save-excursion + (emms-playlist-last) + (emms-playlist-mode-play-current-track))))) + +(defun elfeed-show-add-enclosure-to-playlist (enclosure-index) + "Add enclosure number ENCLOSURE-INDEX to current EMMS playlist. +Prompts for ENCLOSURE-INDEX when called interactively." + + (interactive (list (elfeed--enclosure-maybe-prompt-index elfeed-show-entry))) (require 'emms) ;; optional - (let* ((entry (or entry elfeed-show-entry)) - (enclosure-index (or enclosure-index - (elfeed--get-enclosure-num - "Enclosure to play" entry))) - (url-enclosure (car (elt (elfeed-entry-enclosures entry) - (- enclosure-index 1))))) - (with-no-warnings ;; due to lazy (require) - (with-current-emms-playlist - (let ((old-pos (point-max))) - (emms-add-url url-enclosure) - (goto-char old-pos) - ;; if we're sitting on a group name, move forward - (unless (emms-playlist-track-at (point)) - (emms-playlist-next)) - (emms-playlist-select (point))) - ;; FIXME: is there a better way of doing this? - (emms-stop) - (emms-start))))) - -(defun elfeed-show-add-enclosure-to-playlist (&optional entry enclosure-index) - "Play enclosure number ENCLOSURE-INDEX from ENTRY using emms. -If ENTRY is nil use the elfeed-show-entry variable. -If ENCLOSURE-INDEX is nil ask for the enclosure number." + (with-no-warnings ;; due to lazy (require ) + (emms-add-url (car (elt (elfeed-entry-enclosures elfeed-show-entry) + (- enclosure-index 1)))))) + +(defun elfeed-show-next-link () + "Skip to the next link, exclusive of the Link header." (interactive) - (require 'emms) ;; optional - (let* ((entry (or entry elfeed-show-entry)) - (enclosure-index (or enclosure-index - (elfeed--get-enclosure-num - "Enclosure to add" entry))) - (url-enclosure (car (elt (elfeed-entry-enclosures entry) - (- enclosure-index 1))))) - (with-no-warnings ;; due to lazy (require ) - (emms-add-url url-enclosure)))) + (let ((properties (text-properties-at (line-beginning-position)))) + (when (memq 'message-header-name properties) + (forward-paragraph)) + (shr-next-link))) (provide 'elfeed-show) diff --git a/elpa/elfeed-20181127.1943/elfeed.el b/elpa/elfeed-20190903.1137/elfeed.el similarity index 92% rename from elpa/elfeed-20181127.1943/elfeed.el rename to elpa/elfeed-20190903.1137/elfeed.el index 1481a74f..836b9f09 100644 --- a/elpa/elfeed-20181127.1943/elfeed.el +++ b/elpa/elfeed-20190903.1137/elfeed.el @@ -39,7 +39,7 @@ "An Emacs web feed reader." :group 'comm) -(defconst elfeed-version "3.1.0") +(defconst elfeed-version "3.2.0") (defcustom elfeed-feeds () "List of all feeds that Elfeed should follow. @@ -243,6 +243,28 @@ If PROTOCOL is nil, returns URL." (concat protocol ":" url) url)) +(defsubst elfeed--atom-authors-to-plist (authors) + "Parse list of author XML tags into list of plists." + (let ((result ())) + (dolist (author authors) + (let ((plist ()) + (name (xml-query* (name *) author)) + (uri (xml-query* (uri *) author)) + (email (xml-query* (email *) author))) + (when email + (setf plist (list :email (elfeed-cleanup email)))) + (when uri + (setf plist (nconc (list :uri (elfeed-cleanup uri)) plist))) + (when name + (setf plist (nconc (list :name (elfeed-cleanup name)) plist))) + (push plist result))) + (nreverse result))) + +(defsubst elfeed--creators-to-plist (creators) + "Convert Dublin Core list of creators into an authors plist." + (cl-loop for creator in creators + collect (list :name creator))) + (defun elfeed-entries-from-atom (url xml) "Turn parsed Atom content into a list of elfeed-entry structs." (let* ((feed-id url) @@ -250,12 +272,12 @@ If PROTOCOL is nil, returns URL." (namespace (elfeed-url-to-namespace url)) (feed (elfeed-db-get-feed feed-id)) (title (elfeed-cleanup (xml-query* (feed title *) xml))) - (author (elfeed-cleanup (xml-query* (feed author name *) xml))) + (authors (xml-query-all* (feed author) xml)) (xml-base (or (xml-query* (feed :base) xml) url)) (autotags (elfeed-feed-autotags url))) (setf (elfeed-feed-url feed) url (elfeed-feed-title feed) title - (elfeed-feed-author feed) author) + (elfeed-feed-author feed) (elfeed--atom-authors-to-plist authors)) (cl-loop for entry in (xml-query-all* (feed entry) xml) collect (let* ((title (or (xml-query* (title *) entry) "")) (xml-base (elfeed-update-location @@ -271,13 +293,11 @@ If PROTOCOL is nil, returns URL." (xml-query* (date *) entry) (xml-query* (modified *) entry) ; Atom 0.3 (xml-query* (issued *) entry))) ; Atom 0.3 - (author-name (or (xml-query* (author name *) entry) - ;; Dublin Core - (xml-query* (creator *) entry))) - (author-email (xml-query* (author email *) entry)) - (author (cond ((and author-name author-email) - (format "%s <%s>" author-name author-email)) - (author-name))) + (authors (nconc (elfeed--atom-authors-to-plist + (xml-query-all* (author) entry)) + ;; Dublin Core + (elfeed--creators-to-plist + (xml-query-all* (creator *) entry)))) (categories (xml-query-all* (category :term) entry)) (content (elfeed--atom-content entry)) (id (or (xml-query* (id *) entry) link @@ -305,14 +325,23 @@ If PROTOCOL is nil, returns URL." :content content :enclosures enclosures :content-type content-type - :meta `(,@(when author - (list :author author)) + :meta `(,@(when authors + (list :authors authors)) ,@(when categories (list :categories categories)))))) (dolist (hook elfeed-new-entry-parse-hook) (funcall hook :atom entry db-entry)) db-entry)))) +(defsubst elfeed--rss-author-to-plist (author) + "Parse an RSS author element into an authors plist." + (when author + (let ((clean (elfeed-cleanup author))) + (if (string-match "^\\(.*\\) (\\([^)]+\\))$" clean) + (list (list :name (match-string 2 clean) + :email (match-string 1 clean))) + (list (list :email clean)))))) + (defun elfeed-entries-from-rss (url xml) "Turn parsed RSS content into a list of elfeed-entry structs." (let* ((feed-id url) @@ -331,9 +360,11 @@ If PROTOCOL is nil, returns URL." (or (xml-query* (link *) item) guid))) (date (or (xml-query* (pubDate *) item) (xml-query* (date *) item))) - (author (or (xml-query* (author *) item) - ;; Dublin Core - (xml-query* (creator *) item))) + (authors (nconc (elfeed--rss-author-to-plist + (xml-query* (author *) item)) + ;; Dublin Core + (elfeed--creators-to-plist + (xml-query-all* (creator *) item)))) (categories (xml-query-all* (category *) item)) (content (or (xml-query-all* (encoded *) item) (xml-query-all* (description *) item))) @@ -362,8 +393,8 @@ If PROTOCOL is nil, returns URL." :enclosures enclosures :content description :content-type 'html - :meta `(,@(when author - (list :author author)) + :meta `(,@(when authors + (list :authors authors)) ,@(when categories (list :categories categories)))))) (dolist (hook elfeed-new-entry-parse-hook) diff --git a/elpa/elfeed-20181127.1943/xml-query.el b/elpa/elfeed-20190903.1137/xml-query.el similarity index 100% rename from elpa/elfeed-20181127.1943/xml-query.el rename to elpa/elfeed-20190903.1137/xml-query.el -- 2.47.3