From MAILER-DAEMON Sat Aug 11 21:55:57 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1IK2gO-0005dg-UJ
	for mharc-erc-commit@gnu.org; Sat, 11 Aug 2007 21:55:56 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IK2gM-0005dZ-Jy
	for erc-commit@gnu.org; Sat, 11 Aug 2007 21:55:54 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IK2gL-0005dN-6b
	for erc-commit@gnu.org; Sat, 11 Aug 2007 21:55:54 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IK2gL-0005dK-0k
	for erc-commit@gnu.org; Sat, 11 Aug 2007 21:55:53 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1IK2gK-0000R6-N5
	for erc-commit@gnu.org; Sat, 11 Aug 2007 21:55:52 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1IK2hd-0000rE-3d
	for erc-commit@gnu.org; Sat, 11 Aug 2007 21:57:13 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1IK2hd-0000rE-3d@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Sat, 11 Aug 2007 21:57:13 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] erc-ident: Fix buggy interaction with
	Freenode
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 12 Aug 2007 01:55:55 -0000

commit 80e200e8a7ca8d27a712251627277f7c481382a1
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Sat Aug 11 21:27:27 2007 -0400

    erc-ident: Fix buggy interaction with Freenode
    
    2007-08-12  Michael Olson  <mwolson@gnu.org>
    
    	* erc-identd.el (erc-identd-filter): Instead of sending an EOF
    	character, which now confuses freenode, stop the server process,
    	so that no new connections are accepted, and kill the current
    	client process.

diff --git a/ChangeLog b/ChangeLog
index 79e5f54..ef5a24d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-08-12  Michael Olson  <mwolson@gnu.org>
+
+	* erc-identd.el (erc-identd-filter): Instead of sending an EOF
+	character, which now confuses freenode, stop the server process,
+	so that no new connections are accepted, and kill the current
+	client process.
+
 2007-07-29  Michael Olson  <mwolson@gnu.org>
 
 	* erc-list.el: Relicense to GPLv3.  Since the file was already
diff --git a/erc-identd.el b/erc-identd.el
index 8fab26d..dcbe463 100644
--- a/erc-identd.el
+++ b/erc-identd.el
@@ -74,7 +74,8 @@ This can be either a string or a number."
 		     (format "%s, %s : USERID : %s : %s\n"
 			     port-on-server port-on-client
 			     system-type (user-login-name)))
-	(process-send-eof erc-identd-process)))))
+	(stop-process erc-identd-process)
+	(delete-process proc)))))
 
 ;;;###autoload
 (defun erc-identd-start (&optional port)



From MAILER-DAEMON Mon Aug 13 21:29:00 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1IKlDQ-0003wa-Mh
	for mharc-erc-commit@gnu.org; Mon, 13 Aug 2007 21:29:00 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IKlDO-0003tn-Cq
	for erc-commit@gnu.org; Mon, 13 Aug 2007 21:28:58 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IKlDN-0003rh-2I
	for erc-commit@gnu.org; Mon, 13 Aug 2007 21:28:57 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IKlDM-0003rV-RY
	for erc-commit@gnu.org; Mon, 13 Aug 2007 21:28:56 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1IKlDM-0002VH-LH
	for erc-commit@gnu.org; Mon, 13 Aug 2007 21:28:56 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1IKlEf-0005Lx-C8
	for erc-commit@gnu.org; Mon, 13 Aug 2007 21:30:17 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1IKlEf-0005Lx-C8@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Mon, 13 Aug 2007 21:30:17 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] Fix error in erc-command-no-process-p
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Aug 2007 01:28:58 -0000

commit c4a6e3578e2cb9780d69f3a3dce2ea394eaa8e41
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Mon Aug 13 21:23:57 2007 -0400

    Fix error in erc-command-no-process-p
    
    * erc.el (erc-command-no-process-p): Fix bug: the return value of
      erc-extract-command-from-line is a list rather than a single symbol.
      Thanks to jbms for the report.

diff --git a/ChangeLog b/ChangeLog
index ef5a24d..4c602d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-08-14  Michael Olson  <mwolson@gnu.org>
+
+	* erc.el (erc-command-no-process-p): Fix bug: the return value of
+	erc-extract-command-from-line is a list rather than a single
+	symbol.  Thanks to jbms for the report.
+
 2007-08-12  Michael Olson  <mwolson@gnu.org>
 
 	* erc-identd.el (erc-identd-filter): Instead of sending an EOF
diff --git a/erc.el b/erc.el
index 324a820..fd709ed 100644
--- a/erc.el
+++ b/erc.el
@@ -2496,7 +2496,8 @@ See also `erc-server-send'."
 is not alive, nil otherwise."
   (let ((fun (erc-extract-command-from-line str)))
     (and fun
-	 (get fun 'process-not-needed))))
+	 (symbolp (car fun))
+	 (get (car fun) 'process-not-needed))))
 
 (defun erc-command-name (cmd)
   "For CMD being the function name of a ERC command, something like



From MAILER-DAEMON Mon Aug 13 21:58:57 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1IKlgP-0000Zk-Ak
	for mharc-erc-commit@gnu.org; Mon, 13 Aug 2007 21:58:57 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IKlgO-0000ZZ-Kg
	for erc-commit@gnu.org; Mon, 13 Aug 2007 21:58:56 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IKlgK-0000Tt-0L
	for erc-commit@gnu.org; Mon, 13 Aug 2007 21:58:56 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IKlgJ-0000TI-R5
	for erc-commit@gnu.org; Mon, 13 Aug 2007 21:58:51 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1IKlgJ-0000Ze-3i
	for erc-commit@gnu.org; Mon, 13 Aug 2007 21:58:51 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1IKlhd-0006rr-Oo
	for erc-commit@gnu.org; Mon, 13 Aug 2007 22:00:13 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1IKlhd-0006rr-Oo@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Mon, 13 Aug 2007 22:00:13 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] Try to fix bug with /reconnect and a
	killed server buffer
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Aug 2007 01:58:56 -0000

commit 75373f6d2bfb8a2245d4848a402bc6e42f6784ea
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Mon Aug 13 21:54:48 2007 -0400

    Try to fix bug with /reconnect and a killed server buffer
    
    * erc-backend.el (erc-server-reconnect): If the server buffer has been
      killed, use the current buffer instead.  If the current buffer is not
      an ERC buffer, give an error.  This fixes a bug when /reconnect is run
      from a channel buffer whose server buffer has been deleted.  Thanks to
      jbms for the report.
    
    * erc.el (erc-cmd-RECONNECT): Use simpler logic, and use buffer-live-p
      rather than bufferp.

diff --git a/ChangeLog b/ChangeLog
index 4c602d6..50b8dd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,16 @@
 2007-08-14  Michael Olson  <mwolson@gnu.org>
 
+	* erc-backend.el (erc-server-reconnect): If the server buffer has
+	been killed, use the current buffer instead.  If the current
+	buffer is not an ERC buffer, give an error.  This fixes a bug when
+	/reconnect is run from a channel buffer whose server buffer has
+	been deleted.  Thanks to jbms for the report.
+
 	* erc.el (erc-command-no-process-p): Fix bug: the return value of
 	erc-extract-command-from-line is a list rather than a single
 	symbol.  Thanks to jbms for the report.
+	(erc-cmd-RECONNECT): Use simpler logic, and use buffer-live-p
+	rather than bufferp.
 
 2007-08-12  Michael Olson  <mwolson@gnu.org>
 
diff --git a/erc-backend.el b/erc-backend.el
index d0ec812..75bef89 100644
--- a/erc-backend.el
+++ b/erc-backend.el
@@ -550,11 +550,12 @@ We will store server variables in the buffer given by BUFFER."
 (defun erc-server-reconnect ()
 "Reestablish the current IRC connection.
 Make sure you are in an ERC buffer when running this."
-  (let ((server (erc-server-buffer)))
-    (unless (and server
-                 (buffer-live-p server))
-      (error "Couldn't switch to server buffer"))
-    (with-current-buffer server
+  (let ((buffer (erc-server-buffer)))
+    (unless (buffer-live-p buffer)
+      (if (eq major-mode 'erc-mode)
+          (error "Reconnect must be run from an ERC buffer")
+        (setq buffer (current-buffer))))
+    (with-current-buffer buffer
       (erc-update-mode-line)
       (erc-set-active-buffer (current-buffer))
       (setq erc-server-last-sent-time 0)
diff --git a/erc.el b/erc.el
index fd709ed..5d29ace 100644
--- a/erc.el
+++ b/erc.el
@@ -3256,9 +3256,11 @@ the message given by REASON."
 
 (defun erc-cmd-RECONNECT ()
   "Try to reconnect to the current IRC server."
-  (let ((buffer (or (erc-server-buffer) (current-buffer)))
+  (let ((buffer (erc-server-buffer))
 	(process nil))
-    (with-current-buffer (if (bufferp buffer) buffer (current-buffer))
+    (unless (buffer-live-p buffer)
+      (setq buffer (current-buffer)))
+    (with-current-buffer buffer
       (setq erc-server-quitting nil)
       (setq erc-server-reconnecting t)
       (setq erc-server-reconnect-count 0)



From MAILER-DAEMON Mon Aug 13 23:38:55 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1IKnF9-0006KF-3w
	for mharc-erc-commit@gnu.org; Mon, 13 Aug 2007 23:38:55 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IKnF7-0006J1-8G
	for erc-commit@gnu.org; Mon, 13 Aug 2007 23:38:53 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IKnF5-0006Hj-P3
	for erc-commit@gnu.org; Mon, 13 Aug 2007 23:38:52 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IKnF5-0006Ha-KD
	for erc-commit@gnu.org; Mon, 13 Aug 2007 23:38:51 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1IKnF5-0004L6-9u
	for erc-commit@gnu.org; Mon, 13 Aug 2007 23:38:51 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1IKnGP-0005NE-RO
	for erc-commit@gnu.org; Mon, 13 Aug 2007 23:40:13 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1IKnGP-0005NE-RO@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Mon, 13 Aug 2007 23:40:13 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] Be more careful about the current
	buffer in erc-process-sentinel-1
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Aug 2007 03:38:53 -0000

commit 590370e8ff611b30868ba0e73127425729275abf
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Mon Aug 13 23:34:18 2007 -0400

    Be more careful about the current buffer in erc-process-sentinel-1
    
    * erc-backend.el (erc-process-sentinel-1): Take server buffer as an
      argument, so that we can make sure that it is current.  If it is
      deleted during a reconnect attempt, stop trying to reconnect.
      (erc-process-sentinel): Pass buffer to erc-process-sentinel-1.

diff --git a/ChangeLog b/ChangeLog
index 50b8dd4..b0dce79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
 	buffer is not an ERC buffer, give an error.  This fixes a bug when
 	/reconnect is run from a channel buffer whose server buffer has
 	been deleted.  Thanks to jbms for the report.
+	(erc-process-sentinel-1): Take server buffer as an argument, so
+	that we can make sure that it is current.  If it is deleted during
+	a reconnect attempt, stop trying to reconnect.
+	(erc-process-sentinel): Pass buffer to erc-process-sentinel-1.
 
 	* erc.el (erc-command-no-process-p): Fix bug: the return value of
 	erc-extract-command-from-line is a list rather than a single
diff --git a/erc-backend.el b/erc-backend.el
index 75bef89..463bffa 100644
--- a/erc-backend.el
+++ b/erc-backend.el
@@ -610,39 +610,42 @@ EVENT is the message received from the closed connection process."
            ;; open-network-stream-nowait error for connection refused
            (not (string-match "^failed with code 111" event)))))
 
-(defun erc-process-sentinel-1 (event)
+(defun erc-process-sentinel-1 (event buffer)
   "Called when `erc-process-sentinel' has decided that we're disconnecting.
 Determine whether user has quit or whether erc has been terminated.
 Conditionally try to reconnect and take appropriate action."
