summaryrefslogtreecommitdiff
path: root/lisp/erc/erc.el
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2022-07-08 04:58:26 -0700
committerF. Jason Park <jp@neverwas.me>2022-07-27 05:19:09 -0700
commitf6b6614c32f73b0bde3121d39fdfb1d302a97bd8 (patch)
tree34baeb65dd44c4b1eff886bb0c14a5cfb5a130a9 /lisp/erc/erc.el
parentc238f568cddc0502feb058e651907a1baaed3149 (diff)
downloademacs-f6b6614c32f73b0bde3121d39fdfb1d302a97bd8.tar.gz
emacs-f6b6614c32f73b0bde3121d39fdfb1d302a97bd8.tar.bz2
emacs-f6b6614c32f73b0bde3121d39fdfb1d302a97bd8.zip
Add compat from GNU ELPA as a soft dependency in ERC
* lisp/erc/erc-backend.el (erc-parse-server-response, erc--parse-isupport-value): Remove sub-28 compat code involving `string-search'. * lisp/erc/erc-compat.el: Require compat package, but don't error when absent. * lisp/erc/erc-dcc.el (erc-dcc-member): Remove `string-search' compat code. (erc-dcc-unquote-filename): Remove `string-replace' compat code. * lisp/erc/erc-speedbar.el (erc-speedbar-expand-server, erc-speedbar-expand-channel, erc-speedbar-expand-user): Remove `string-search' compat code. * lisp/erc/erc.el: Add compat version 28.1.2.0 to Package-Requires header and require `erc-compat' after other libraries. (erc--valid-local-channel-p): Remove `string-search' compat code. (erc-update-mode-line-buffer): Remove `string-replace' compat code. (erc-message-english-PART): Remove `string-replace' compat code.
Diffstat (limited to 'lisp/erc/erc.el')
-rw-r--r--lisp/erc/erc.el33
1 files changed, 11 insertions, 22 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 3b127bbd492..151d75e7ce1 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -13,7 +13,7 @@
;; Michael Olson (mwolson@gnu.org)
;; Kelvin White (kwhite@gnu.org)
;; Version: 5.4.1
-;; Package-Requires: ((emacs "27.1"))
+;; Package-Requires: ((emacs "27.1") (compat "28.1.2.0"))
;; Keywords: IRC, chat, client, Internet
;; URL: https://www.gnu.org/software/emacs/erc.html
@@ -69,6 +69,8 @@
(require 'iso8601)
(eval-when-compile (require 'subr-x))
+(require 'erc-compat)
+
(defconst erc-version "5.4.1"
"This version of ERC.")
@@ -3519,9 +3521,7 @@ Without SECRET, consult auth-source, possibly passing SERVER as the
"Non-nil when channel is server-local on a network that allows them."
(and-let* (((eq ?& (aref channel 0)))
(chan-types (erc--get-isupport-entry 'CHANTYPES 'single))
- ((if (>= emacs-major-version 28)
- (string-search "&" chan-types)
- (string-match-p "&" chan-types))))))
+ ((string-search "&" chan-types)))))
(defun erc-cmd-JOIN (channel &optional key)
"Join the channel given in CHANNEL, optionally with KEY.
@@ -7005,21 +7005,12 @@ shortened server name instead."
(fill-region (point-min) (point-max))
(buffer-string))))
(setq header-line-format
- (if (>= emacs-major-version 28)
- (string-replace
- "%"
- "%%"
- (if face
- (propertize header 'help-echo help-echo
- 'face face)
- (propertize header 'help-echo help-echo)))
- (replace-regexp-in-string
- "%"
- "%%"
- (if face
- (propertize header 'help-echo help-echo
- 'face face)
- (propertize header 'help-echo help-echo)))))))
+ (string-replace
+ "%"
+ "%%"
+ (if face
+ (propertize header 'help-echo help-echo 'face face)
+ (propertize header 'help-echo help-echo))))))
(t (setq header-line-format
(if face
(propertize header 'face face)
@@ -7304,9 +7295,7 @@ functions."
nick user host channel
(if (not (string= reason ""))
(format ": %s"
- (if (>= emacs-major-version 28)
- (string-replace "%" "%%" reason)
- (replace-regexp-in-string "%" "%%" reason)))
+ (string-replace "%" "%%" reason))
"")))))