From 443b20a3a6a2127ad45a0627c1bf7e4e80ed4044 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 9 Sep 2021 16:39:30 -0500 Subject: Add `browse-url-in-teddit' function --- init.el | 2 +- lisp/acdw-browse-url.el | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index 601bcc4..a794594 100644 --- a/init.el +++ b/init.el @@ -1224,7 +1224,7 @@ specific to most general, they are these: w3m-link w3m-message-link)) (link-hint-define-type type - :open-secondary browse-url-secondary-browser-function)) + :open-secondary browse-url-secondary-browser-function)) (:option link-hint-avy-style 'at) (:global "C-;" diff --git a/lisp/acdw-browse-url.el b/lisp/acdw-browse-url.el index 93f470c..9f8e484 100644 --- a/lisp/acdw-browse-url.el +++ b/lisp/acdw-browse-url.el @@ -6,7 +6,7 @@ "Arguments to pass to mpv in `browse-url-mpv'.") (defun browse-url-mpv (url &optional new-window) - "Play `URL' in mpv." + "Play URL in mpv." (interactive (browse-url-interactive-arg "Video URL: ")) (ignore new-window) ;; mpv always opens a new window (let* ((url (browse-url-encode-url url)) @@ -112,6 +112,13 @@ Then, build `browse-url-button-regexp' with the new protocol." ;;; Browse-URL tweaks +;; convert reddit.com to teddit +(defun acdw/eww-browse-reddit-url (url &rest args) + "Browse a Reddit.com URL using Teddit." + (let* ((teddit "teddit.com") + (url (replace-regexp-in-string "reddit\\.com" teddit url))) + (eww-browse-url url args))) + ;; convert twitter.com to nitter (defun acdw/eww-browse-twitter-url (url &rest args) "Browse a Twitter.com URL using Nitter." -- cgit 1.4.1-21-gabe81