From 8f181124dfc84b9a7fcadb895af6ce2978d8a40e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 2 Aug 2020 07:55:02 +0200 Subject: [PATCH] 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. --- lisp/erc/erc-autoaway.el | 4 ++-- lisp/erc/erc-backend.el | 11 ++++++----- lisp/erc/erc-compat.el | 10 ++++++---- lisp/erc/erc-join.el | 4 ++-- lisp/erc/erc-networks.el | 4 ++-- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/lisp/erc/erc-autoaway.el b/lisp/erc/erc-autoaway.el index 0950cec4f7f..0923ed6e735 100644 --- a/lisp/erc/erc-autoaway.el +++ b/lisp/erc/erc-autoaway.el @@ -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)))) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 654fc23ae7d..4f3d85ba3c8 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -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))) diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el index c77d5abf2e4..388728b04a0 100644 --- a/lisp/erc/erc-compat.el +++ b/lisp/erc/erc-compat.el @@ -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) diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index 280d6bfe0f1..e4faf6bd797 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -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) diff --git a/lisp/erc/erc-networks.el b/lisp/erc/erc-networks.el index 1234962c51c..415fb53fee0 100644 --- a/lisp/erc/erc-networks.el +++ b/lisp/erc/erc-networks.el @@ -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." -- 2.39.2