diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 6d84665873e..ad9719380a4 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -950,15 +950,22 @@ PROCs `process-buffer' is `current-buffer' when this function is called." (unless (string= string "") ;; Ignore empty strings (save-match-data (let* ((tag-list (when (eq (aref string 0) ?@) - (substring string 1 (string-search " " string)))) + (substring string 1 + (if (>= emacs-major-version 28) + (string-search " " string) + (string-match " " string))))) (msg (make-erc-response :unparsed string :tags (when tag-list (erc-parse-tags tag-list)))) (string (if tag-list - (substring string (+ 1 (string-search " " string))) + (substring string (+ 1 (if (>= emacs-major-version 28) + (string-search " " string) + (string-match " " string)))) string)) (posn (if (eq (aref string 0) ?:) - (string-search " " string) + (if (>= emacs-major-version 28) + (string-search " " string) + (string-match " " string)) 0))) (setf (erc-response.sender msg) @@ -968,7 +975,9 @@ PROCs `process-buffer' is `current-buffer' when this function is called." (setf (erc-response.command msg) (let* ((bposn (string-match "[^ \n]" string posn)) - (eposn (string-search " " string bposn))) + (eposn (if (>= emacs-major-version 28) + (string-search " " string bposn) + (string-match " " string bposn)))) (setq posn (and eposn (string-match "[^ \n]" string eposn))) (substring string bposn eposn))) @@ -976,7 +985,9 @@ PROCs `process-buffer' is `current-buffer' when this function is called." (while (and posn (not (eq (aref string posn) ?:))) (push (let* ((bposn posn) - (eposn (string-search " " string bposn))) + (eposn (if (>= emacs-major-version 28) + (string-search " " string bposn) + (string-match " " string bposn)))) (setq posn (and eposn (string-match "[^ \n]" string eposn))) (substring string bposn eposn)) diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index de72624aaa1..df53270831d 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -187,7 +187,9 @@ compared with `erc-nick-equal-p' which is IRC case-insensitive." (plist-get elt prop))) ;; if the property exists and is equal, we continue, else, try the ;; next element of the list - (or (and (eq prop :nick) (string-search "!" val) + (or (and (eq prop :nick) (if (>= emacs-major-version 28) + (string-search "!" val) + (string-match "!" val)) test (string-equal test val)) (and (eq prop :nick) test val diff --git a/lisp/erc/erc-speedbar.el b/lisp/erc/erc-speedbar.el index e61e741302d..84854e3be52 100644 --- a/lisp/erc/erc-speedbar.el +++ b/lisp/erc/erc-speedbar.el @@ -139,7 +139,9 @@ This will add a speedbar major display mode." t)))) (defun erc-speedbar-expand-server (text server indent) - (cond ((string-search "+" text) + (cond ((if (>= emacs-major-version 28) + (string-search "+" text) + (string-match "\\+" text)) (speedbar-change-expand-button-char ?-) (if (speedbar-with-writable (save-excursion @@ -147,7 +149,10 @@ This will add a speedbar major display mode." (erc-speedbar-channel-buttons nil (1+ indent) server))) (speedbar-change-expand-button-char ?-) (speedbar-change-expand-button-char ??))) - ((string-search "-" text) ;we have to contract this node + (;; we have to contract this node + (if (>= emacs-major-version 28) + (string-search "-" text) + (string-match "-" text)) (speedbar-change-expand-button-char ?+) (speedbar-delete-subblock indent)) (t (error "Ooops... not sure what to do"))) @@ -184,7 +189,9 @@ This will add a speedbar major display mode." "For the line matching TEXT, in CHANNEL, expand or contract a line. INDENT is the current indentation level." (cond - ((string-search "+" text) + ((if (>= emacs-major-version 28) + (string-search "+" text) + (string-match "\\+" text)) (speedbar-change-expand-button-char ?-) (speedbar-with-writable (save-excursion @@ -233,7 +240,9 @@ INDENT is the current indentation level." (speedbar-with-writable (dolist (entry names) (erc-speedbar-insert-user entry ?+ (1+ indent)))))))))) - ((string-search "-" text) + ((if (>= emacs-major-version 28) + (string-search "-" text) + (string-match "-" text)) (speedbar-change-expand-button-char ?+) (speedbar-delete-subblock indent)) (t (error "Ooops... not sure what to do"))) @@ -284,7 +293,9 @@ The update is only done when the channel is actually expanded already." (erc-speedbar-expand-channel "+" buffer 1))))) (defun erc-speedbar-expand-user (text token indent) - (cond ((string-search "+" text) + (cond ((if (>= emacs-major-version 28) + (string-search "+" text) + (string-match "\\+" text)) (speedbar-change-expand-button-char ?-) (speedbar-with-writable (save-excursion @@ -307,7 +318,9 @@ The update is only done when the channel is actually expanded already." nil nil nil nil info nil nil nil (1+ indent))))))) - ((string-search "-" text) + ((if (>= emacs-major-version 28) + (string-search "-" text) + (string-match "-" text)) (speedbar-change-expand-button-char ?+) (speedbar-delete-subblock indent)) (t (error "Ooops... not sure what to do"))) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index e0fda41f8ed..b18eb0a228a 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -5587,7 +5587,9 @@ This returns non-nil only if we actually send anything." (when (and (erc-input-sendp state) erc-send-this) (let ((string (erc-input-string state))) - (if (or (string-search "\n" string) + (if (or (if (>= emacs-major-version 28) + (string-search "\n" string) + (string-match "\n" string)) (not (string-match erc-command-regexp string))) (mapc (lambda (line)