Skip to content

Commit

Permalink
Override n/p in elfeed-show-mode
Browse files Browse the repository at this point in the history
For prev/next, do not advance after showing the current entry, but do it only
when necessary. This is far less confusing than the original behaviour, when
used in a split setting.

This fixes #13, thanks to @felixpinkert for bringing up the issue.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
  • Loading branch information
algernon committed Mar 16, 2016
1 parent 5983e70 commit a8e10b9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ ones they may have problems with. Consider customising the following faces:
Copyright & License
------------------------

Copyright (c) 2015 Gergely Nagy, released under the terms of the GNU GPLv3+.
Copyright (c) 2015, 2016 Gergely Nagy, released under the terms of the GNU GPLv3+.
26 changes: 25 additions & 1 deletion elfeed-goodies-split-pane.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; elfeed-goodies-split-pane.el --- Elfeed goodies: split pane support
;;
;; Copyright (c) 2015 Gergely Nagy
;; Copyright (c) 2015, 2016 Gergely Nagy
;;
;; Author: Gergely Nagy
;; URL: https://github.com/algernon/elfeed-goodies
Expand Down Expand Up @@ -41,6 +41,30 @@
(kill-buffer buff)
(delete-window window)))

(defun elfeed-goodies/split-search-show-entry (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)))

(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-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-search-buffer)
(forward-line -1)
(call-interactively #'elfeed-goodiess/split-search-show-entry)))

(provide 'elfeed-goodies-split-pane)

;;; elfeed-goodies-split-pane.el ends here
6 changes: 4 additions & 2 deletions elfeed-goodies.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; elfeed-goodies.el --- Elfeed goodies
;;
;; Copyright (c) 2015 Gergely Nagy
;; Copyright (c) 2015, 2016 Gergely Nagy
;;
;; Author: Gergely Nagy
;; URL: https://github.com/algernon/elfeed-goodies
Expand Down Expand Up @@ -74,6 +74,8 @@ utf-8."
elfeed-search-print-entry-function #'elfeed-goodies/entry-line-draw
elfeed-show-entry-switch #'elfeed-goodies/switch-pane
elfeed-show-entry-delete #'elfeed-goodies/delete-pane
elfeed-show-refresh-function #'elfeed-goodies/show-refresh--plain))
elfeed-show-refresh-function #'elfeed-goodies/show-refresh--plain)
(define-key elfeed-show-mode-map "n" #'elfeed-goodies/split-show-next)
(define-key elfeed-show-mode-map "p" #'elfeed-goodies/split-show-prev))

;;; elfeed-goodies.el ends here

0 comments on commit a8e10b9

Please sign in to comment.