-  (if erc-server-quitting
-      ;; normal quit
-      (progn
-        (erc-display-message nil 'error (current-buffer) 'finished)
-        (when erc-kill-server-buffer-on-quit
-          (set-buffer-modified-p nil)
-          (kill-buffer (current-buffer))))
-    ;; unexpected disconnect
-    (let ((again t))
-      (while again
-        (setq again nil)
-        (erc-display-message nil 'error (current-buffer)
-                             (if (erc-server-reconnect-p event)
-                                 'disconnected
-                               'disconnected-noreconnect))
-        (if (erc-server-reconnect-p event)
-            (condition-case err
-                (progn
-                  (setq erc-server-reconnecting nil)
-                  (erc-server-reconnect)
-                  (setq erc-server-reconnect-count 0))
-              (error (when (integerp erc-server-reconnect-attempts)
-                       (setq erc-server-reconnect-count
-                             (1+ erc-server-reconnect-count))
-                       (sit-for erc-server-reconnect-timeout)
-                       (setq again t))))
-          ;; terminate, do not reconnect
+  (with-current-buffer buffer
+    (if erc-server-quitting
+        ;; normal quit
+        (progn
+          (erc-display-message nil 'error (current-buffer) 'finished)
+          (when erc-kill-server-buffer-on-quit
+            (set-buffer-modified-p nil)
+            (kill-buffer (current-buffer))))
+      ;; unexpected disconnect
+      (let ((again t))
+        (while again
+          (setq again nil)
           (erc-display-message nil 'error (current-buffer)
-                               'terminated ?e event))))))
+                               (if (erc-server-reconnect-p event)
+                                   'disconnected
+                                 'disconnected-noreconnect))
+          (if (erc-server-reconnect-p event)
+              (condition-case err
+                  (progn
+                    (setq erc-server-reconnecting nil)
+                    (erc-server-reconnect)
+                    (setq erc-server-reconnect-count 0))
+                (error (when (buffer-live-p buffer)
+                         (set-buffer buffer)
+                         (when (integerp erc-server-reconnect-attempts)
+                           (setq erc-server-reconnect-count
+                                 (1+ erc-server-reconnect-count))
+                           (sit-for erc-server-reconnect-timeout)
+                           (setq again t)))))
+            ;; terminate, do not reconnect
+            (erc-display-message nil 'error (current-buffer)
+                                 'terminated ?e event)))))))
 
 (defun erc-process-sentinel (cproc event)
   "Sentinel function for ERC process."
@@ -669,7 +672,7 @@ Conditionally try to reconnect and take appropriate action."
         (delete-region (point) (point-max))
         ;; Decide what to do with the buffer
         ;; Restart if disconnected
-        (erc-process-sentinel-1 event)
+        (erc-process-sentinel-1 event buf)
         ;; Make sure we don't write to the buffer if it has been
         ;; killed
         (when (buffer-live-p buf)



From MAILER-DAEMON Tue Aug 14 00:09:10 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1IKniQ-0007Jy-0l
	for mharc-erc-commit@gnu.org; Tue, 14 Aug 2007 00:09:10 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IKniP-0007Il-97
	for erc-commit@gnu.org; Tue, 14 Aug 2007 00:09:09 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IKniN-0007EM-En
	for erc-commit@gnu.org; Tue, 14 Aug 2007 00:09:08 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IKniN-0007Dp-1h
	for erc-commit@gnu.org; Tue, 14 Aug 2007 00:09:07 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1IKniM-0002sz-Lh
	for erc-commit@gnu.org; Tue, 14 Aug 2007 00:09:06 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1IKnjg-0007MX-N0
	for erc-commit@gnu.org; Tue, 14 Aug 2007 00:10:28 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1IKnjg-0007MX-N0@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Tue, 14 Aug 2007 00:10:28 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] Fix bug where reconnect was not
	happening when erc-server-reconnect-attempts was t
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Aug 2007 04:09:09 -0000

commit 7e78c9918ff40b5a17c517976fc807db4d1534e7
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Mon Aug 13 23:59:26 2007 -0400

    Fix bug where reconnect was not happening when erc-server-reconnect-attempts was t
    
    * erc-backend.el (erc-process-sentinel-1): Fix bug where reconnect was
      not happening when erc-server-reconnect-attempts was t.  Call
      erc-server-reconnect-p only once per loop iteration.

diff --git a/ChangeLog b/ChangeLog
index b0dce79..38cfe66 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,7 +7,9 @@
 	been deleted.  Thanks to jbms for the report.
 	(erc-process-sentinel-1): Take server buffer as an argument, so
 	that we can make sure that it is current.  If it is deleted during
-	a reconnect attempt, stop trying to reconnect.
+	a reconnect attempt, stop trying to reconnect.  Fix bug where
+	reconnect was not happening when erc-server-reconnect-attempts was
+	t.  Call erc-server-reconnect-p only once per loop iteration.
 	(erc-process-sentinel): Pass buffer to erc-process-sentinel-1.
 
 	* erc.el (erc-command-no-process-p): Fix bug: the return value of
diff --git a/erc-backend.el b/erc-backend.el
index 463bffa..9e5279e 100644
--- a/erc-backend.el
+++ b/erc-backend.el
@@ -623,14 +623,15 @@ Conditionally try to reconnect and take appropriate action."
             (set-buffer-modified-p nil)
             (kill-buffer (current-buffer))))
       ;; unexpected disconnect
-      (let ((again t))
+      (let ((again t)
+            reconnect-p)
         (while again
           (setq again nil)
+          (setq reconnect-p (erc-server-reconnect-p event))
           (erc-display-message nil 'error (current-buffer)
-                               (if (erc-server-reconnect-p event)
-                                   'disconnected
+                               (if reconnect-p 'disconnected
                                  'disconnected-noreconnect))
-          (if (erc-server-reconnect-p event)
+          (if reconnect-p
               (condition-case err
                   (progn
                     (setq erc-server-reconnecting nil)
@@ -640,9 +641,11 @@ Conditionally try to reconnect and take appropriate action."
                          (set-buffer buffer)
                          (when (integerp erc-server-reconnect-attempts)
                            (setq erc-server-reconnect-count
-                                 (1+ erc-server-reconnect-count))
-                           (sit-for erc-server-reconnect-timeout)
-                           (setq again t)))))
+                                 (1+ erc-server-reconnect-count)))
+                         ;; TODO: Make this use a one-time timer
+                         ;; instead of sit-for
+                         (sit-for erc-server-reconnect-timeout)
+                         (setq again t))))
             ;; terminate, do not reconnect
             (erc-display-message nil 'error (current-buffer)
                                  'terminated ?e event)))))))



From MAILER-DAEMON Tue Aug 14 00:58:55 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1IKoUZ-0001Ev-NO
	for mharc-erc-commit@gnu.org; Tue, 14 Aug 2007 00:58:55 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IKoUX-0001DO-82
	for erc-commit@gnu.org; Tue, 14 Aug 2007 00:58:53 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IKoUV-0001BV-UB
	for erc-commit@gnu.org; Tue, 14 Aug 2007 00:58:51 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IKoUV-0001B7-IG
	for erc-commit@gnu.org; Tue, 14 Aug 2007 00:58:51 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1IKoUV-0004c0-0B
	for erc-commit@gnu.org; Tue, 14 Aug 2007 00:58:51 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1IKoVp-0001wl-IG
	for erc-commit@gnu.org; Tue, 14 Aug 2007 01:00:13 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1IKoVp-0001wl-IG@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Tue, 14 Aug 2007 01:00:13 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] Split erc-process-sentinel-2 from
	erc-process-sentinel-1
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Aug 2007 04:58:53 -0000

commit a3dcacd0b817d6ca18d3b96ae04515535ca71e0c
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Tue Aug 14 00:34:31 2007 -0400

    Split erc-process-sentinel-2 from erc-process-sentinel-1
    
    * erc-backend.el (erc-process-sentinel-2): New function split from
      erc-process-sentinel-1.

diff --git a/ChangeLog b/ChangeLog
index 38cfe66..1ad7eb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,8 @@
 	reconnect was not happening when erc-server-reconnect-attempts was
 	t.  Call erc-server-reconnect-p only once per loop iteration.
 	(erc-process-sentinel): Pass buffer to erc-process-sentinel-1.
+	(erc-process-sentinel-2): New function split from
+	erc-process-sentinel-1.
 
 	* erc.el (erc-command-no-process-p): Fix bug: the return value of
 	erc-extract-command-from-line is a list rather than a single
diff --git a/erc-backend.el b/erc-backend.el
index 9e5279e..1f2fc0c 100644
--- a/erc-backend.el
+++ b/erc-backend.el
@@ -610,6 +610,36 @@ EVENT is the message received from the closed connection process."
            ;; open-network-stream-nowait error for connection refused
            (not (string-match "^failed with code 111" event)))))
 
+(defun erc-process-sentinel-2 (event buffer)
+  "Called when `erc-process-sentinel-1' has detected an unexpected disconnect."
+  (with-current-buffer buffer
+    (let ((again t)
+          reconnect-p)
+      (while again
+        (setq again nil)
+        (setq reconnect-p (erc-server-reconnect-p event))
+        (erc-display-message nil 'error (current-buffer)
+                             (if reconnect-p 'disconnected
+                               'disconnected-noreconnect))
+        (if reconnect-p
+            (condition-case err
+                (progn
+                  (setq erc-server-reconnecting nil)
+                  (erc-server-reconnect)
+                  (setq erc-server-reconnect-count 0))
+              (error (when (buffer-live-p buffer)
+                       (set-buffer buffer)
+                       (when (integerp erc-server-reconnect-attempts)
+                         (setq erc-server-reconnect-count
+                               (1+ erc-server-reconnect-count)))
+                       ;; TODO: Make this use a one-time timer
+                       ;; instead of sit-for
+                       (sit-for erc-server-reconnect-timeout)
+                       (setq again t))))
+          ;; terminate, do not reconnect
+          (erc-display-message nil 'error (current-buffer)
+                               'terminated ?e event))))))
+
 (defun erc-process-sentinel-1 (event buffer)
   "Called when `erc-process-sentinel' has decided that we're disconnecting.
 Determine whether user has quit or whether erc has been terminated.
@@ -623,32 +653,7 @@ Conditionally try to reconnect and take appropriate action."
             (set-buffer-modified-p nil)
             (kill-buffer (current-buffer))))
       ;; unexpected disconnect
-      (let ((again t)
-            reconnect-p)
-        (while again
-          (setq again nil)
-          (setq reconnect-p (erc-server-reconnect-p event))
-          (erc-display-message nil 'error (current-buffer)
-                               (if reconnect-p 'disconnected
-                                 'disconnected-noreconnect))
-          (if reconnect-p
-              (condition-case err
-                  (progn
-                    (setq erc-server-reconnecting nil)
-                    (erc-server-reconnect)
-                    (setq erc-server-reconnect-count 0))
-                (error (when (buffer-live-p buffer)
-                         (set-buffer buffer)
-                         (when (integerp erc-server-reconnect-attempts)
-                           (setq erc-server-reconnect-count
-                                 (1+ erc-server-reconnect-count)))
-                         ;; TODO: Make this use a one-time timer
-                         ;; instead of sit-for
-                         (sit-for erc-server-reconnect-timeout)
-                         (setq again t))))
-            ;; terminate, do not reconnect
-            (erc-display-message nil 'error (current-buffer)
-                                 'terminated ?e event)))))))
+      (erc-process-sentinel-2 event buffer))))
 
 (defun erc-process-sentinel (cproc event)
   "Sentinel function for ERC process."



From MAILER-DAEMON Tue Aug 14 00:58:56 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1IKoUZ-0001FK-VS
	for mharc-erc-commit@gnu.org; Tue, 14 Aug 2007 00:58:56 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IKoUX-0001DP-A5
	for erc-commit@gnu.org; Tue, 14 Aug 2007 00:58:53 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IKoUW-0001C5-75
	for erc-commit@gnu.org; Tue, 14 Aug 2007 00:58:52 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IKoUV-0001B8-IQ
	for erc-commit@gnu.org; Tue, 14 Aug 2007 00:58:51 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1IKoUV-0004c2-2B
	for erc-commit@gnu.org; Tue, 14 Aug 2007 00:58:51 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1IKoVp-0001xC-LE
	for erc-commit@gnu.org; Tue, 14 Aug 2007 01:00:13 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1IKoVp-0001xC-LE@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Tue, 14 Aug 2007 01:00:13 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] Use better algorithm for enforcing a
	timeout between reconnect attempts
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Aug 2007 04:58:53 -0000

commit 4bb22757c7656407b0c076d481a88c59cf2cd443
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Tue Aug 14 00:54:32 2007 -0400

    Use better algorithm for enforcing a timeout between reconnect attempts
    
    * erc-backend.el (erc-process-sentinel-2): If we are instructed to try
      connecting indefinitely, tell the user that they can stop this by
      killing the server buffer.  Call the process sentinel by means of
      run-at-time, so that there is time to kill the buffer if need be; this
      also removes the need for a while loop.  Refuse to reconnect again if
      erc-server-reconnect-timeout is not an integer.

diff --git a/ChangeLog b/ChangeLog
index 1ad7eb7..b957b34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,13 +6,19 @@
 	/reconnect is run from a channel buffer whose server buffer has
 	been deleted.  Thanks to jbms for the report.
 	(erc-process-sentinel-1): Take server buffer as an argument, so
-	that we can make sure that it is current.  If it is deleted during
-	a reconnect attempt, stop trying to reconnect.  Fix bug where
-	reconnect was not happening when erc-server-reconnect-attempts was
-	t.  Call erc-server-reconnect-p only once per loop iteration.
+	that we can make sure that it is current.
 	(erc-process-sentinel): Pass buffer to erc-process-sentinel-1.
 	(erc-process-sentinel-2): New function split from
-	erc-process-sentinel-1.
+	erc-process-sentinel-1.  If server buffer is deleted during a
+	reconnect attempt, stop trying to reconnect.  Fix bug where
+	reconnect was not happening when erc-server-reconnect-attempts was
+	t.  Call erc-server-reconnect-p only once each time.  If we are
+	instructed to try connecting indefinitely, tell the user that they
+	can stop this by killing the server buffer.  Call the process
+	sentinel by means of run-at-time, so that there is time to kill
+	the buffer if need be; this also removes the need for a while
+	loop.  Refuse to reconnect again if erc-server-reconnect-timeout
+	is not an integer.
 
 	* erc.el (erc-command-no-process-p): Fix bug: the return value of
 	erc-extract-command-from-line is a list rather than a single
diff --git a/erc-backend.el b/erc-backend.el
index 1f2fc0c..f4c87e2 100644
--- a/erc-backend.el
+++ b/erc-backend.el
@@ -612,33 +612,36 @@ EVENT is the message received from the closed connection process."
 
 (defun erc-process-sentinel-2 (event buffer)
   "Called when `erc-process-sentinel-1' has detected an unexpected disconnect."
-  (with-current-buffer buffer
-    (let ((again t)
-          reconnect-p)
-      (while again
-        (setq again nil)
-        (setq reconnect-p (erc-server-reconnect-p event))
+  (when (buffer-live-p buffer)
+    (with-current-buffer buffer
+      (let ((reconnect-p (erc-server-reconnect-p event)))
         (erc-display-message nil 'error (current-buffer)
                              (if reconnect-p 'disconnected
                                'disconnected-noreconnect))
-        (if reconnect-p
-            (condition-case err
-                (progn
-                  (setq erc-server-reconnecting nil)
-                  (erc-server-reconnect)
-                  (setq erc-server-reconnect-count 0))
-              (error (when (buffer-live-p buffer)
-                       (set-buffer buffer)
-                       (when (integerp erc-server-reconnect-attempts)
+        (if (not reconnect-p)
+            ;; terminate, do not reconnect
+            (erc-display-message nil 'error (current-buffer)
+                                 'terminated ?e event)
+          ;; reconnect
+          (condition-case err
+              (progn
+                (setq erc-server-reconnecting nil)
+                (erc-server-reconnect)
+                (setq erc-server-reconnect-count 0))
+            (error (when (buffer-live-p buffer)
+                     (set-buffer buffer)
+                     (if (integerp erc-server-reconnect-attempts)
                          (setq erc-server-reconnect-count
-                               (1+ erc-server-reconnect-count)))
-                       ;; TODO: Make this use a one-time timer
-                       ;; instead of sit-for
-                       (sit-for erc-server-reconnect-timeout)
-                       (setq again t))))
-          ;; terminate, do not reconnect
-          (erc-display-message nil 'error (current-buffer)
-                               'terminated ?e event))))))
+                               (1+ erc-server-reconnect-count))
+                       (message "%s ... %s"
+                                "Reconnecting until we succeed"
+                                "kill the server buffer to stop"))
+                     (if (integerp erc-server-reconnect-timeout)
+                         (run-at-time erc-server-reconnect-timeout nil
+                                      #'erc-process-sentinel-2
+                                      event buffer)
+                       (error (concat "`erc-server-reconnect-timeout`"
+                                      " must be an integer")))))))))))
 
 (defun erc-process-sentinel-1 (event buffer)
   "Called when `erc-process-sentinel' has decided that we're disconnecting.



From MAILER-DAEMON Tue Aug 14 01:18:55 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1IKonv-0003u5-6X
	for mharc-erc-commit@gnu.org; Tue, 14 Aug 2007 01:18:55 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IKons-0003su-Cx
	for erc-commit@gnu.org; Tue, 14 Aug 2007 01:18:52 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IKonr-0003s1-Qt
	for erc-commit@gnu.org; Tue, 14 Aug 2007 01:18:52 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IKonr-0003rY-Jq
	for erc-commit@gnu.org; Tue, 14 Aug 2007 01:18:51 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1IKonr-00008n-BL
	for erc-commit@gnu.org; Tue, 14 Aug 2007 01:18:51 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1IKopB-0003c4-V1
	for erc-commit@gnu.org; Tue, 14 Aug 2007 01:20:13 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1IKopB-0003c4-V1@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Tue, 14 Aug 2007 01:20:13 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] Reconnect timeout must be a number,
	not necessarily an integer
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Aug 2007 05:18:52 -0000

commit 1b9d78bea251cac82935a12d437bcc1ad23b3ddd
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Tue Aug 14 01:12:52 2007 -0400

    Reconnect timeout must be a number, not necessarily an integer
    
    * erc-backend.el (erc-process-sentinel-2): Improve message for case where
      erc-server-reconnect timeout is t.  Check to see if
      erc-server-reconnect-timeout is a number, rather than an integer.

diff --git a/ChangeLog b/ChangeLog
index b957b34..05aa739 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,7 +18,7 @@
 	sentinel by means of run-at-time, so that there is time to kill
 	the buffer if need be; this also removes the need for a while
 	loop.  Refuse to reconnect again if erc-server-reconnect-timeout
-	is not an integer.
+	is not an number.
 
 	* erc.el (erc-command-no-process-p): Fix bug: the return value of
 	erc-extract-command-from-line is a list rather than a single
diff --git a/erc-backend.el b/erc-backend.el
index f4c87e2..73f534a 100644
--- a/erc-backend.el
+++ b/erc-backend.el
@@ -635,13 +635,13 @@ EVENT is the message received from the closed connection process."
                                (1+ erc-server-reconnect-count))
                        (message "%s ... %s"
                                 "Reconnecting until we succeed"
-                                "kill the server buffer to stop"))
-                     (if (integerp erc-server-reconnect-timeout)
+                                "kill the ERC server buffer to stop"))
+                     (if (numberp erc-server-reconnect-timeout)
                          (run-at-time erc-server-reconnect-timeout nil
                                       #'erc-process-sentinel-2
                                       event buffer)
                        (error (concat "`erc-server-reconnect-timeout`"
-                                      " must be an integer")))))))))))
+                                      " must be a number")))))))))))
 
 (defun erc-process-sentinel-1 (event buffer)
   "Called when `erc-process-sentinel' has decided that we're disconnecting.



From MAILER-DAEMON Tue Aug 14 01:38:44 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1IKp76-0001OH-Je
	for mharc-erc-commit@gnu.org; Tue, 14 Aug 2007 01:38:44 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IKp75-0001Nj-CV
	for erc-commit@gnu.org; Tue, 14 Aug 2007 01:38:43 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IKp74-0001NX-Q7
	for erc-commit@gnu.org; Tue, 14 Aug 2007 01:38:42 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IKp74-0001NU-Nn
	for erc-commit@gnu.org; Tue, 14 Aug 2007 01:38:42 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1IKp74-0004Vt-Fx
	for erc-commit@gnu.org; Tue, 14 Aug 2007 01:38:42 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1IKp8P-0004ga-0z
	for erc-commit@gnu.org; Tue, 14 Aug 2007 01:40:05 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1IKp8P-0004ga-0z@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Tue, 14 Aug 2007 01:40:05 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] Handle some edge cases when
	erc-server-process is nil
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Aug 2007 05:38:43 -0000

commit d0691caef77d6a2f2e04fe5a69879b5c4a4967db
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Tue Aug 14 01:31:44 2007 -0400

    Handle some edge cases when erc-server-process is nil
    
    * erc-backend.el (erc-server-reconnect): Fix logic inversion.
    
    * erc.el (erc-send-current-line, erc-display-command, erc-display-msg):
      Handle case where erc-server-process is nil, so that /reconnect works.

diff --git a/ChangeLog b/ChangeLog
index 05aa739..40ee342 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,9 @@
 	symbol.  Thanks to jbms for the report.
 	(erc-cmd-RECONNECT): Use simpler logic, and use buffer-live-p
 	rather than bufferp.
+	(erc-send-current-line, erc-display-command, erc-display-msg):
+	Handle case where erc-server-process is nil, so that /reconnect
+	works.
 
 2007-08-12  Michael Olson  <mwolson@gnu.org>
 
diff --git a/erc-backend.el b/erc-backend.el
index 73f534a..0df2776 100644
--- a/erc-backend.el
+++ b/erc-backend.el
@@ -553,8 +553,8 @@ Make sure you are in an ERC buffer when running this."
   (let ((buffer (erc-server-buffer)))
     (unless (buffer-live-p buffer)
       (if (eq major-mode 'erc-mode)
-          (error "Reconnect must be run from an ERC buffer")
-        (setq buffer (current-buffer))))
+          (setq buffer (current-buffer))
+        (error "Reconnect must be run from an ERC buffer")))
     (with-current-buffer buffer
       (erc-update-mode-line)
       (erc-set-active-buffer (current-buffer))
diff --git a/erc.el b/erc.el
index 5d29ace..cee601f 100644
--- a/erc.el
+++ b/erc.el
@@ -4999,7 +4999,8 @@ Specifically, return the position of `erc-insert-marker'."
 		(save-restriction
 		  (widen)
 		  (goto-char (point-max))
-		  (set-marker (process-mark erc-server-process) (point))
+		  (when (processp erc-server-process)
+		    (set-marker (process-mark erc-server-process) (point)))
 		  (set-marker erc-insert-marker (point))
 		  (let ((buffer-modified (buffer-modified-p)))
 		    (erc-display-prompt)
@@ -5067,7 +5068,8 @@ This returns non-nil only iff we actually send anything."
 	(erc-put-text-property beg (point)
 			       'face 'erc-command-indicator-face)
 	(insert "\n"))
-      (set-marker (process-mark erc-server-process) (point))
+      (when (processp erc-server-process)
+	(set-marker (process-mark erc-server-process) (point)))
       (set-marker erc-insert-marker (point))
       (save-excursion
 	(save-restriction
@@ -5086,7 +5088,8 @@ current position."
 	(erc-put-text-property beg (point)
 			       'face 'erc-input-face))
       (insert "\n")
-      (set-marker (process-mark erc-server-process) (point))
+      (when (processp erc-server-process)
+	(set-marker (process-mark erc-server-process) (point)))
       (set-marker erc-insert-marker (point))
       (save-excursion
 	(save-restriction



From MAILER-DAEMON Wed Aug 15 21:58:54 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1ILUdS-0003iF-Iz
	for mharc-erc-commit@gnu.org; Wed, 15 Aug 2007 21:58:54 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1ILUdR-0003i6-Cf
	for erc-commit@gnu.org; Wed, 15 Aug 2007 21:58:53 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1ILUdQ-0003hg-9o
	for erc-commit@gnu.org; Wed, 15 Aug 2007 21:58:53 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1ILUdQ-0003hc-5g
	for erc-commit@gnu.org; Wed, 15 Aug 2007 21:58:52 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1ILUdP-0004rM-Ok
	for erc-commit@gnu.org; Wed, 15 Aug 2007 21:58:51 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1ILUeh-0004BP-Qn
	for erc-commit@gnu.org; Wed, 15 Aug 2007 22:00:11 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1ILUeh-0004BP-Qn@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Wed, 15 Aug 2007 22:00:11 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] Add ChangeLog entry for last change
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Aug 2007 01:58:53 -0000

commit e258147fd82106b365ebd6ff81acabedfcd379b5
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Wed Aug 15 21:50:37 2007 -0400

    Add ChangeLog entry for last change
    
    * ChangeLog: Add entry for last change.
    
    * erc-track.el (erc-track-list-changed-hook): Turn this into a
      customizable option.

diff --git a/ChangeLog b/ChangeLog
index 40ee342..87426c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,45 @@
+2007-08-16  Michael Olson  <mwolson@gnu.org>
+
+	* erc-track.el (erc-track-list-changed-hook): Turn this into a
+	customizable option.
+
+2007-08-14  Jeremy Maitin-Shepard <jbms@cmu.edu>
+
+	* erc-track.el (erc-track-remove-disconnected-buffers): New
+	variable which controls whether buffers associated with a server
+	that is disconnected should be removed from
+	`erc-modified-channels-alist'.  Existing behavior is to
+	unconditionally remove such buffers, which is achieved by setting
+	`erc-track-removed-disconnected-buffers' to t.  When set to t,
+	which is the new default value, such buffers remain in the list,
+	which I think is often the desired behavior, since the user may
+	likely wish to find out about activity that occurred in a channel
+	prior to it being disconnected.
+	(erc-track-list-changed-hook): New hook that is run whenever the
+	contents of `erc-modified-channels-alist' changes; it is useful
+	for users such as myself that don't use the default mode-line
+	notification but instead use a separate mechanism (which is tied
+	to my window manager) to provide notification of channel activity.
+	(erc-track-get-buffer-window): New function that acts as a wrapper
+	around `get-buffer-window' that handles the `selected-visible'
+	option of `erc-track-visibility'; previously, the value of
+	`erc-track-visibility' was passed directly to `get-buffer-window',
+	which does not support `selected-visible'; consequently,
+	`selected-visible' was not properly supported.
+	(erc-track-modified-channels): Fix a bug in the logic for removing
+	buffers from the list in certain cases.
+	(erc-track-position-in-mode-line): Add a supported value that
+	specifies that the tracking information should not be added to the
+	mode line at all.  The value of nil is used to indicate that the
+	information should not be added at all to the mode line.
+	(erc-track-add-to-mode-line): Check for position eq to t, rather
+	than non-nil.
+	(erc-buffer-visible): Use erc-track-get-buffer-window.
+	(erc-modified-channels-update): Take
+	erc-track-remove-disconnected-buffers into account.
+	(erc-modified-channels-display): Run
+	`erc-track-list-changed-hook'.
+
 2007-08-14  Michael Olson  <mwolson@gnu.org>
 
 	* erc-backend.el (erc-server-reconnect): If the server buffer has
diff --git a/erc-track.el b/erc-track.el
index 3cb1206..8c1d3e6 100644
--- a/erc-track.el
+++ b/erc-track.el
@@ -157,7 +157,15 @@ If nil instead of a function, shortening is disabled."
   :type '(choice (const :tag "Disabled")
 		 function))
 
-(defvar erc-track-list-changed-hook nil)
+(defcustom erc-track-list-changed-hook nil
+  "Hook that is run whenever the contents of
+`erc-modified-channels-alist' changes.
+
+This is useful for people that don't use the default mode-line
+notification but instead use a separate mechanism to provide
+notification of channel activity."
+  :group 'erc-track
+  :type 'hook)
 
 (defcustom erc-track-use-faces t
   "*Use faces in the mode-line.



From MAILER-DAEMON Wed Aug 15 21:58:57 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1ILUdU-0003j3-Mz
	for mharc-erc-commit@gnu.org; Wed, 15 Aug 2007 21:58:56 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1ILUdT-0003if-A5
	for erc-commit@gnu.org; Wed, 15 Aug 2007 21:58:55 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1ILUdQ-0003hi-Cd
	for erc-commit@gnu.org; Wed, 15 Aug 2007 21:58:54 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1ILUdQ-0003hb-4p
	for erc-commit@gnu.org; Wed, 15 Aug 2007 21:58:52 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1ILUdP-0004rL-Ls
	for erc-commit@gnu.org; Wed, 15 Aug 2007 21:58:51 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1ILUeh-0004Ay-Nd
	for erc-commit@gnu.org; Wed, 15 Aug 2007 22:00:11 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1ILUeh-0004Ay-Nd@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Wed, 15 Aug 2007 22:00:11 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] Many fixes to erc-track.el
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Aug 2007 01:58:55 -0000

commit 21f04e6eeb3daebf970e74346696fd1e95ee408f
Author: Jeremy Maitin-Shepard <jbms@cmu.edu>
Date:   Tue Aug 14 16:40:11 2007 -0400

    Many fixes to erc-track.el
    
    - Added variable `erc-track-remove-disconnected-buffers', which controls
      whether buffers associated with a server that is disconnected should
      be removed from `erc-modified-channels-alist'.  Existing behavior is
      to unconditionally remove such buffers, which is achieved by setting
      `erc-track-removed-disconnected-buffers' to t.  When set to t, which
      is the new default value, such buffers remain in the list, which I
      think is often the desired behavior, since the user may likely wish to
      find out about activity that occurred in a channel prior to it being
      disconnected.
    
    - Added hook `erc-track-list-changed-hook'.  This is run whenever the
      contents of `erc-modified-channels-alist' changes; it is useful for
      users such as myself that don't use the default mode-line
      notification but instead use a separate mechanism (which is tied to my
      window manager) to provide notification of channel activity.
    
    - Added function `erc-track-get-buffer-window' as a wrapper around
      `get-buffer-window' that handles the `selected-visible' option of
      `erc-track-visibility'; previously, the value of
      `erc-track-visibility' was passed directly to `get-buffer-window',
      which does not support `selected-visible'; consequently,
      `selected-visible' was not properly supported.
    
    - Fixed a bug in the logic in `erc-track-modified-channels' for removing
      buffers from the list in certain cases.

diff --git a/erc-track.el b/erc-track.el
index f72a5be..3cb1206 100644
--- a/erc-track.el
+++ b/erc-track.el
@@ -95,6 +95,12 @@ Activity means that there was no user input in the last 10 seconds."
   :group 'erc-track
   :type '(repeat string))
 
+(defcustom erc-track-remove-disconnected-buffers nil
+  "*If true, remove buffers associated with a server that is
+disconnected from `erc-modified-channels-alist'."
+  :group 'erc-track
+  :type 'boolean)
+
 (defcustom erc-track-exclude-types '("NICK")
   "*List of message types to be ignored.
 This list could look like '(\"JOIN\" \"PART\")."
@@ -151,6 +157,8 @@ If nil instead of a function, shortening is disabled."
   :type '(choice (const :tag "Disabled")
 		 function))
 
+(defvar erc-track-list-changed-hook nil)
+
 (defcustom erc-track-use-faces t
   "*Use faces in the mode-line.
 The faces used are the same as used for text in the buffers.
@@ -192,12 +200,14 @@ Setting this variable only has effects in GNU Emacs versions above 21.3.
 Choices are:
 'before-modes - add to the beginning of `mode-line-modes'
 'after-modes  - add to the end of `mode-line-modes'
-
-Any other value means add to the end of `global-mode-string'."
+t             - add to the end of `global-mode-string'.
+nil           - don't add to mode line
+"
   :group 'erc-track
   :type '(choice (const :tag "Just before mode information" before-modes)
 		 (const :tag "Just after mode information" after-modes)
-		 (const :tag "After all other information" nil))
+		 (const :tag "After all other information" t)
+		 (const :tag "Don't display in mode line" nil))
   :set (lambda (sym val)
 	 (set sym val)
 	 (when (and (boundp 'erc-track-mode)
@@ -296,7 +306,7 @@ See `erc-track-position-in-mode-line' for possible values."
 	      (boundp 'mode-line-modes))
 	 (add-to-list 'mode-line-modes
 		      '(t erc-modified-channels-object) t))
-	(t
+	((eq position t)
 	 (when (not global-mode-string)
 	   (setq global-mode-string '(""))) ; Padding for mode-line wart
 	 (add-to-list 'global-mode-string
@@ -644,14 +654,21 @@ only consider active buffers visible.")
   (setq erc-buffer-activity (erc-current-time))
   (erc-track-modified-channels))
 
+(defun erc-track-get-buffer-window (buffer frame-param)
+  (if (eq frame-param 'selected-visible)
+      (if (eq (frame-visible-p (selected-frame)) t)
+	  (get-buffer-window buffer nil)
+	nil)
+    (get-buffer-window buffer frame-param)))
+
 (defun erc-buffer-visible (buffer)
   "Return non-nil when the buffer is visible."
   (if erc-track-when-inactive
       (when erc-buffer-activity; could be nil
-	(and (get-buffer-window buffer erc-track-visibility)
+	(and (erc-track-get-buffer-window buffer erc-track-visibility)
 	     (<= (erc-time-diff erc-buffer-activity (erc-current-time))
 		 erc-buffer-activity-timeout)))
-    (get-buffer-window buffer erc-track-visibility)))
+    (erc-track-get-buffer-window buffer erc-track-visibility)))
 
 ;;; Tracking the channel modifications
 
@@ -668,18 +685,22 @@ called via `window-configuration-change-hook'.
 ARGS are ignored."
   (interactive)
   (unless erc-modified-channels-update-inside
-    (let ((erc-modified-channels-update-inside t))
+    (let ((erc-modified-channels-update-inside t)
+	  (removed-channel nil))
       (mapcar (lambda (elt)
 		(let ((buffer (car elt)))
 		  (when (or (not (bufferp buffer))
 			    (not (buffer-live-p buffer))
 			    (erc-buffer-visible buffer)
+			    (and erc-track-remove-disconnected-buffers
 			    (not (with-current-buffer buffer
-				   erc-server-connected)))
+					erc-server-connected))))
+		    (setq removed-channel t)
 		    (erc-modified-channels-remove-buffer buffer))))
 	      erc-modified-channels-alist)
+      (when removed-channel
       (erc-modified-channels-display)
-      (force-mode-line-update t))))
+	(force-mode-line-update t)))))
 
 (defvar erc-track-mouse-face (if (featurep 'xemacs)
 				 'modeline-mousable
@@ -733,6 +754,8 @@ Use `erc-make-mode-line-buffer-name' to create buttons."
 	(eq 'mostactive erc-track-switch-direction)
 	(eq 'leastactive erc-track-switch-direction))
       (erc-track-sort-by-activest))
+  (run-hooks 'erc-track-list-changed-hook)
+  (unless (eq erc-track-position-in-mode-line nil)
   (if (null erc-modified-channels-alist)
       (setq erc-modified-channels-object (erc-modified-channels-object nil))
     ;; erc-modified-channels-alist contains all the data we need.  To
@@ -768,7 +791,7 @@ Use `erc-make-mode-line-buffer-name' to create buttons."
       (when (featurep 'xemacs)
 	(erc-modified-channels-object nil))
       (setq erc-modified-channels-object
-	    (erc-modified-channels-object strings)))))
+	      (erc-modified-channels-object strings))))))
 
 (defun erc-modified-channels-remove-buffer (buffer)
   "Remove BUFFER from `erc-modified-channels-alist'."
@@ -802,8 +825,7 @@ is in `erc-mode'."
     (if (and (not (erc-buffer-visible (current-buffer)))
 	     (not (member this-channel erc-track-exclude))
 	     (not (and erc-track-exclude-server-buffer
-		       (string= this-channel
-				(buffer-name (erc-server-buffer)))))
+		       (erc-server-buffer-p)))
 	     (not (erc-message-type-member
 		   (or (erc-find-parsed-property)
 		       (point-min))
@@ -847,10 +869,10 @@ is in `erc-mode'."
 	    (erc-modified-channels-display)))
       ;; Else if the active buffer is the current buffer, remove it
       ;; from our list.
