GNU bug report logs - #17045
24.3.50; feature request: rcirc-reconnect

Previous Next

Package: emacs;

Reported by: sds <at> gnu.org

Date: Thu, 20 Mar 2014 02:34:01 UTC

Severity: wishlist

Found in version 24.3.50

Fixed in version 25.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #35 received at 17045 <at> debbugs.gnu.org (full text, mbox):

From: Sam Steingold <sds <at> gnu.org>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 17045 <at> debbugs.gnu.org
Subject: Re: bug#17045: 24.3.50; feature request: rcirc-reconnect
Date: Wed, 07 May 2014 13:57:06 -0400
Hi Leo,

> * Leo Liu <fqy.jro <at> tznvy.pbz> [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.




This bug report was last modified 7 years and 167 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.