summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-08-07 15:05:16 -0500
committerCase Duckworth2021-08-07 15:05:16 -0500
commit4f72e23f72f9712999b8f629a4c62d6f78b65d3b (patch)
treeb16f2f0ba924a34663860a632f665598e13b8572
parentAdd alias for erc-propertize -> propertize (diff)
downloademacs-4f72e23f72f9712999b8f629a4c62d6f78b65d3b.tar.gz
emacs-4f72e23f72f9712999b8f629a4c62d6f78b65d3b.zip
Add twitter.com URL handling
TODO: This could be smarter, e.g. not going to nitter if twitter.com/t.co is
part of the URL query.
-rw-r--r--init.el1
-rw-r--r--lisp/acdw.el9
2 files changed, 10 insertions, 0 deletions
diff --git a/init.el b/init.el index f31da5d..a4d8535 100644 --- a/init.el +++ b/init.el
@@ -133,6 +133,7 @@
133 'browse-url-mpv 133 'browse-url-mpv
134 'eww-browse-url)) 134 'eww-browse-url))
135 ("google\\.com" . browse-url-default-browser) 135 ("google\\.com" . browse-url-default-browser)
136 ("\\(twitter\\.com\\|t\\.co\\)" . acdw/eww-browse-twitter-url)
136 ("." . eww-browse-url))) 137 ("." . eww-browse-url)))
137 138
138 ;; Buttonize gemini:// links. 139 ;; Buttonize gemini:// links.
diff --git a/lisp/acdw.el b/lisp/acdw.el index 9d8c489..be12dd6 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -497,6 +497,15 @@ Then, build `browse-url-button-regexp' with the new protocol."
497 (add-to-list 'acdw/button-protocols proto) 497 (add-to-list 'acdw/button-protocols proto)
498 (setq-default browse-url-button-regexp (acdw/build-button-url-regexp))) 498 (setq-default browse-url-button-regexp (acdw/build-button-url-regexp)))
499 499
500;;; Browse-URL tweaks
501
502;; convert twitter.com to nitter
503(defun acdw/eww-browse-twitter-url (url &rest args)
504 "Browse a Twitter.com URL using Nitter."
505 (let* ((nitter "nitter.snopyta.org")
506 (url (replace-regexp-in-string "twitter\\.com" nitter url)))
507 (eww-browse-url url args)))
508
500 509
501;;; Recentf renaming with dired 510;;; Recentf renaming with dired
502;; from ... somewhere. 'rjs', apparently? 511;; from ... somewhere. 'rjs', apparently?