diff --git a/lisp/+link-hint.el b/lisp/+link-hint.el index e2d2a84..b4584e0 100644 --- a/lisp/+link-hint.el +++ b/lisp/+link-hint.el @@ -25,7 +25,7 @@ (defvar +link-hint-map (make-sparse-keymap) "Keymap for `link-hint' functionality.") -(defun +link-hint-setup-open-secondary (&optional types) +(defun +link-hint-open-secondary-setup (&optional types) "Define the `:open-secondary' link-hint type for TYPES. If TYPES is nil, define it for `+link-hint-open-secondary-types'." (dolist (type (or types +link-hint-open-secondary-types)) @@ -33,6 +33,12 @@ If TYPES is nil, define it for `+link-hint-open-secondary-types'." :open-secondary browse-url-secondary-browser-function :open-secondary-multiple t))) +(defun +link-hint-open-secondary () + "Open a link in the secondary browser." + (interactive) + (avy-with link-hint-open-link + (link-hint--one :open-secondary))) + (defun +link-hint-open-link (prefix) "Open a link. Without a PREFIX, open using `browse-url-browser-function'; with @@ -57,5 +63,21 @@ a PREFIX, use `browse-url-secondary-browser-function'." (avy-with link-hint-open-all-links (link-hint--one (if prefix :open-secondary :open)))) +;;; Pocket-reader.el integration + +(defun +link-hint-pocket-add-setup (&optional types) + "Define the `:pocket-add' link-hint type for TYPES. +If TYPES is nil, define it for `link-hint-types'." + (dolist (type (or types link-hint-types)) + (link-hint-define-type type + :pocket-add #'pocket-reader-generic-add-link + :pocket-add-multiple t))) + +(defun +link-hint-pocket-add () + "Add a link to the Pocket reader." + (interactive) + (avy-with link-hint-open-link + (link-hint--one :pocket-add))) + (provide '+link-hint) ;;; +link-hint.el ends here