diff options
author | Case Duckworth | 2022-02-16 23:18:02 -0600 |
---|---|---|
committer | Case Duckworth | 2022-02-16 23:18:02 -0600 |
commit | f0b220a7f45843678e431fcda0e7b130a8b0a033 (patch) | |
tree | 64e21d19f9100f282c70fa8137dbf4649f0ef23f | |
parent | Change modeline (diff) | |
download | emacs-f0b220a7f45843678e431fcda0e7b130a8b0a033.tar.gz emacs-f0b220a7f45843678e431fcda0e7b130a8b0a033.zip |
Add +link-hint-open-chrome
I need to write a macro
-rw-r--r-- | lisp/+link-hint.el | 24 |
1 files changed, 24 insertions, 0 deletions
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'." | |||
39 | (avy-with link-hint-open-link | 39 | (avy-with link-hint-open-link |
40 | (link-hint--one :open-secondary))) | 40 | (link-hint--one :open-secondary))) |
41 | 41 | ||
42 | (defun +link-hint-open-chrome-setup (&optional types) | ||
43 | "Define the `:open-chrome' link-hint type for TYPES. | ||
44 | If TYPES is nil, define it for `+link-hint-open-secondary-types'." | ||
45 | (dolist (type (or types +link-hint-open-secondary-types)) | ||
46 | (link-hint-define-type type | ||
47 | :open-chrome #'browse-url-chrome | ||
48 | :open-chrome-multiple t))) | ||
49 | |||
50 | (defun +link-hint-open-chrome () | ||
51 | "Open a link with chrome." | ||
52 | (interactive) | ||
53 | (avy-with link-hint-open-link | ||
54 | (link-hint--one :open-chrome))) | ||
55 | |||
56 | ;; (cl-defmacro +link-hint-add-type (keyword ) | ||
57 | ;; "Define link-hint type KEYWORD to operate on TYPES. | ||
58 | ;; If TYPES is nil or absent, define KEYWORD for all | ||
59 | ;; `link-hint-types'." | ||
60 | ;; (let (forms) | ||
61 | ;; (dolist (type (or types link-hint-types)) | ||
62 | ;; (push `(link-hint-define-type ,type ,keyword ,function) forms)) | ||
63 | ;; (push `(defun ,(intern (format "+link-hint%s" ,keyword)) | ||
64 | ;; )))) | ||
65 | |||
42 | (defun +link-hint-open-link (prefix) | 66 | (defun +link-hint-open-link (prefix) |
43 | "Open a link. | 67 | "Open a link. |
44 | Without a PREFIX, open using `browse-url-browser-function'; with | 68 | Without a PREFIX, open using `browse-url-browser-function'; with |