diff options
author | Case Duckworth | 2021-04-02 13:05:24 -0500 |
---|---|---|
committer | Case Duckworth | 2021-04-02 13:05:24 -0500 |
commit | bad90ed2f9d4c5e62f2477b4cf915986c36760dc (patch) | |
tree | 8b4f4d4d05dd63d551f7fc34029043ed1dbf54ff | |
parent | Add `pkgbuild-mode' (diff) | |
download | emacs-bad90ed2f9d4c5e62f2477b4cf915986c36760dc.tar.gz emacs-bad90ed2f9d4c5e62f2477b4cf915986c36760dc.zip |
Add `elpher:eww-browse-url'
-rw-r--r-- | init.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/init.el b/init.el index de01373..cbb081e 100644 --- a/init.el +++ b/init.el | |||
@@ -707,8 +707,16 @@ if ripgrep is installed, otherwise `consult-grep'." | |||
707 | "o" elpher-follow-current-link | 707 | "o" elpher-follow-current-link |
708 | "G" elpher-go-current) | 708 | "G" elpher-go-current) |
709 | (:hook acdw/reading-mode) | 709 | (:hook acdw/reading-mode) |
710 | (when (boundp 'god-exempt-major-modes) | 710 | |
711 | (:option (append god-exempt-major-modes) 'elpher-mode))) | 711 | ;; Make `eww' gemini/gopher aware. |
712 | ;; From Emacswiki. | ||
713 | (defun elpher:eww-browse-url (original url &optional new-window) | ||
714 | "Handle gemini and gopher links." | ||
715 | (cond ((string-match-p "\\`\\(gemini\\|gopher\\)://" url) | ||
716 | (require 'elpher) | ||
717 | (elpher-go url)) | ||
718 | (t (funcall original url new-window)))) | ||
719 | (advice-add 'eww-browse-url :around #'elpher:eww-browse-url)) | ||
712 | 720 | ||
713 | (setup (:straight (gemini-mode | 721 | (setup (:straight (gemini-mode |
714 | :host nil | 722 | :host nil |