Gnus development mailing list
 help / color / mirror / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Divya Ranjan <divya@subvertising.org>
Cc: ding@gnus.org
Subject: Re: nntp and nnimap disconnect and take forever when emacs is idle
Date: Tue, 22 Oct 2024 09:57:59 +0200	[thread overview]
Message-ID: <87iktklgc8.fsf@gmx.net> (raw)
In-Reply-To: <87froospgn.fsf@subvertising.org> (Divya Ranjan's message of "Tue, 22 Oct 2024 04:59:04 +0000")

On Tue, 22 Oct 2024 04:59:04 +0000 Divya Ranjan <divya@subvertising.org> wrote:

> Does anyone else also experience this, when they’ve left their Emacs or just
> gnus idle for sometime, it disconnects from the server, whether nntp or
> nnimap, and then when you open a group that’s requesting that server, it takes
> forever to load. Is this one of those things that you have to swallow with
> Gnus, or is there some hack?

At least concerning nntp this sounds like bug#52735 (which I continue to
experience); see also the thread beginning at
<https://lists.gnu.org/archive/html/info-gnus-english/2023-06/msg00014.html>.

I use the following hack, added to my ~/.emacs.d/.gnus.el file:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun srb-gnus-group-get-new-news (&optional arg one-level)
  (interactive "P")
  (with-timeout (1 (kill-buffer (nntp-find-connection-buffer
                                 nntp-server-buffer))
		   (gnus-group-get-new-news))
    (gnus-group-get-new-news arg one-level)))

(defun srb-gnus-summary-next-unread-article ()
  (interactive)
  (with-timeout (1 (kill-buffer (nntp-find-connection-buffer
                                 nntp-server-buffer))
		   (gnus-summary-next-unread-article))
    (gnus-summary-next-unread-article)))

(defun srb-gnus-summary-next-page (&optional lines circular stop)
  (interactive "P")
  (with-timeout (1 (kill-buffer (nntp-find-connection-buffer
                                 nntp-server-buffer))
		   (gnus-summary-next-page))
    (gnus-summary-next-page lines circular stop)))

(defun srb-gnus-summary-scroll-up (lines)
  (interactive "P")
  (with-timeout (1 (kill-buffer (nntp-find-connection-buffer
                                 nntp-server-buffer))
		   (gnus-summary-scroll-up lines))
    (gnus-summary-scroll-up lines)))

(define-key gnus-group-mode-map "g" 'srb-gnus-group-get-new-news)
(define-key gnus-summary-mode-map "n" 'srb-gnus-summary-next-unread-article)
(define-key gnus-summary-mode-map " " 'srb-gnus-summary-next-page)
(define-key gnus-summary-mode-map "\r" 'gnus-summary-scroll-up)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

But this is brittle and doesn't always work.  If you find a real
solution, I'd be interested to see it.

Steve Berman


  parent reply	other threads:[~2024-10-23 18:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22  4:59 Divya Ranjan
2024-10-22  7:44 ` NNTP Surfer
2024-10-24  8:03   ` Gijs Hillenius
2024-10-24  9:20     ` NNTP Surfer
2024-10-24 10:34       ` Gijs Hillenius
2024-10-22  7:57 ` Stephen Berman [this message]
2024-10-22 19:07 ` Jakub Ječmínek
2024-10-23 11:50   ` Gijs Hillenius
2024-10-23 11:57     ` Gijs Hillenius
2024-10-23  3:27 ` Bob Newell
2024-10-23 15:10   ` Alberto Luaces
2024-10-26 22:53 ` James Thomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iktklgc8.fsf@gmx.net \
    --to=stephen.berman@gmx.net \
    --cc=ding@gnus.org \
    --cc=divya@subvertising.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).