From f8e5e64308941dc52ecd8149f4faeaa7ea832d7b Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 6 Feb 2022 22:17:44 -0600 Subject: Add other link types --- lisp/+link-hint.el | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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 -- cgit 1.4.1-21-gabe81