Add +link-hint-open-chrome

I need to write a macro
This commit is contained in:
Case Duckworth 2022-02-16 23:18:02 -06:00
parent fae8e9168f
commit f0b220a7f4
1 changed files with 24 additions and 0 deletions

View File

@ -39,6 +39,30 @@ If TYPES is nil, define it for `+link-hint-open-secondary-types'."
(avy-with link-hint-open-link
(link-hint--one :open-secondary)))
(defun +link-hint-open-chrome-setup (&optional types)
"Define the `:open-chrome' 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))
(link-hint-define-type type
:open-chrome #'browse-url-chrome
:open-chrome-multiple t)))
(defun +link-hint-open-chrome ()
"Open a link with chrome."
(interactive)
(avy-with link-hint-open-link
(link-hint--one :open-chrome)))
;; (cl-defmacro +link-hint-add-type (keyword )
;; "Define link-hint type KEYWORD to operate on TYPES.
;; If TYPES is nil or absent, define KEYWORD for all
;; `link-hint-types'."
;; (let (forms)
;; (dolist (type (or types link-hint-types))
;; (push `(link-hint-define-type ,type ,keyword ,function) forms))
;; (push `(defun ,(intern (format "+link-hint%s" ,keyword))
;; ))))
(defun +link-hint-open-link (prefix)
"Open a link.
Without a PREFIX, open using `browse-url-browser-function'; with