From 007ddbb5ca3242c95ceccf3af701cb7e3567396c Mon Sep 17 00:00:00 2001 From: Elias Storms Date: Fri, 1 Nov 2024 22:03:43 +0100 Subject: [PATCH 1/2] wombag-search: Add w-search-open-in-wallabag New function in wombag-search to open entry at point in the Wallabag web interface, using wombag-browse-url-function. --- wombag-search.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wombag-search.el b/wombag-search.el index 89161ba..7a6faa2 100644 --- a/wombag-search.el +++ b/wombag-search.el @@ -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) @@ -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 From 399b56016505e10e67dd668eb264e5aa144222bb Mon Sep 17 00:00:00 2001 From: Elias Storms Date: Sun, 10 Nov 2024 20:18:52 +0100 Subject: [PATCH 2/2] wombag-show: Add w-show-open-in-wallabag Add a function to open the currently shown Wombag article in the Wallabag web interface, similar to w-search-open-in-wallabag. --- wombag-show.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wombag-show.el b/wombag-show.el index 54c4f72..dbbba63 100644 --- a/wombag-show.el +++ b/wombag-show.el @@ -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 @@ -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