>From ee66d1ce8f4a89f4c230387ca241cac17ed23c84 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Fri, 24 Nov 2023 16:02:17 -0800 Subject: [PATCH] [29.2] Update ERC version to 5.5.0.29.2 * doc/misc/erc.texi: Bump version. * lisp/erc/erc-backend.el (erc--server-post-connect-hook): Add function to recommend frequent users upgrade. * lisp/erc/erc.el (erc-version): Bump version to 5.5.0.29.2. (erc--recommend-upgrade-on-connect): New function to insert "error notice" recommending users upgrade to the version on GNU ELPA. Do not merge to master. --- doc/misc/erc.texi | 2 +- lisp/erc/erc-backend.el | 3 ++- lisp/erc/erc.el | 21 +++++++++++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 7f26b9ed181..0abf24fe10e 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -2,7 +2,7 @@ @c %**start of header @setfilename ../../info/erc.info @settitle ERC Manual -@set ERCVER 5.5.0.29.1 +@set ERCVER 5.5.0.29.2 @set ERCDIST as distributed with Emacs @value{EMACSVER} @include docstyle.texi @syncodeindex fn cp diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 567443f5329..c4c5d30cdae 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -320,7 +320,8 @@ erc--server-reconnecting and fully removed, modules can switch to leveraging the `permanent-local' property instead.") -(defvar erc--server-post-connect-hook '(erc-networks--warn-on-connect) +(defvar erc--server-post-connect-hook '(erc-networks--warn-on-connect + erc--recommend-upgrade-on-connect) "Functions to run when a network connection is successfully opened. Though internal, this complements `erc-connect-pre-hook' in that it bookends the process rather than the logical connection, which diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index c7e1645ec26..e18cd77c6dc 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -12,7 +12,7 @@ ;; David Edmondson (dme@dme.org) ;; Michael Olson (mwolson@gnu.org) ;; Kelvin White (kwhite@gnu.org) -;; Version: 5.5.0.29.1 +;; Version: 5.5.0.29.2 ;; Package-Requires: ((emacs "27.1") (compat "29.1.3.4")) ;; Keywords: IRC, chat, client, Internet ;; URL: https://www.gnu.org/software/emacs/erc.html @@ -71,7 +71,7 @@ (require 'iso8601) (eval-when-compile (require 'subr-x) (require 'url-parse)) -(defconst erc-version "5.5.0.29.1" +(defconst erc-version "5.5.0.29.2" "This version of ERC.") (defvar erc-official-location @@ -7407,6 +7407,23 @@ erc-handle-irc-url (with-current-buffer server-buffer (erc-cmd-JOIN channel key)))))) +(defun erc--recommend-upgrade-on-connect () + "Insert an upgrade advisory into server buffers when (re)connecting." + (unless erc--target + (let ((erc-button-alist + ;; ERC 5.5 uses `Info-goto-node', which isn't autoloaded. + (cons (list (rx "(info " ?\" (group "(erc) Upgrading") ?\" ")") + 0 t 'info 1) ; unlike plain old `info' + (bound-and-true-p erc-button-alist)))) + (ignore erc-button-alist) + (erc-display-error-notice + nil (concat + "\C-bThis version of ERC is outdated\C-b. The latest release" + " on GNU ELPA contains a host of new fixes and features." + " If you use ERC regularly, please consider upgrading." + " See (info \"(erc) Upgrading\") for details. Network I/O was" + " not involved in bringing you this message."))))) + (provide 'erc) ;; FIXME this is a temporary stopgap for Emacs 29. -- 2.41.0