mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-17 01:34:21 +00:00
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)
This commit is contained in:
parent
52afc64bad
commit
29029529cb
1 changed files with 8 additions and 6 deletions
|
|
@ -83,18 +83,20 @@ PASSWORD - What password to use.
|
|||
(pass (url-password url))
|
||||
(user (url-user url))
|
||||
(chan (url-filename url))
|
||||
(type (url-type url))
|
||||
(compatp (eql 5 (cdr (func-arity url-irc-function)))))
|
||||
(type (url-type url)))
|
||||
(if (url-target url)
|
||||
(setq chan (concat chan "#" (url-target url))))
|
||||
(if (string-match "^/" chan)
|
||||
(setq chan (substring chan 1 nil)))
|
||||
(if (= (length chan) 0)
|
||||
(setq chan nil))
|
||||
(when compatp
|
||||
(lwarn 'url :error "Obsolete value for `url-irc-function'"))
|
||||
(apply url-irc-function
|
||||
host port chan user pass (unless compatp (list type)))
|
||||
(condition-case nil
|
||||
(funcall url-irc-function host port chan user pass type)
|
||||
(wrong-number-of-arguments
|
||||
(display-warning 'url
|
||||
(concat "Incompatible value for `url-irc-function'."
|
||||
" Likely not expecting a 6th (SCHEME) arg."))
|
||||
(funcall url-irc-function host port chan user pass)))
|
||||
nil))
|
||||
|
||||
;;;; ircs://
|
||||
|
|
|
|||
Loading…
Reference in a new issue