summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-02-12 07:14:51 +0000
committerjao <jao@gnu.org>2021-02-12 07:14:51 +0000
commitaf344b998972680d7e1df02602fbada77510553b (patch)
tree272712d9c49df747fafaccfe6c8934d3032c4909
parente02054d00d7394b6a7cdd9e9974c964aabb89958 (diff)
downloadelibs-af344b998972680d7e1df02602fbada77510553b.tar.gz
elibs-af344b998972680d7e1df02602fbada77510553b.tar.bz2
embark: better default action for w3m anchors
-rw-r--r--consult.org8
1 files changed, 8 insertions, 0 deletions
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