Add modules/app/rss (WIP)
This commit is contained in:
parent
552684564e
commit
ca8b3b18fa
3 changed files with 131 additions and 0 deletions
65
modules/app/rss/autoload.el
Normal file
65
modules/app/rss/autoload.el
Normal file
|
@ -0,0 +1,65 @@
|
|||
;;; app/rss/autoload.el
|
||||
|
||||
;;;###autoload
|
||||
(defun =rss ()
|
||||
"Activate (or switch to) `elfeed' in its workspace."
|
||||
(interactive)
|
||||
(+workspace-switch +rss-workspace-name t)
|
||||
(delete-other-windows)
|
||||
(elfeed))
|
||||
|
||||
;;;###autoload
|
||||
(defun +rss|elfeed-wrap ()
|
||||
"Enhances an elfeed entry's readability by wrapping it to a width of
|
||||
`fill-column' and centering it with `visual-fill-column-mode'."
|
||||
(let ((inhibit-read-only t)
|
||||
(inhibit-modification-hooks t))
|
||||
(setq-local truncate-lines nil)
|
||||
(setq-local shr-width 85)
|
||||
(set-buffer-modified-p nil)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +rss/delete-pane ()
|
||||
"Delete the *elfeed-entry* split pane."
|
||||
(interactive)
|
||||
(let* ((buff (get-buffer "*elfeed-entry*"))
|
||||
(window (get-buffer-window buff)))
|
||||
(kill-buffer buff)
|
||||
(delete-window window)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +rss-popup-pane (buf)
|
||||
"Display BUF in a popup."
|
||||
(doom-popup-buffer buf
|
||||
:align +rss-split-direction
|
||||
:size 0.75
|
||||
:select t
|
||||
:noesc t
|
||||
:autokill t))
|
||||
|
||||
;;;###autoload
|
||||
(defun +rss/open (entry)
|
||||
"Display the currently selected item in a buffer."
|
||||
(interactive (list (elfeed-search-selected :ignore-region)))
|
||||
(when (elfeed-entry-p entry)
|
||||
(elfeed-untag entry 'unread)
|
||||
(elfeed-search-update-entry entry)
|
||||
(elfeed-show-entry entry)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +rss/next ()
|
||||
"Show the next item in the elfeed-search buffer."
|
||||
(interactive)
|
||||
(funcall elfeed-show-entry-delete)
|
||||
(with-current-buffer (elfeed-search-buffer)
|
||||
(forward-line)
|
||||
(call-interactively '+rss/open)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +rss/previous ()
|
||||
"Show the previous item in the elfeed-search buffer."
|
||||
(interactive)
|
||||
(funcall elfeed-show-entry-delete)
|
||||
(with-current-buffer (elfeed-search-buffer)
|
||||
(forward-line -1)
|
||||
(call-interactively '+rss/open)))
|
Loading…
Add table
Add a link
Reference in a new issue