-      (when (or (erc-buffer-visible (current-buffer))
+      (when (and (or (erc-buffer-visible (current-buffer))
 		(and this-channel
-		     (assq (current-buffer) erc-modified-channels-alist)
 		     (member this-channel erc-track-exclude)))
+		 (assq (current-buffer) erc-modified-channels-alist))
 	;; Remove it from mode-line if buffer is visible or
 	;; channel was added to erc-track-exclude recently.
 	(erc-modified-channels-remove-buffer (current-buffer))



From MAILER-DAEMON Wed Aug 15 23:28:49 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1ILW2T-0000wh-Q6
	for mharc-erc-commit@gnu.org; Wed, 15 Aug 2007 23:28:49 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1ILW2S-0000wX-8a
	for erc-commit@gnu.org; Wed, 15 Aug 2007 23:28:48 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1ILW2Q-0000wL-Ps
	for erc-commit@gnu.org; Wed, 15 Aug 2007 23:28:47 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1ILW2Q-0000wI-KI
	for erc-commit@gnu.org; Wed, 15 Aug 2007 23:28:46 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1ILW2Q-0003vp-99
	for erc-commit@gnu.org; Wed, 15 Aug 2007 23:28:46 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1ILW3k-0001wr-PR
	for erc-commit@gnu.org; Wed, 15 Aug 2007 23:30:08 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1ILW3k-0001wr-PR@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Wed, 15 Aug 2007 23:30:08 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] erc-track: Allow switching to buffer
	with most important message type first
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Aug 2007 03:28:48 -0000

commit 2c7ea5ca18101c33f512dc15ba334fe214a5cd74
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Wed Aug 15 23:26:45 2007 -0400

    erc-track: Allow switching to buffer with most important message type first
    
    * erc-track.el (erc-track-switch-direction): Add 'importance option.
      (erc-modified-channels-display): If erc-track-switch-direction is
      'importance, call erc-track-sort-by-importance.
      (erc-track-face-priority): New function that returns a number
      indicating the position of a face in erc-track-faces-priority-list.
      (erc-track-sort-by-importance): New function that sorts
      erc-modified-channels-list according to erc-track-face-priority.
      (erc-track-get-active-buffer): Make 'oldest a rough opposite of
      'importance.

diff --git a/ChangeLog b/ChangeLog
index 87426c9..11c77a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,16 @@
 
 	* erc-track.el (erc-track-list-changed-hook): Turn this into a
 	customizable option.
+	(erc-track-switch-direction): Add 'importance option.
+	(erc-modified-channels-display): If erc-track-switch-direction is
+	'importance, call erc-track-sort-by-importance.
+	(erc-track-face-priority): New function that returns a number
+	indicating the position of a face in
+	erc-track-faces-priority-list.
+	(erc-track-sort-by-importance): New function that sorts
+	erc-modified-channels-list according to erc-track-face-priority.
+	(erc-track-get-active-buffer): Make 'oldest a rough opposite of
+	'importance.
 
 2007-08-14  Jeremy Maitin-Shepard <jbms@cmu.edu>
 
diff --git a/erc-track.el b/erc-track.el
index 8c1d3e6..5865257 100644
--- a/erc-track.el
+++ b/erc-track.el
@@ -281,12 +281,14 @@ when there are no more active channels."
 (defcustom erc-track-switch-direction 'oldest
   "Direction `erc-track-switch-buffer' should switch.
 
+  importance  -  find buffer with the most important message
   oldest      -  find oldest active buffer
   newest      -  find newest active buffer
   leastactive -  find buffer with least unseen messages
   mostactive  -  find buffer with most unseen messages."
   :group 'erc-track
-  :type '(choice (const oldest)
+  :type '(choice (const importance)
+		 (const oldest)
 		 (const newest)
 		 (const leastactive)
 		 (const mostactive)))
@@ -758,10 +760,11 @@ If FACES are provided, color STRING with them."
   "Set `erc-modified-channels-object'
 according to `erc-modified-channels-alist'.
 Use `erc-make-mode-line-buffer-name' to create buttons."
-  (if (or
-	(eq 'mostactive erc-track-switch-direction)
-	(eq 'leastactive erc-track-switch-direction))
-      (erc-track-sort-by-activest))
+  (cond ((or (eq 'mostactive erc-track-switch-direction)
+	     (eq 'leastactive erc-track-switch-direction))
+	 (erc-track-sort-by-activest))
+	((eq 'importance erc-track-switch-direction)
+	 (erc-track-sort-by-importance)))
   (run-hooks 'erc-track-list-changed-hook)
   (unless (eq erc-track-position-in-mode-line nil)
   (if (null erc-modified-channels-alist)
@@ -917,6 +920,29 @@ That means the number of unseen messages in a channel."
 	(sort erc-modified-channels-alist
 	      (lambda (a b) (> (nth 1 a) (nth 1 b))))))
 
+(defun erc-track-face-priority (face)
+  "Return a number indicating the priority of FACE in
+`erc-track-faces-priority-list'.  Lower number means higher
+priority.
+
+If face is not in `erc-track-faces-priority-list', it will have a
+higher number than any other face in that list."
+  (let ((count 0))
+    (catch 'done
+      (dolist (item erc-track-faces-priority-list)
+	(if (eq item face)
+	    (throw 'done t)
+	  (setq count (1+ count)))))
+    count))
+
+(defun erc-track-sort-by-importance ()
+  "Sort erc-modified-channels-alist by importance.
+That means the position of the face in `erc-track-faces-priority-list'."
+  (setq erc-modified-channels-alist
+	(sort erc-modified-channels-alist
+	      (lambda (a b) (< (erc-track-face-priority (cddr a))
+			       (erc-track-face-priority (cddr b)))))))
+
 (defun erc-track-get-active-buffer (arg)
   "Return the buffer name of ARG in `erc-modified-channels-alist'.
 Negative arguments index in the opposite direction.  This direction is
@@ -928,7 +954,8 @@ relative to `erc-track-switch-direction'"
 		  (oldest      'newest)
 		  (newest      'oldest)
 		  (mostactive  'leastactive)
-		  (leastactive 'mostactive)))
+		  (leastactive 'mostactive)
+		  (importance  'oldest)))
       (setq arg (- arg)))
     (setq offset (case dir
 		   ((oldest leastactive)



From MAILER-DAEMON Thu Aug 16 09:28:46 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1ILfP4-0000vg-MN
	for mharc-erc-commit@gnu.org; Thu, 16 Aug 2007 09:28:46 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1ILfP3-0000u0-6a
	for erc-commit@gnu.org; Thu, 16 Aug 2007 09:28:45 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1ILfP1-0000sW-Kq
	for erc-commit@gnu.org; Thu, 16 Aug 2007 09:28:44 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1ILfP1-0000sH-GP
	for erc-commit@gnu.org; Thu, 16 Aug 2007 09:28:43 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1ILfP1-0005LN-9a
	for erc-commit@gnu.org; Thu, 16 Aug 2007 09:28:43 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1ILfQL-0008Ra-Nn
	for erc-commit@gnu.org; Thu, 16 Aug 2007 09:30:05 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1ILfQL-0008Ra-Nn@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Thu, 16 Aug 2007 09:30:05 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] NEWS: Begin adding ERC 5.3 changes
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Aug 2007 13:28:45 -0000

commit a153652009cbdbe3ca93037531d8f46b04f3b8fe
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Thu Aug 16 09:23:22 2007 -0400

    NEWS: Begin adding ERC 5.3 changes
    
    * NEWS: Add ERC 5.3 changes section, and mention jbms' erc-track
      compatibility note.

diff --git a/ChangeLog b/ChangeLog
index 11c77a2..e06fd56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-08-16  Michael Olson  <mwolson@gnu.org>
 
+	* NEWS: Add ERC 5.3 changes section, and mention jbms' erc-track
+	compatibility note.
+
 	* erc-track.el (erc-track-list-changed-hook): Turn this into a
 	customizable option.
 	(erc-track-switch-direction): Add 'importance option.
diff --git a/NEWS b/NEWS
index b7aa0b1..9fc24d2 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,17 @@ ERC NEWS                                                       -*- outline -*-
 Copyright (C) 2006, 2007  Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
+* Changes in ERC 5.3
+
+** Changes and additions to modules
+
+*** Channel tracking (erc-track.el)
+
+If erc-track-position-in-mode-line is set to nil, the tracking
+information won't be shown in the mode line, which is a change
+from the previous behavior of showing it "After all other
+information".
+
 * Changes in ERC 5.2
 
 ** M-x erc RET now starts ERC.



From MAILER-DAEMON Fri Aug 17 23:59:03 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1IMFSp-0002lg-FI
	for mharc-erc-commit@gnu.org; Fri, 17 Aug 2007 23:59:03 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IMFSo-0002lO-5y
	for erc-commit@gnu.org; Fri, 17 Aug 2007 23:59:02 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IMFSm-0002lC-Pq
	for erc-commit@gnu.org; Fri, 17 Aug 2007 23:59:00 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IMFSm-0002l9-Je
	for erc-commit@gnu.org; Fri, 17 Aug 2007 23:59:00 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1IMFSm-0006Ya-Ct
	for erc-commit@gnu.org; Fri, 17 Aug 2007 23:59:00 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1IMFU3-0007ic-4S
	for erc-commit@gnu.org; Sat, 18 Aug 2007 00:00:19 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1IMFU3-0007ic-4S@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Sat, 18 Aug 2007 00:00:19 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] erc-reuse-frames: new variable
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 18 Aug 2007 03:59:02 -0000

commit 0e90a8e09d6c9fa48c3eb6acd6471218a6eab009
Author: Jeremy Maitin-Shepard <jbms@cmu.edu>
Date:   Tue Aug 14 16:23:57 2007 -0400

    erc-reuse-frames: new variable
    
    Adds an erc-reuse-frames variable that acts just as the documentation
    for it specifies.  Without this change, if erc-join-buffer is set to
    `frame', duplicate frames will be created on every reconnect, which is
    equivalent to setting `erc-reuse-frames' to nil.

diff --git a/erc.el b/erc.el
index cee601f..1628fbd 100644
--- a/erc.el
+++ b/erc.el
@@ -1492,6 +1492,14 @@ This only has effect when `erc-join-buffer' is set to `frame'."
   :group 'erc-buffers
   :type 'boolean)
 
+(defcustom erc-reuse-frames t
+  "*Determines whether new frames are always created.
+Non-nil means that a new frame is not created to display an ERC
+buffer if there is already a window displaying it.  This only has
+effect when `erc-join-buffer' is set to `frame'."
+  :group 'erc-buffers
+  :type 'boolean)
+
 (defun erc-channel-p (channel)
   "Return non-nil if CHANNEL seems to be an IRC channel name."
   (cond ((stringp channel)
@@ -1891,14 +1899,16 @@ removed from the list will be disabled."
 	((eq erc-join-buffer 'bury)
 	 nil)
 	((eq erc-join-buffer 'frame)
-	 (funcall '(lambda (frame)
+	 (when (or (not erc-reuse-frames)
+		   (not (get-buffer-window buffer t)))
+	   ((lambda (frame)
 		     (raise-frame frame)
 		     (select-frame frame))
 		  (make-frame (or erc-frame-alist
 				  default-frame-alist)))
 	 (switch-to-buffer buffer)
 	 (when erc-frame-dedicated-flag
-	   (set-window-dedicated-p (selected-window) t)))
+	     (set-window-dedicated-p (selected-window) t))))
 	(t
 	 (if (active-minibuffer-window)
 	     (display-buffer buffer)



From MAILER-DAEMON Fri Aug 17 23:59:10 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1IMFSw-0002mn-Jy
	for mharc-erc-commit@gnu.org; Fri, 17 Aug 2007 23:59:10 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IMFSv-0002mP-1W
	for erc-commit@gnu.org; Fri, 17 Aug 2007 23:59:09 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IMFSu-0002mA-F4
	for erc-commit@gnu.org; Fri, 17 Aug 2007 23:59:08 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IMFSu-0002m6-A7
	for erc-commit@gnu.org; Fri, 17 Aug 2007 23:59:08 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1IMFSu-0006a5-2V
	for erc-commit@gnu.org; Fri, 17 Aug 2007 23:59:08 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1IMFU6-0007jB-JK
	for erc-commit@gnu.org; Sat, 18 Aug 2007 00:00:23 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1IMFU6-0007jB-JK@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Sat, 18 Aug 2007 00:00:22 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] ChangeLog: Add entry for jbms'
	erc-reuse-frames patch
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 18 Aug 2007 03:59:09 -0000

commit 3cda769c8372eefd524eaf1810af627ae11043d0
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Fri Aug 17 23:54:24 2007 -0400

    ChangeLog: Add entry for jbms' erc-reuse-frames patch
    
    * ChangeLog: Add entry for jbms' erc-reuse-frames patch.

diff --git a/ChangeLog b/ChangeLog
index e06fd56..461a34d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -53,6 +53,11 @@
 	(erc-modified-channels-display): Run
 	`erc-track-list-changed-hook'.
 
+	* erc.el (erc-reuse-frames): New option that determines whether
+	new frames are always created.  Defaults to t.  This only has an
+	effect when erc-join-buffer is set to 'frame.
+	(erc-setup-buffer): Use it.
+
 2007-08-14  Michael Olson  <mwolson@gnu.org>
 
 	* erc-backend.el (erc-server-reconnect): If the server buffer has



From MAILER-DAEMON Sun Aug 19 23:08:52 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1IMxdM-0007t7-Bq
	for mharc-erc-commit@gnu.org; Sun, 19 Aug 2007 23:08:52 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IMxdK-0007sm-IF
	for erc-commit@gnu.org; Sun, 19 Aug 2007 23:08:50 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IMxdI-0007sM-UR
	for erc-commit@gnu.org; Sun, 19 Aug 2007 23:08:49 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IMxdI-0007sI-RP
	for erc-commit@gnu.org; Sun, 19 Aug 2007 23:08:48 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1IMxdI-00038Y-Mg
	for erc-commit@gnu.org; Sun, 19 Aug 2007 23:08:48 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1IMxeZ-0002X2-RG
	for erc-commit@gnu.org; Sun, 19 Aug 2007 23:10:07 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1IMxeZ-0002X2-RG@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Sun, 19 Aug 2007 23:10:07 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] erc-process-sentinel: Update mode
	line in more places
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Aug 2007 03:08:50 -0000

commit 18b157ee2779760f01507f67f7419f738dd5f20b
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Sun Aug 19 23:02:37 2007 -0400

    erc-process-sentinel: Update mode line in more places
    
    * erc-backend.el (erc-process-sentinel-2, erc-process-sentinel-1)
      (erc-process-sentinel): Update mode line in more places.  Unmark buffer
      as modified in more places.

diff --git a/erc-backend.el b/erc-backend.el
index 0df2776..4e25049 100644
--- a/erc-backend.el
+++ b/erc-backend.el
@@ -612,7 +612,8 @@ EVENT is the message received from the closed connection process."
 
 (defun erc-process-sentinel-2 (event buffer)
   "Called when `erc-process-sentinel-1' has detected an unexpected disconnect."
-  (when (buffer-live-p buffer)
+  (if (not (buffer-live-p buffer))
+      (erc-update-mode-line)
     (with-current-buffer buffer
       (let ((reconnect-p (erc-server-reconnect-p event)))
         (erc-display-message nil 'error (current-buffer)
@@ -620,8 +621,12 @@ EVENT is the message received from the closed connection process."
                                'disconnected-noreconnect))
         (if (not reconnect-p)
             ;; terminate, do not reconnect
-            (erc-display-message nil 'error (current-buffer)
-                                 'terminated ?e event)
+            (progn
+              (erc-display-message nil 'error (current-buffer)
+                                   'terminated ?e event)
+              ;; Update mode line indicators
+              (erc-update-mode-line)
+              (set-buffer-modified-p nil))
           ;; reconnect
           (condition-case err
               (progn
@@ -652,8 +657,11 @@ Conditionally try to reconnect and take appropriate action."
         ;; normal quit
         (progn
           (erc-display-message nil 'error (current-buffer) 'finished)
+          ;; Update mode line indicators
+          (erc-update-mode-line)
+          ;; Kill server buffer if user wants it
+          (set-buffer-modified-p nil)
           (when erc-kill-server-buffer-on-quit
-            (set-buffer-modified-p nil)
             (kill-buffer (current-buffer))))
       ;; unexpected disconnect
       (erc-process-sentinel-2 event buffer))))
@@ -683,12 +691,7 @@ Conditionally try to reconnect and take appropriate action."
         (delete-region (point) (point-max))
         ;; Decide what to do with the buffer
         ;; Restart if disconnected
-        (erc-process-sentinel-1 event buf)
-        ;; Make sure we don't write to the buffer if it has been
-        ;; killed
-        (when (buffer-live-p buf)
-          (erc-update-mode-line)
-          (set-buffer-modified-p nil))))))
+        (erc-process-sentinel-1 event buf)))))
 
 ;;;; Sending messages
 



From MAILER-DAEMON Sun Aug 26 20:18:58 2007
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1IPSJm-0002bH-Ki
	for mharc-erc-commit@gnu.org; Sun, 26 Aug 2007 20:18:58 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1IPSJk-0002af-LB
	for erc-commit@gnu.org; Sun, 26 Aug 2007 20:18:56 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1IPSJj-0002ZV-W3
	for erc-commit@gnu.org; Sun, 26 Aug 2007 20:18:56 -0400
Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1IPSJj-0002ZM-QR
	for erc-commit@gnu.org; Sun, 26 Aug 2007 20:18:55 -0400
Received: from fyodor.hcoop.net ([64.20.38.170])
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <mwolson@hcoop.net>) id 1IPSJj-0002AE-H0
	for erc-commit@gnu.org; Sun, 26 Aug 2007 20:18:55 -0400
Received: from mwolson by fyodor.hcoop.net with local (Exim 4.63)
	(envelope-from <mwolson@hcoop.net>) id 1IPSL0-0006T7-P1
	for erc-commit@gnu.org; Sun, 26 Aug 2007 20:20:14 -0400
To: erc-commit@gnu.org
From: mwolson@gnu.org
Message-Id: <E1IPSL0-0006T7-P1@fyodor.hcoop.net>
Sender: Michael Olson <mwolson@hcoop.net>
Date: Sun, 26 Aug 2007 20:20:14 -0400
X-Detected-Kernel: Linux 2.4-2.6
Subject: [Erc-commit] [commit][master] /GQ: Kill query buffers after 4
	seconds if user wants it
X-BeenThere: erc-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: erc-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/erc-commit>
List-Post: <mailto:erc-commit@gnu.org>
List-Help: <mailto:erc-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/erc-commit>,
	<mailto:erc-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Aug 2007 00:18:57 -0000

commit ffab470eeadb67e3aa7cb470a24ca2c009077dee
Author: Michael W. Olson <mwolson@gnu.org>
Date:   Sun Aug 26 20:11:32 2007 -0400

    /GQ: Kill query buffers after 4 seconds if user wants it
    
    * erc.el (erc-cmd-GQUIT): If erc-kill-queries-on-quit is non-nil, kill
      all query buffers after 4 seconds.

diff --git a/ChangeLog b/ChangeLog
index 461a34d..f9594d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-27  Michael Olson  <mwolson@gnu.org>
+
+	* erc.el (erc-cmd-GQUIT): If erc-kill-queries-on-quit is non-nil,
+	kill all query buffers after 4 seconds.
+
 2007-08-16  Michael Olson  <mwolson@gnu.org>
 
 	* NEWS: Add ERC 5.3 changes section, and mention jbms' erc-track
diff --git a/erc.el b/erc.el
index 1628fbd..2c931d8 100644
--- a/erc.el
+++ b/erc.el
@@ -3258,7 +3258,17 @@ the message given by REASON."
 (defun erc-cmd-GQUIT (reason)
   "Disconnect from all servers at once with the same quit REASON."
   (erc-with-all-buffers-of-server nil #'erc-open-server-buffer-p
-				  (erc-cmd-QUIT reason)))
+				  (erc-cmd-QUIT reason))
+  (when erc-kill-queries-on-quit
+    ;; if the query buffers have not been killed within 4 seconds,
+    ;; kill them
+    (run-at-time
+     4 nil
+     (lambda ()
+       (dolist (buffer (erc-buffer-list (lambda (buf)
+					  (not (erc-server-buffer-p buf)))))
+	 (kill-buffer buffer)))))
+  t)
 
 (defalias 'erc-cmd-GQ 'erc-cmd-GQUIT)
 (put 'erc-cmd-GQUIT 'do-not-parse-args t)



