Skip to content

Commit

Permalink
Make split-show-next/prev work from elfeed-search-buffer as well
Browse files Browse the repository at this point in the history
This allows for using the `elfeed-goodies/split-show-next` and
`elfeed-goodies/split-show-prev` navigation functions also when in the
elfeed-search-buffer, by catching the signal from elfeed-show-entry-delete when
there is not yet a split window for viewing posts (i.e. killing the single
window does not succeed)
  • Loading branch information
torgeir committed Jan 28, 2019
1 parent fc0c3e7 commit 02794e7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions elfeed-goodies-split-pane.el
Expand Up @@ -55,18 +55,23 @@
(elfeed-search-update-entry entry)
(elfeed-show-entry entry)))

(defun elfeed-entry-buffer ()
(get-buffer-create "*elfeed-entry*"))

(defun elfeed-goodies/split-show-next ()
"Show the next item in the elfeed-search buffer."
(interactive)
(funcall elfeed-show-entry-delete)
(with-current-buffer (elfeed-entry-buffer)
(condition-case nil (funcall elfeed-show-entry-delete) (error nil)))
(with-current-buffer (elfeed-search-buffer)
(forward-line)
(call-interactively #'elfeed-goodies/split-search-show-entry)))

(defun elfeed-goodies/split-show-prev ()
"Show the previous item in the elfeed-search buffer."
(interactive)
(funcall elfeed-show-entry-delete)
(with-current-buffer (elfeed-entry-buffer)
(condition-case nil (funcall elfeed-show-entry-delete) (error nil)))
(with-current-buffer (elfeed-search-buffer)
(forward-line -1)
(call-interactively #'elfeed-goodies/split-search-show-entry)))
Expand Down

0 comments on commit 02794e7

Please sign in to comment.