erc-commit
[Top][All Lists]
Advanced

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

[Erc-commit] [commit][emacs22] Fix /QUIT bug.


From: mwolson
Subject: [Erc-commit] [commit][emacs22] Fix /QUIT bug.
Date: Sun, 14 Oct 2007 00:48:25 -0400

commit bb3df3a8ebd64ada8bc6a73793ce26d845b46cb5
Author: Michael Olson <address@hidden>
Date:   Mon Aug 7 06:38:30 2006 +0000

    Fix /QUIT bug.
    
    * erc.el (erc-cmd-QUIT): Bind the current erc-server-process to
      server-proc.  If the IRC server responds quickly, it is possible for
      the connection to close, and hence server buffer to be killed, if
      erc-kill-server-buffer-on-quit is non-nil.  This avoids that problem.
    git-archimport-id: address@hidden/erc--main--0--patch-38

diff --git a/ChangeLog b/ChangeLog
index 35e0777..95b10b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,11 @@
        (english): Add 'finished and 'terminated entries to the catalog.
        Add initial and terminal newlines to 'disconnected and
        'disconnected-noreconnect entries.  Avoid long lines.
+       (erc-cmd-QUIT): Bind the current erc-server-process to
+       server-proc.  If the IRC server responds quickly, it is possible
+       for the connection to close, and hence server buffer to be killed,
+       if erc-kill-server-buffer-on-quit is non-nil.  This avoids that
+       problem.
 
 2006-08-06  Michael Olson  <address@hidden>
 
diff --git a/erc.el b/erc.el
index 375418c..a3a557b 100644
--- a/erc.el
+++ b/erc.el
@@ -3121,7 +3121,8 @@ the message given by REASON."
    ((string-match "^\\s-*\\(.*\\)$" reason)
     (let* ((s (match-string 1 reason))
           (buffer (erc-server-buffer))
-          (reason (funcall erc-quit-reason (if (equal s "") nil s))))
+          (reason (funcall erc-quit-reason (if (equal s "") nil s)))
+          server-proc)
       (with-current-buffer (if (and buffer
                                    (bufferp buffer))
                               buffer
@@ -3129,17 +3130,18 @@ the message given by REASON."
        (erc-log (format "cmd: QUIT: %s" reason))
        (setq erc-server-quitting t)
        (erc-set-active-buffer (erc-server-buffer))
+       (setq server-proc erc-server-process)
        (erc-server-send (format "QUIT :%s" reason)))
-      (run-hook-with-args 'erc-quit-hook erc-server-process)
+      (run-hook-with-args 'erc-quit-hook server-proc)
       (when erc-kill-queries-on-quit
-       (erc-kill-query-buffers erc-server-process))
+       (erc-kill-query-buffers server-proc))
       ;; if the process has not been killed within 4 seconds, kill it
       (run-at-time 4 nil
                   (lambda (proc)
                     (when (and (processp proc)
                                (memq (process-status proc) '(run open)))
                       (delete-process proc)))
-                  erc-server-process))
+                  server-proc))
     t)
    (t nil)))
 




reply via email to

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