Commit 8f181124 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Make some erc function aliases obsolete

* lisp/erc/erc-networks.el (erc-current-network):
* lisp/erc/erc-join.el (erc-autojoin-channels-delayed):
* lisp/erc/erc-backend.el (erc-server-setup-periodical-ping)
(erc-server-send-ping, erc-server-send-queue):
* lisp/erc/erc-autoaway.el (erc-autoaway-reestablish-idletimer)
(autoaway): Adjust callers.

* lisp/erc/erc-compat.el (erc-with-selected-window)
(erc-cancel-timer, erc-make-obsolete)
(erc-make-obsolete-variable): Make these aliases obsolete.
parent 88244874
Pipeline #6195 failed with stage
in 65 minutes and 35 seconds
......@@ -54,7 +54,7 @@ If `erc-autoaway-idle-method' is `emacs', you must call this
function each time you change `erc-autoaway-idle-seconds'."
(interactive)
(when erc-autoaway-idletimer
(erc-cancel-timer erc-autoaway-idletimer))
(cancel-timer erc-autoaway-idletimer))
(setq erc-autoaway-idletimer
(run-with-idle-timer erc-autoaway-idle-seconds
t
......@@ -133,7 +133,7 @@ Related variables: `erc-public-away-p' and `erc-away-nickname'."
(remove-hook 'erc-after-connect 'erc-autoaway-insinuate-maybe)
(remove-hook 'erc-disconnected-hook 'erc-autoaway-remove-maybe))
((eq erc-autoaway-idle-method 'emacs)
(erc-cancel-timer erc-autoaway-idletimer)
(cancel-timer erc-autoaway-idletimer)
(setq erc-autoaway-idletimer nil)))
(remove-hook 'erc-timer-hook 'erc-autoaway-possibly-set-away)
(remove-hook 'erc-server-305-functions 'erc-autoaway-reset-indicators))))
......
......@@ -520,7 +520,8 @@ If no subword-mode is active, then this is
"Set up a timer to periodically ping the current server.
The current buffer is given by BUFFER."
(with-current-buffer buffer
(and erc-server-ping-handler (erc-cancel-timer erc-server-ping-handler))
(when erc-server-ping-handler
(cancel-timer erc-server-ping-handler))
(when erc-server-send-ping-interval
(setq erc-server-ping-handler (run-with-timer
4 erc-server-send-ping-interval
......@@ -533,7 +534,7 @@ The current buffer is given by BUFFER."
(if timer-tuple
;; this buffer already has a timer. Cancel it and set the new one
(progn
(erc-cancel-timer (cdr timer-tuple))
(cancel-timer (cdr timer-tuple))
(setf (cdr (assq buffer erc-server-ping-timer-alist)) erc-server-ping-handler))
;; no existing timer for this buffer. Add new one
......@@ -731,7 +732,7 @@ Conditionally try to reconnect and take appropriate action."
(erc-with-all-buffers-of-server cproc nil
(setq erc-server-connected nil))
(when erc-server-ping-handler
(progn (erc-cancel-timer erc-server-ping-handler)
(progn (cancel-timer erc-server-ping-handler)
(setq erc-server-ping-handler nil)))
(run-hook-with-args 'erc-disconnected-hook
(erc-current-nick) (system-name) "")
......@@ -856,7 +857,7 @@ Additionally, detect whether the IRC process has hung."
;; remove timer if the server buffer has been killed
(let ((timer (assq buf erc-server-ping-timer-alist)))
(when timer
(erc-cancel-timer (cdr timer))
(cancel-timer (cdr timer))
(setcdr timer nil)))))
;; From Circe
......@@ -868,7 +869,7 @@ protection algorithm."
(with-current-buffer buffer
(let ((now (current-time)))
(when erc-server-flood-timer
(erc-cancel-timer erc-server-flood-timer)
(cancel-timer erc-server-flood-timer)
(setq erc-server-flood-timer nil))
(when (time-less-p erc-server-flood-last-message now)
(setq erc-server-flood-last-message (erc-emacs-time-to-erc-time now)))
......
......@@ -79,10 +79,12 @@ START is the beginning position of the last match (see `match-beginning').
See `replace-match' for explanations of FIXEDCASE and LITERAL."
(replace-match newtext fixedcase literal string subexp))
(defalias 'erc-with-selected-window 'with-selected-window)
(defalias 'erc-cancel-timer 'cancel-timer)
(defalias 'erc-make-obsolete 'make-obsolete)
(defalias 'erc-make-obsolete-variable 'make-obsolete-variable)
(define-obsolete-function-alias 'erc-with-selected-window
#'with-selected-window "28.1")
(define-obsolete-function-alias 'erc-cancel-timer #'cancel-timer "28.1")
(define-obsolete-function-alias 'erc-make-obsolete #'make-obsolete "28.1")
(define-obsolete-function-alias 'erc-make-obsolete-variable
#'make-obsolete-variable "28.1")
;; Provide a simpler replacement for `member-if'
(defun erc-member-if (predicate list)
......
......@@ -113,7 +113,7 @@ servers, presumably in the same domain."
This is called from a timer set up by `erc-autojoin-channels'."
(if erc--autojoin-timer
(setq erc--autojoin-timer
(erc-cancel-timer erc--autojoin-timer)))
(cancel-timer erc--autojoin-timer)))
(with-current-buffer buffer
;; Don't kick of another delayed autojoin or try to wait for
;; another ident response:
......@@ -127,7 +127,7 @@ This is called from a timer set up by `erc-autojoin-channels'."
This function is run from `erc-nickserv-identified-hook'."
(if erc--autojoin-timer
(setq erc--autojoin-timer
(erc-cancel-timer erc--autojoin-timer)))
(cancel-timer erc--autojoin-timer)))
(when (eq erc-autojoin-timing 'ident)
(let ((server (or erc-session-server erc-server-announced-name))
(joined (mapcar (lambda (buf)
......
......@@ -756,8 +756,8 @@ Return the name of this server's network as a symbol."
(erc-with-server-buffer
(intern (downcase (symbol-name erc-network)))))
(erc-make-obsolete 'erc-current-network 'erc-network
"Obsolete since erc-networks 1.5")
(make-obsolete 'erc-current-network 'erc-network
"Obsolete since erc-networks 1.5")
(defun erc-network-name ()
"Return the name of the current network as a string."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment