From 871c39fcf3a6b35e8df4013d60e43a8bccadb672 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 30 Oct 2023 22:03:57 +1100 Subject: Flymake linting --- url-rewrite.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/url-rewrite.el b/url-rewrite.el index 0736494..8fd2028 100644 --- a/url-rewrite.el +++ b/url-rewrite.el @@ -44,6 +44,8 @@ ;; rewrite. ;;; Code: +(require 'url-parse) +(require 'subr-x) ;;; Utility functions (defun url-rw-format-filename (path queries) @@ -107,7 +109,7 @@ If VALUE is nil, just put KEY." (parsed-queries (url-rw-parse-queries queries))) (setf (alist-get key parsed-queries nil nil 'equal) value) (setf (url-filename urlobj) - (url-re-format-filename path parsed-queries)))) + (url-rw-format-filename path parsed-queries)))) (defun url-rw-remove-query (urlobj queries-to-remove) "Remove queries in QUERIES-TO-REMOVE from URLOBJ in place. @@ -129,7 +131,7 @@ QUERIES-TO-REMOVE is a regexp." (defun url-rw-replace-path (urlobj new-path) "Replace the path of URLOBJ with NEW-PATH in place." - (pcase-let ((`(,path . ,query) (url-path-and-query urlobj))) + (pcase-let ((`(_ . ,query) (url-path-and-query urlobj))) (setf (url-filename urlobj) (concat new-path (when query (concat "?" query)))))) (defun url-rw-replace-random-host (urlobj hosts) @@ -241,7 +243,12 @@ has exceeded `url-rw-max-rewrites', stop." "youtu.be" "m.youtube.com"))) :actions ((replace-random-host url-rw-example-invidious-hosts)))) - "Example rewrite rules") + "Example rewrite rules.") + +(defvar url-rw-example-zoom-numbers + '("+61731853730" + "+61871501149") + "List of zoom dial-in numbers.") (defun url-rewrite-example-zoom-to-dial (url) "Rewrite a zoom URL to a dial in number." @@ -256,11 +263,6 @@ has exceeded `url-rw-max-rewrites', stop." (match-string 1 path)) url))) -(defvar url-rw-example-zoom-numbers - '("+61731853730" - "+61871501149") - "List of zoom dial-in numbers.") - (defvar url-rw-example-invidious-hosts '("yewtu.be" "onion.tube") -- cgit v1.2.3