summaryrefslogtreecommitdiffhomepage
path: root/consult.org
diff options
context:
space:
mode:
Diffstat (limited to 'consult.org')
-rw-r--r--consult.org10
1 files changed, 7 insertions, 3 deletions
diff --git a/consult.org b/consult.org
index 8254ea4..4304d62 100644
--- a/consult.org
+++ b/consult.org
@@ -271,13 +271,16 @@
(add-to-list 'embark-target-finders #'jao-embark-targets--org-link)
(add-to-list 'embark-keymap-alist '(org-link . jao-embark-targets-org-link-map))
#+end_src
-*** w3m targets
+*** url targets
#+begin_src emacs-lisp
(declare-function w3m-anchor "w3m")
(defun jao-embark-targets--w3m-anchor ()
(when (not (region-active-p))
- (when-let ((url (or (w3m-anchor) w3m-current-url)))
+ (when-let ((url (or (and (derived-mode-p 'w3m-mode)
+ (or (w3m-anchor) w3m-current-url))
+ (and (derived-mode-p 'eww-mode)
+ (jao-eww-buffer-url)))))
(when (string-match-p "^https?.*" url)
(cons 'url url)))))
@@ -285,12 +288,13 @@
(defun jao-embark-url (url)
"Browse URL, externally if we're already in emacs-w3m"
- (if (derived-mode-p 'w3m-mode)
+ (if (derived-mode-p 'w3m-mode 'eww-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)
+ (define-key embark-url-map (kbd "m") 'jao-browse-with-external-browser)
#+end_src
*** video url targets
#+begin_src emacs-lisp