From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.bugs Subject: bug#17045: 24.3.50; feature request: rcirc-reconnect Date: Wed, 07 May 2014 13:57:06 -0400 Message-ID: References: Reply-To: sds@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1399485501 7071 80.91.229.3 (7 May 2014 17:58:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 May 2014 17:58:21 +0000 (UTC) Cc: 17045@debbugs.gnu.org To: Leo Liu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 07 19:58:17 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wi66g-0006bj-Hi for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 May 2014 19:58:14 +0200 Original-Received: from localhost ([::1]:43006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wi66g-0003DS-8Q for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 May 2014 13:58:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wi66Z-0003DK-EU for bug-gnu-emacs@gnu.org; Wed, 07 May 2014 13:58:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wi66V-0004bT-0P for bug-gnu-emacs@gnu.org; Wed, 07 May 2014 13:58:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wi66U-0004bP-TM for bug-gnu-emacs@gnu.org; Wed, 07 May 2014 13:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Wi66U-0003AD-86 for bug-gnu-emacs@gnu.org; Wed, 07 May 2014 13:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sam Steingold Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 07 May 2014 17:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17045 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17045-submit@debbugs.gnu.org id=B17045.139948544212089 (code B ref 17045); Wed, 07 May 2014 17:58:02 +0000 Original-Received: (at 17045) by debbugs.gnu.org; 7 May 2014 17:57:22 +0000 Original-Received: from localhost ([127.0.0.1]:54760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wi65p-00038u-54 for submit@debbugs.gnu.org; Wed, 07 May 2014 13:57:21 -0400 Original-Received: from mail-qg0-f49.google.com ([209.85.192.49]:42900) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wi65n-00038c-4z for 17045@debbugs.gnu.org; Wed, 07 May 2014 13:57:19 -0400 Original-Received: by mail-qg0-f49.google.com with SMTP id a108so1463753qge.36 for <17045@debbugs.gnu.org>; Wed, 07 May 2014 10:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:references:user-agent :return-receipt-to:reply-to:date:message-id:mime-version :content-type; bh=Ral7u3DSlkVB566JCBIsThi+tmjNCtVRIlLgbR9+3Ag=; b=MoZYej3QDI61LYyJdv99xLu6B7YeeCZyZ+W/ecow3OROwiI5Xm+g7ltNDD0sdImlLJ A8YO34t29QswtI27JBk9dVjg1CRTo3ZPYTwI0AZJZtx9X4Lry7o3Woi+Xtr7E0MaWDe3 gRVhgDTAAaQ79ranb5PfG75pCnfBUZiEXeJlS8Zo2cfZcw6rui9vTGJ9v7mYPElYPl1v jBSRk83mzWsTP9gg7lTN0K5ooQEsMcm+/y+XeChLGgbQnD4SxPLklcIhUx1wp4q8VMnY cX5o0o1vH+oRwWo4fzRfK0ujm3Y6AVT1u/HPpUw+CKdr1xn89Et8ReYh/M78GU1+wH7J w0tA== X-Received: by 10.224.8.131 with SMTP id h3mr68485260qah.61.1399485433208; Wed, 07 May 2014 10:57:13 -0700 (PDT) Original-Received: from sds-MacBook-Pro.local (static-72-80-117-250.nycmny.fios.verizon.net. [72.80.117.250]) by mx.google.com with ESMTPSA id 21sm20833567qgh.23.2014.05.07.10.57.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 May 2014 10:57:11 -0700 (PDT) In-Reply-To: (Leo Liu's message of "Tue, 08 Apr 2014 16:33:18 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (darwin) X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:88742 Archived-At: Hi Leo, > * Leo Liu [2014-04-08 16:33:18 +0800]: > > On 2014-03-20 10:33 +0800, Sam Steingold wrote: >> It is not nice to have to do M-x rcirc whenever the connection dies. >> Would it be possible to incorporate something similar to >> http://www.emacswiki.org/emacs/rcircReconnect > > Would something like this suit your needs? Thanks for testing. - Leo This indeed enables me to auto-reconnect like this: --8<---------------cut here---------------start------------->8--- (defvar sds-rcirc-sentinel-last (current-time) "last reconnect attempt time") (defun sds-rcirc-sentinel (process sentinel) (let* ((now (current-time)) (delay (float-time (time-subtract (current-time) sds-rcirc-sentinel-last)))) (message "%s sds-rcirc-sentinel: %s %s %s (last: %s, %s ago)" (format-time-string "%F %R") process (process-status process) sentinel (format-time-string "%F %R" sds-rcirc-sentinel-last) (sds-difftime-to-string delay)) (when (and (string= sentinel "deleted") (< 60 delay)) ; do not try to reconnect more than once a minute (setq sds-rcirc-sentinel-last now) (rcirc-cmd-reconnect nil)))) (add-hook 'rcirc-sentinel-functions 'sds-rcirc-sentinel) --8<---------------cut here---------------end--------------->8--- However, I would much prefer to enable auto-reconnect by a simple (custom-set-variables '(rcirc-reconnect-interval 60)) where rcirc-reconnect-interval = 0 means the current behavior (no auto-reconnect). Do you mind if I commit something based on the above or would you like to implement it yourself? Thanks a lot for your help! -- Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1265 http://www.childpsy.net/ http://think-israel.org http://mideasttruth.com http://pmw.org.il http://honestreporting.com There is an exception to every rule, including this one.