about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-09-09 16:39:30 -0500
committerCase Duckworth2021-09-09 16:39:30 -0500
commit443b20a3a6a2127ad45a0627c1bf7e4e80ed4044 (patch)
tree5c94b9fbb44456788948d5dddb5f319061bcdd50
parentAdd `tildify-mode' (diff)
downloademacs-443b20a3a6a2127ad45a0627c1bf7e4e80ed4044.tar.gz
emacs-443b20a3a6a2127ad45a0627c1bf7e4e80ed4044.zip
Add `browse-url-in-teddit' function
-rw-r--r--init.el2
-rw-r--r--lisp/acdw-browse-url.el9
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:
1224 w3m-link 1224 w3m-link
1225 w3m-message-link)) 1225 w3m-message-link))
1226 (link-hint-define-type type 1226 (link-hint-define-type type
1227 :open-secondary browse-url-secondary-browser-function)) 1227 :open-secondary browse-url-secondary-browser-function))
1228 1228
1229 (:option link-hint-avy-style 'at) 1229 (:option link-hint-avy-style 'at)
1230 (:global "C-;" 1230 (: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 @@
6 "Arguments to pass to mpv in `browse-url-mpv'.") 6 "Arguments to pass to mpv in `browse-url-mpv'.")
7 7
8(defun browse-url-mpv (url &optional new-window) 8(defun browse-url-mpv (url &optional new-window)
9 "Play `URL' in mpv." 9 "Play URL in mpv."
10 (interactive (browse-url-interactive-arg "Video URL: ")) 10 (interactive (browse-url-interactive-arg "Video URL: "))
11 (ignore new-window) ;; mpv always opens a new window 11 (ignore new-window) ;; mpv always opens a new window
12 (let* ((url (browse-url-encode-url url)) 12 (let* ((url (browse-url-encode-url url))
@@ -112,6 +112,13 @@ Then, build `browse-url-button-regexp' with the new protocol."
112 112
113;;; Browse-URL tweaks 113;;; Browse-URL tweaks
114 114
115;; convert reddit.com to teddit
116(defun acdw/eww-browse-reddit-url (url &rest args)
117 "Browse a Reddit.com URL using Teddit."
118 (let* ((teddit "teddit.com")
119 (url (replace-regexp-in-string "reddit\\.com" teddit url)))
120 (eww-browse-url url args)))
121
115;; convert twitter.com to nitter 122;; convert twitter.com to nitter
116(defun acdw/eww-browse-twitter-url (url &rest args) 123(defun acdw/eww-browse-twitter-url (url &rest args)
117 "Browse a Twitter.com URL using Nitter." 124 "Browse a Twitter.com URL using Nitter."