[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8f18112: Make some erc function aliases obsolete

From: Lars Ingebrigtsen
Subject: master 8f18112: Make some erc function aliases obsolete
Date: Sun, 2 Aug 2020 01:55:13 -0400 (EDT)

branch: master
commit 8f181124dfc84b9a7fcadb895af6ce2978d8a40e
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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 0950cec..0923ed6 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'."
   (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
@@ -133,7 +133,7 @@ Related variables: `erc-public-away-p' and 
        (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 654fc23..4f3d85b 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
-              (erc-cancel-timer (cdr timer-tuple))
+              (cancel-timer (cdr timer-tuple))
               (setf (cdr (assq buffer erc-server-ping-timer-alist)) 
           ;; 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 
diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el
index c77d5ab..388728b 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 
 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 280d6bf..e4faf6b 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 
 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 1234962..415fb53 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."
     (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."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]