mirror of
https://github.com/SqrtMinusOne/elfeed-summary.git
synced 2025-12-11 18:13:03 +03:00
feat: compatibility with elfeed-org
This commit is contained in:
parent
cabacde586
commit
ea68bc844f
1 changed files with 11 additions and 1 deletions
|
|
@ -49,6 +49,10 @@
|
||||||
;; the code.
|
;; the code.
|
||||||
(declare-function evil-define-key* "evil-core")
|
(declare-function evil-define-key* "evil-core")
|
||||||
|
|
||||||
|
;; XXX Compatibility with elfeed-org. If this function is bound, then
|
||||||
|
;; `elfeed-org' is available
|
||||||
|
(declare-function rmh-elfeed-org-process "elfeed-org")
|
||||||
|
|
||||||
(define-widget 'elfeed-summary-query 'lazy
|
(define-widget 'elfeed-summary-query 'lazy
|
||||||
"Type widget for the query part of `elfeed-summary-settings'."
|
"Type widget for the query part of `elfeed-summary-settings'."
|
||||||
:offset 4
|
:offset 4
|
||||||
|
|
@ -514,6 +518,12 @@ PARAMS is a form as described in `elfeed-summary-settings'."
|
||||||
else if (and (listp param) (eq (car param) 'query))
|
else if (and (listp param) (eq (car param) 'query))
|
||||||
append (elfeed-summary--get-feeds (cdr param))))
|
append (elfeed-summary--get-feeds (cdr param))))
|
||||||
|
|
||||||
|
(defun elfeed-summary--ensure ()
|
||||||
|
(elfeed-db-ensure)
|
||||||
|
(when (and (not elfeed-feeds)
|
||||||
|
(fboundp #'rmh-elfeed-org-process))
|
||||||
|
(rmh-elfeed-org-process rmh-elfeed-org-files rmh-elfeed-org-tree-id)))
|
||||||
|
|
||||||
(defun elfeed-summary--get-data ()
|
(defun elfeed-summary--get-data ()
|
||||||
"Create the summary details tree from scratch.
|
"Create the summary details tree from scratch.
|
||||||
|
|
||||||
|
|
@ -544,7 +554,6 @@ The return value is a list of alists of the following elements:
|
||||||
- `faces' - list of faces for the search entry.
|
- `faces' - list of faces for the search entry.
|
||||||
- `unread' - number of unread entries in the search results.
|
- `unread' - number of unread entries in the search results.
|
||||||
- `total' - total number of entries in the search results."
|
- `total' - total number of entries in the search results."
|
||||||
(elfeed-db-ensure)
|
|
||||||
(let* ((feeds (elfeed-summary--extract-feeds
|
(let* ((feeds (elfeed-summary--extract-feeds
|
||||||
elfeed-summary-settings))
|
elfeed-summary-settings))
|
||||||
(all-feeds (mapcar #'car elfeed-feeds))
|
(all-feeds (mapcar #'car elfeed-feeds))
|
||||||
|
|
@ -879,6 +888,7 @@ TREE is a form such as returned by `elfeed-summary--get-data'."
|
||||||
The buffer displays a list of feeds, as set up by the
|
The buffer displays a list of feeds, as set up by the
|
||||||
`elfeed-summary-settings' variable."
|
`elfeed-summary-settings' variable."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(elfeed-summary--ensure)
|
||||||
(add-hook 'elfeed-update-hooks #'elfeed-summary--on-feed-update)
|
(add-hook 'elfeed-update-hooks #'elfeed-summary--on-feed-update)
|
||||||
(add-hook 'elfeed-update-init-hooks #'elfeed-summary--refresh-if-exists)
|
(add-hook 'elfeed-update-init-hooks #'elfeed-summary--refresh-if-exists)
|
||||||
(when-let ((buffer (get-buffer elfeed-summary-buffer)))
|
(when-let ((buffer (get-buffer elfeed-summary-buffer)))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue