From af344b998972680d7e1df02602fbada77510553b Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 12 Feb 2021 07:14:51 +0000 Subject: embark: better default action for w3m anchors --- consult.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/consult.org b/consult.org index 5929e61..0a2878b 100644 --- a/consult.org +++ b/consult.org @@ -256,6 +256,14 @@ (cons 'url url))))) (add-to-list 'embark-target-finders #'jao-embark-targets--w3m-anchor) + + (defun jao-embark-url (url) + "Browse URL, externally if we're already in emacs-w3m" + (if (derived-mode-p 'w3m-mode) + (jao-browse-with-external-browser url) + (browse-url url))) + + (define-key embark-url-map (kbd "RET") #'jao-embark-url) (define-key embark-url-map (kbd "f") #'browse-url-firefox) #+end_src *** video url targets -- cgit v1.2.3