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

wombag-search: Add w-search-open-in-wallabag #4

Open
wants to merge 2 commits 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
8 changes: 8 additions & 0 deletions wombag-search.el
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,13 @@ With prefix ARG only quit Wombag."
(when-let ((url (map-elt entry 'url)))
(eww url))))

(defun w-search-open-in-wallabag ()
"Open Wombag entry at point in Wallabag web interface."
(interactive)
(let ((id (get-text-property (point) 'wombag-id)))
(funcall wombag-browse-url-function
(format "%s/view/%s" wombag-host id))))

(defun w-search-copy ()
"Copy URL of Wombag entry at point."
(interactive)
Expand Down Expand Up @@ -707,6 +714,7 @@ When NO-CONFIRM is non-nil, do not ask for confirmation."
"B" #'w-search-eww-open
"&" #'w-search-browse-url
"x" #'w-search-browse-url
"W" #'w-search-open-in-wallabag
"s" #'w-search-live-filter
"q" #'w-search-quit-window
"g" #'w-search-update--force
Expand Down
8 changes: 8 additions & 0 deletions wombag-show.el
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ Render from positions BEGIN to END."
(shr-inhibit-images t))
(w-show-entry entry)))

(defun w-show-open-in-wallabag ()
"Open this Wombag article in Wallabag web interface."
(interactive)
(when-let ((id (alist-get 'id w-show-entry)))
(funcall wombag-browse-url-function
(format "%s/view/%s" wombag-host id))))


;;; Major mode
(defvar-keymap w-show-mode-map
Expand All @@ -184,6 +191,7 @@ Render from positions BEGIN to END."
"DEL" #'scroll-down-command
"<" #'beginning-of-buffer
">" #'end-of-buffer
"W" #'w-show-open-in-wallabag
"q" #'w-show-quit-window
"I" #'w-show-disable-images
"C-c C-n" #'w-heading-next
Expand Down