From 63cdbd986bb8f841717e2d813df6f75b6b02cf8b Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Sun, 11 Dec 2022 19:16:07 -0800 Subject: ; Really respect browse-url var in erc-compat * lisp/erc/erc-compat.el: Do what was supposed to be done by 75f26646d4a569cfb485de4baddcda66ff44b2c3 "; Be nicer when updating browse-url var in erc-compat". This is the less harmful version of that patch (from bug#59976#8) but without the cl-lib requirement since users may not want to load the main ERC library right away. * lisp/erc/erc.el: Clarify some comments regarding the core API. --- lisp/erc/erc-compat.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lisp/erc/erc-compat.el') diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el index 77625398abd..fdcb146d42a 100644 --- a/lisp/erc/erc-compat.el +++ b/lisp/erc/erc-compat.el @@ -391,11 +391,11 @@ If START or END is negative, it counts from the end." (cond ((fboundp 'browse-url-irc)) ; 29 ((boundp 'browse-url-default-handlers) ; 28 - (setf (alist-get "\\`irc6?s?://" browse-url-default-handlers - nil nil (lambda (a _) - (and (stringp a) - (string-match-p a "irc://localhost")))) - #'erc-compat--29-browse-url-irc)) + (add-to-list 'browse-url-default-handlers + '("\\`irc6?s?://" . erc-compat--29-browse-url-irc) + nil (lambda (_ a) + (and (stringp (car-safe a)) + (string-match-p (car a) "irc://localhost"))))) ((boundp 'browse-url-browser-function) ; 27 (require 'browse-url) (let ((existing browse-url-browser-function)) -- cgit v1.2.1 From 19d00fab9aaf28dae6af5786f6e22b8558b10eea Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Wed, 28 Dec 2022 06:18:01 -0800 Subject: Avoid "already compiled" warning in erc-compat * lisp/erc/erc-compat.el (erc-compat--29-auth-source-pass-search): Don't `byte-compile' sub-29 secrets wrapper. This was especially noisy in tests. Ditch closed-over vars via HOF instead of suppressing because compiling emits "unused lexical" warning on Emacs 27. --- lisp/erc/erc-compat.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/erc/erc-compat.el') diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el index fdcb146d42a..864c5882cf2 100644 --- a/lisp/erc/erc-compat.el +++ b/lisp/erc/erc-compat.el @@ -261,7 +261,7 @@ If START or END is negative, it counts from the end." (when-let* ((s (plist-get e :secret)) (v (auth-source--obfuscate s))) (setf (plist-get e :secret) - (byte-compile (lambda () (auth-source--deobfuscate v))))) + (apply-partially #'auth-source--deobfuscate v))) (push e out))) rv))) -- cgit v1.2.1