(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)
(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)))
(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))
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
(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")))
"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
(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")))
(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
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")))