From 82e20c402f35bc174423eeae0e6abf76e44334ab Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 2 Sep 2021 17:07:36 -0500 Subject: Implement lazy elfeed scrolling --- init.el | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 4478b97..441ca35 100644 --- a/init.el +++ b/init.el @@ -1359,7 +1359,26 @@ like a dumbass." (acdw/reading-mode))) ;; see https://irreal.org/blog/?p=8885 - ) + ;; Lazy Elfeed (karthinks) + (defun elfeed-scroll-up-command (&optional arg) + "Scroll up or go to next feed item in Elfeed" + (interactive "^P") + (let ((scroll-error-top-bottom nil)) + (condition-case-unless-debug nil + (scroll-up-command arg) + (error (elfeed-show-next))))) + + (defun elfeed-scroll-down-command (&optional arg) + "Scroll up or go to next feed item in Elfeed" + (interactive "^P") + (let ((scroll-error-top-bottom nil)) + (condition-case-unless-debug nil + (scroll-down-command arg) + (error (elfeed-show-prev))))) + + ;; Turns out, `scroll-up' and `scroll-down' are /backward/ + (define-key elfeed-show-mode-map (kbd "SPC") 'elfeed-scroll-up-command) + (define-key elfeed-show-mode-map (kbd "S-SPC") 'elfeed-scroll-down-command)) (setup (:straight elisp-slime-nav) (:hook-into emacs-lisp-mode -- cgit 1.4.1-21-gabe81