aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorF. Jason Park2023-11-05 16:03:15 -0800
committerF. Jason Park2023-11-12 20:36:32 -0800
commit29029529cb21960fc48e35ffbd24cbccaeb499a7 (patch)
treec6ca72a999ace5b6293f154106e18e32c8b83ef1
parent52afc64bad7f5af3d4bce48c5ac6e8e9bffbb933 (diff)
downloademacs-29029529cb21960fc48e35ffbd24cbccaeb499a7.tar.gz
emacs-29029529cb21960fc48e35ffbd24cbccaeb499a7.zip
Don't use func-arity to trigger API warning in url-irc
* lisp/url/url-irc.el (url-irc): Use more robust `condition-case' pattern instead, which will still fail when met with various edge cases. The old way was only useful for non-variadic lambda lists consisting entirely of named positional parameters. (Bug#56514)
-rw-r--r--lisp/url/url-irc.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/url/url-irc.el b/lisp/url/url-irc.el
index 1463335d40f..e11b4a6a58e 100644
--- a/lisp/url/url-irc.el
+++ b/lisp/url/url-irc.el
@@ -83,18 +83,20 @@ PASSWORD - What password to use.
83 (pass (url-password url)) 83 (pass (url-password url))
84 (user (url-user url)) 84 (user (url-user url))
85 (chan (url-filename url)) 85 (chan (url-filename url))
86 (type (url-type url)) 86 (type (url-type url)))
87 (compatp (eql 5 (cdr (func-arity url-irc-function)))))
88 (if (url-target url) 87 (if (url-target url)
89 (setq chan (concat chan "#" (url-target url)))) 88 (setq chan (concat chan "#" (url-target url))))
90 (if (string-match "^/" chan) 89 (if (string-match "^/" chan)
91 (setq chan (substring chan 1 nil))) 90 (setq chan (substring chan 1 nil)))
92 (if (= (length chan) 0) 91 (if (= (length chan) 0)
93 (setq chan nil)) 92 (setq chan nil))
94 (when compatp 93 (condition-case nil
95 (lwarn 'url :error "Obsolete value for `url-irc-function'")) 94 (funcall url-irc-function host port chan user pass type)
96 (apply url-irc-function 95 (wrong-number-of-arguments
97 host port chan user pass (unless compatp (list type))) 96 (display-warning 'url
97 (concat "Incompatible value for `url-irc-function'."
98 " Likely not expecting a 6th (SCHEME) arg."))
99 (funcall url-irc-function host port chan user pass)))
98 nil)) 100 nil))
99 101
100;;;; ircs:// 102;;;; ircs://