commit ea40040b01d7669168a2c169e2bb91d83ce662dc parent 7f02cd786b75471ee04fe3ea5cca9a3155ff82da Author: Yuval Langer <yuval.langer@gmail.com> Date: Fri, 27 Sep 2024 08:24:40 +0300 Fix detubifier-farsidify-region function bug. Diffstat:
M | detubifier.el | | | 26 | +++++++++++++------------- |
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/detubifier.el b/detubifier.el @@ -69,12 +69,14 @@ (defcustom detubifier-enshittified-urls '( - "www.youtube.com" - "youtube.com" - "youtu.be" - "twitter.com" - "x.com" - "reddit.com" + "https://reddit.com" + "https://twitter.com" + "https://www.reddit.com" + "https://www.twitter.com" + "https://www.youtube.com" + "https://x.com" + "https://youtu.be" + "https://youtube.com" ) "URLs of enshittified services." :type '(repeat string) @@ -174,17 +176,15 @@ is replaced with: (let ((beg (if beg beg (region-beginning))) (end (if end end (region-end)))) - (save-excursion (save-restriction ;; Save narrowing setting and revert to it when finishing. (narrow-to-region beg end) (rx-let-eval `((urls () (group (or ,@detubifier-enshittified-urls)))) - (let ((result (replace-regexp-in-region (rx-to-string '(urls)) - (concat detubifier-farside-url "\\1") - beg - end))) - result))))) - ) + (let ((r (rx-to-string '(urls)))) + (replace-regexp-in-region r + (concat detubifier-farside-url "\\1") + beg + end))))))) ;;;###autoload (defun detubifier-farsidify-string (str)