Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elfeed-show.el (elfeed-show-ace-link): add and bind to "v" #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion elfeed-pkg.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
(define-package "elfeed" "1.1.0"
"an Emacs Atom/RSS feed reader"
'((emacs "24.1")))
'((emacs "24.1")
(ace-jump-mode "2.0")
(noflet "0.0.10")))
26 changes: 26 additions & 0 deletions elfeed-show.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
(define-key map "n" 'elfeed-show-next)
(define-key map "p" 'elfeed-show-prev)
(define-key map "b" 'elfeed-show-visit)
(define-key map "v" 'elfeed-show-ace-link)
(define-key map "y" 'elfeed-show-yank)
(define-key map "u" (elfeed-expose #'elfeed-show-tag 'unread))
(define-key map "+" 'elfeed-show-tag)
Expand Down Expand Up @@ -176,6 +177,31 @@
(elfeed-search-update-entry entry))
(elfeed-show-refresh)))

(defun elfeed-show-ace-link ()
"Select a link to visit with ace-jump."
(interactive)
(noflet ((ace-jump-search-candidate (str va-list)
(let ((skip (text-property-any (point-min) (point-max)
'help-echo nil))
candidates)
(save-excursion
(while (setq skip (text-property-not-all skip (point-max)
'help-echo nil))
(goto-char skip)
(push (make-aj-position
:offset (1- skip)
:visual-area (car va-list))
candidates)
(setq skip (text-property-any (point) (point-max)
'help-echo nil))))
(nreverse candidates))))
(setq ace-jump-mode-end-hook
(list `(lambda ()
(setq ace-jump-mode-end-hook)
(forward-char 1)
(shr-browse-url))))
(ace-jump-do "foo")))

(provide 'elfeed-show)

;;; elfeed-show.el ends here