merge: pull request #5523 from jeetelongname/elfeed-improvements

improve `:app rss` module
This commit is contained in:
Henrik Lissner 2021-10-03 12:49:40 +02:00 committed by GitHub
commit 645f5eae50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 10 deletions

View file

@ -30,6 +30,7 @@ This module has no dedicated maintainers.
** Plugins ** Plugins
+ [[https://github.com/skeeto/elfeed][elfeed]] + [[https://github.com/skeeto/elfeed][elfeed]]
+ [[https://github.com/algernon/elfeed-goodies][elfeed-goodies]]
+ =+org= + =+org=
+ [[https://github.com/remyhonig/elfeed-org][elfeed-org]] + [[https://github.com/remyhonig/elfeed-org][elfeed-org]]
@ -72,20 +73,21 @@ When using ~+org~ flag then configuration is easier. You can use ~org-mode~ to c
** Keybindings ** Keybindings
+ General + General
| Key | Mode | Description | | Key | Mode | Description |
|---------+--------------------+------------------------| |---------+--------------------+--------------------------------|
| =S-RET= | Elfeed-search-mode | Open link into browser | | =S-RET= | Elfeed-search-mode | Open link into browser |
| =RET= | Elfeed-search-mode | Open item | | =RET= | Elfeed-search-mode | Open item |
| =s= | Elfeed-search-mode | Filter | | =s= | Elfeed-search-mode | Filter |
| =C-j= | Elfeed-show-mode | Move to next item | | =C-j= | Elfeed-show-mode | Move to next item |
| =C-k= | Elfeed-show-mode | Move to previous item | | =C-k= | Elfeed-show-mode | Move to previous item |
+ If ~:editor evil +everywhere~ + If ~:editor evil +everywhere~
| Key | Description | | Key | Description |
|-----+-----------------------------| |-----+-----------------------------|
| q | elfeed-kill-buffer | | q | elfeed-kill-buffer |
| r | elfeed-search-update--force | | r | elfeed-search-update--force |
| g c | Copy link of current entry |
** News filtering ** News filtering
+ Time filtering + Time filtering
+ ~@2-days-ago~ Past two days + ~@2-days-ago~ Past two days

View file

@ -54,7 +54,14 @@
(forward-line -1) (forward-line -1)
(call-interactively '+rss/open))) (call-interactively '+rss/open)))
;;;###autoload
(defun +rss/copy-link ()
"Copy current link to clipboard."
(interactive)
(let ((link (elfeed-entry-link elfeed-show-entry)))
(when link
(kill-new link)
(message "Copied %s to clipboard" link))))
;; ;;
;; Hooks ;; Hooks

View file

@ -58,7 +58,11 @@ easier to scroll through.")
(evil-define-key 'normal elfeed-search-mode-map (evil-define-key 'normal elfeed-search-mode-map
"q" #'elfeed-kill-buffer "q" #'elfeed-kill-buffer
"r" #'elfeed-search-update--force "r" #'elfeed-search-update--force
(kbd "M-RET") #'elfeed-search-browse-url))) (kbd "M-RET") #'elfeed-search-browse-url)
(map! (:map elfeed-show-mode-map
:n "gc" nil
:n "gc" #'+rss/copy-link))))
(use-package! elfeed-org (use-package! elfeed-org
@ -76,3 +80,8 @@ easier to scroll through.")
(dolist (file (cl-remove-if #'file-exists-p files)) (dolist (file (cl-remove-if #'file-exists-p files))
(message "elfeed-org: ignoring %S because it can't be read" file)) (message "elfeed-org: ignoring %S because it can't be read" file))
(setq rmh-elfeed-org-files (cl-remove-if-not #'file-exists-p files)))))) (setq rmh-elfeed-org-files (cl-remove-if-not #'file-exists-p files))))))
(use-package! elfeed-goodies
:after elfeed
:config
(elfeed-goodies/setup))

View file

@ -2,5 +2,6 @@
;;; app/rss/packages.el ;;; app/rss/packages.el
(package! elfeed :pin "162d7d545ed41c27967d108c04aa31f5a61c8e16") (package! elfeed :pin "162d7d545ed41c27967d108c04aa31f5a61c8e16")
(package! elfeed-goodies :pin "95b4ea632fbd5960927952ec8f3394eb88da4752")
(when (featurep! +org) (when (featurep! +org)
(package! elfeed-org :pin "268efdd0121fa61f63b722c30e0951c5d31224a4")) (package! elfeed-org :pin "268efdd0121fa61f63b722c30e0951c5d31224a4"))