Re: bug#56514: 29.0.50; Improve ERC's URI scheme integration for irc:// links

"J.P." <[email protected]>
Newsgroups gmane.emacs.erc.general
Message-ID <[email protected]>
Quick note:

> diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el
> index 03bd8f1352..340d90ba96 100644
> --- a/lisp/erc/erc-compat.el
> +++ b/lisp/erc/erc-compat.el
> @@ -32,6 +32,7 @@
>  ;;; Code:
> [...] 
> +
> +(when (< emacs-major-version 29)
> +  (unless (assoc "\\`irc6?s?://" browse-url-default-handlers)
> +    (push '("\\`irc6?s?://" . erc-compat--29-browse-url-irc)
> +          browse-url-default-handlers)))

This won't work on 27, so we'll probably have to do something like

  (cond ((fboundp 'browse-url-irc)) ; 29
        ((boundp 'browse-url-default-handlers) ; 28
         (cl-pushnew '("\\`irc6?s?://" . erc-compat--29-browse-url-irc)
                     browse-url-default-handlers))
        ((boundp 'browse-url-browser-function) ; 27
         (require 'browse-url)
         (let ((existing browse-url-browser-function))
           (setq browse-url-browser-function
                 (if (functionp existing)
                     (lambda (u &rest r)
                       (apply (if (string-match-p "\\`irc6?s?://" u)
                                  #'erc-compat--29-browse-url-irc
                                existing)
                              u r))
                   (cons '("\\`irc6?s?://" . erc-compat--29-browse-url-irc)
                         existing))))))

> +
>  (provide 'erc-compat)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.