[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 29029529cb2 1/9: Don't use func-arity to trigger API warning in u
From: |
F. Jason Park |
Subject: |
master 29029529cb2 1/9: Don't use func-arity to trigger API warning in url-irc |
Date: |
Sun, 12 Nov 2023 23:56:29 -0500 (EST) |
branch: master
commit 29029529cb21960fc48e35ffbd24cbccaeb499a7
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>
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)
---
lisp/url/url-irc.el | 14 ++++++++------
1 file 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.
(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://
- master updated (52afc64bad7 -> ece62f5c1c3), F. Jason Park, 2023/11/12
- master 29029529cb2 1/9: Don't use func-arity to trigger API warning in url-irc,
F. Jason Park <=
- master ece62f5c1c3 9/9: ; Prepare for ERC 5.6 release, F. Jason Park, 2023/11/12
- master beb60a9027c 3/9: Make ERC's error-notice formatting more consistent, F. Jason Park, 2023/11/12
- master e2130fe9272 4/9: Always run erc-server-send-queue via timer, F. Jason Park, 2023/11/12
- master 174b3dd9bd7 5/9: Make nested input handling more robust in ERC, F. Jason Park, 2023/11/12
- master 5baa0f61f8d 2/9: Offer alternate pool-creation strategies in erc-nicks, F. Jason Park, 2023/11/12
- master 4ed6ba90e7c 6/9: Allow opting out of empty message padding in ERC, F. Jason Park, 2023/11/12
- master 583d73e9a0e 7/9: Simplify default text props for ERC input, F. Jason Park, 2023/11/12
- master 1d2aa130cae 8/9: Revive erc-command-indicator as new module, F. Jason Park, 2023/11/12