diff options
author | jao <jao@gnu.org> | 2021-12-03 02:05:30 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-12-03 02:05:30 +0000 |
commit | 597a227573bd8f78d8d59004d9ea424ac553d757 (patch) | |
tree | 3d0046fce77bacdc064f3fc90d2c162f2fb1bd74 | |
parent | b250844980ae6af7f231f67e9f80507bc2b6b5dc (diff) | |
download | elibs-597a227573bd8f78d8d59004d9ea424ac553d757.tar.gz elibs-597a227573bd8f78d8d59004d9ea424ac553d757.tar.bz2 |
finesse-ing link-hint for eww buffers
-rw-r--r-- | eww.org | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -5,17 +5,19 @@ #+begin_src emacs-lisp (defun jao-eww-browse-url (url &rest r) "Browse URL using eww." - (jao-afio--goto-www) - (select-window (frame-first-window)) - (let* ((url (url-encode-url url)) - (bf (seq-find `(lambda (b) - (with-current-buffer b - (string= ,url - (url-encode-url (eww-current-url))))) - (jao-eww-session--list-buffers)))) - (cond (bf (switch-to-buffer bf)) - ((string-match-p url "^file://") (eww-open-file url)) - (t (eww url 4))))) + (if (derived-mode-p 'eww-mode) + (eww url) + (jao-afio--goto-www) + (select-window (frame-first-window)) + (let* ((url (url-encode-url url)) + (bf (seq-find `(lambda (b) + (with-current-buffer b + (string= ,url + (url-encode-url (eww-current-url))))) + (jao-eww-session--list-buffers)))) + (cond (bf (switch-to-buffer bf)) + ((string-match-p url "^file://") (eww-open-file url)) + (t (eww url 4)))))) (setq jao-browse-url-function #'jao-eww-browse-url) (setq eww-use-browse-url "^\\(gemini\\|gopher\\):") |