From 12f24e3d75ed9a09f6edb09d8331192110d504fd Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 5 Mar 2022 19:23:30 +0000 Subject: link-hint externally --- completion.org | 6 +++++- init.org | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/completion.org b/completion.org index 11a6565..6d2e1fc 100644 --- a/completion.org +++ b/completion.org @@ -564,8 +564,12 @@ :init (setq link-hint-avy-style 'pre) :config + (defun jao-link-hint-open-link-ext () + (interactive) + (let ((jao-browse-url-function jao-browse-url-external-function)) + (link-hint-open-link))) :bind (("C-l" . link-hint-open-link) - ("C-S-l" . recenter-top-bottom))) + ("C-S-l" . jao-link-hint-open-link-ext))) #+end_src diff --git a/init.org b/init.org index 259df56..5df0db5 100644 --- a/init.org +++ b/init.org @@ -1584,6 +1584,9 @@ (jao-mpc-add-url url) (if p (jao-mpc-play) (message "%s added to mpc queue" url)))) + (defun jao-browse-url-browse (&rest args) + (apply jao-browse-url-function args)) + (setq browse-url-handlers `(("^\\(gemini\\|gopher\\)://.*" . jao-elpher--browse) (,jao--doc-exts . jao--browse-doc) @@ -1595,7 +1598,7 @@ (,jao-browse--sound-rx . jao-browse-add-url-to-mpc) (,(jao-wget--regexp) . jao-download) (jao-video--url-p . jao-maybe-view-video) - ("." . ,jao-browse-url-function))) + ("." . jao-browse-url-browse))) (when (< emacs-major-version 28) (setf (alist-get 'jao-video--url-p browse-url-handlers nil t) nil) -- cgit v1.2.3