erc-commit
[Top][All Lists]
Advanced

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

[Erc-commit] [commit][emacs22] Fix toggle of flood control.


From: mwolson
Subject: [Erc-commit] [commit][emacs22] Fix toggle of flood control.
Date: Sun, 14 Oct 2007 00:48:16 -0400

commit bbb59c836b5a7e49c50e8769c644780dcf45de44
Author: Michael Olson <address@hidden>
Date:   Thu Jun 15 02:21:40 2006 +0000

    Fix toggle of flood control.
    
    * erc.el (erc-toggle-flood-control): When the user hits C-c C-f, make
      flood control really toggle, not unconditionally turn off.
    git-archimport-id: address@hidden/erc--main--0--patch-9

diff --git a/ChangeLog b/ChangeLog
index 16ae791..3c17e6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
        * erc.el (erc-active-buffer): If the active buffer has been
        deleted, default to the server buffer.
+       (erc-toggle-flood-control): When the user hits C-c C-f, make flood
+       control really toggle, not unconditionally turn off.
 
 2006-06-12  Michael Olson  <address@hidden>
 
diff --git a/erc.el b/erc.el
index 76ef789..a87aae2 100644
--- a/erc.el
+++ b/erc.el
@@ -5115,13 +5115,16 @@ If ARG is non-nil and not positive, turns CTCP replies 
off."
 (defun erc-toggle-flood-control (&optional arg)
   "Toggle use of flood control on sent messages.
 
-If ARG is non-nil, use flood control.
-If ARG is nil, do not use flood control.
+If ARG is positive, use flood control.
+If ARG is non-nil and not positive, do not use flood control.
 
 See `erc-server-flood-margin' for an explanation of the available
 flood control parameters."
   (interactive "P")
-  (setq erc-flood-protect arg)
+  (cond ((and (numberp arg) (> arg 0))
+        (setq erc-flood-protect t))
+       (arg (setq erc-flood-protect nil))
+       (t (setq erc-flood-protect (not erc-flood-protect))))
   (message "ERC flood control is %s"
           (cond (erc-flood-protect "ON")
                 (t "OFF"))))




reply via email to

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