diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/+link-hint.el | 24 |
1 files changed, 23 insertions, 1 deletions
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 @@ | |||
25 | (defvar +link-hint-map (make-sparse-keymap) | 25 | (defvar +link-hint-map (make-sparse-keymap) |
26 | "Keymap for `link-hint' functionality.") | 26 | "Keymap for `link-hint' functionality.") |
27 | 27 | ||
28 | (defun +link-hint-setup-open-secondary (&optional types) | 28 | (defun +link-hint-open-secondary-setup (&optional types) |
29 | "Define the `:open-secondary' link-hint type for TYPES. | 29 | "Define the `:open-secondary' link-hint type for TYPES. |
30 | If TYPES is nil, define it for `+link-hint-open-secondary-types'." | 30 | If TYPES is nil, define it for `+link-hint-open-secondary-types'." |
31 | (dolist (type (or types +link-hint-open-secondary-types)) | 31 | (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'." | |||
33 | :open-secondary browse-url-secondary-browser-function | 33 | :open-secondary browse-url-secondary-browser-function |
34 | :open-secondary-multiple t))) | 34 | :open-secondary-multiple t))) |
35 | 35 | ||
36 | (defun +link-hint-open-secondary () | ||
37 | "Open a link in the secondary browser." | ||
38 | (interactive) | ||
39 | (avy-with link-hint-open-link | ||
40 | (link-hint--one :open-secondary))) | ||
41 | |||
36 | (defun +link-hint-open-link (prefix) | 42 | (defun +link-hint-open-link (prefix) |
37 | "Open a link. | 43 | "Open a link. |
38 | Without a PREFIX, open using `browse-url-browser-function'; with | 44 | Without a PREFIX, open using `browse-url-browser-function'; with |
@@ -57,5 +63,21 @@ a PREFIX, use `browse-url-secondary-browser-function'." | |||
57 | (avy-with link-hint-open-all-links | 63 | (avy-with link-hint-open-all-links |
58 | (link-hint--one (if prefix :open-secondary :open)))) | 64 | (link-hint--one (if prefix :open-secondary :open)))) |
59 | 65 | ||
66 | ;;; Pocket-reader.el integration | ||
67 | |||
68 | (defun +link-hint-pocket-add-setup (&optional types) | ||
69 | "Define the `:pocket-add' link-hint type for TYPES. | ||
70 | If TYPES is nil, define it for `link-hint-types'." | ||
71 | (dolist (type (or types link-hint-types)) | ||
72 | (link-hint-define-type type | ||
73 | :pocket-add #'pocket-reader-generic-add-link | ||
74 | :pocket-add-multiple t))) | ||
75 | |||
76 | (defun +link-hint-pocket-add () | ||
77 | "Add a link to the Pocket reader." | ||
78 | (interactive) | ||
79 | (avy-with link-hint-open-link | ||
80 | (link-hint--one :pocket-add))) | ||
81 | |||
60 | (provide '+link-hint) | 82 | (provide '+link-hint) |
61 | ;;; +link-hint.el ends here | 83 | ;;; +link-hint.el ends here |