From f0b220a7f45843678e431fcda0e7b130a8b0a033 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 16 Feb 2022 23:18:02 -0600 Subject: Add +link-hint-open-chrome I need to write a macro --- lisp/+link-hint.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lisp/+link-hint.el b/lisp/+link-hint.el index b4584e0..a6999b7 100644 --- a/lisp/+link-hint.el +++ b/lisp/+link-hint.el @@ -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 -- cgit 1.4.1-21-gabe81