From: Jean Magnan de Bornier <jean@bornier.net>
To: help-gnu-emacs@gnu.org
Subject: Re: How to prevent Gnus from losing connection with nnimap?
Date: Fri, 06 Mar 2009 08:42:27 +0100 [thread overview]
Message-ID: <87r61bqeqk.fsf@bornier.net> (raw)
In-Reply-To: mailman.2453.1236297442.31690.help-gnu-emacs@gnu.org
"Sven Bretfeld" <sven.bretfeld@gmx.ch> wrote :
| Hello
>
| I'm using Gnus to read emails via IMAP. Every 5 minutes or so Gnus loses
| the connection to the server.
Do you mean it loses the internet connection? If so, it is your machine,
not emacs. Otherwise, gnus needs to connect to your IMAP server only when
it checks mail, and that can be configured. And anyway gnus can work
without being connected to the internet and prepare messages to be sent
later. Have a look at the "Gnus unplugged" entry of the manual.
| So, it's impossible to let a Gnus instance run for a longer time. Even
| if I compose a longer message I have to save it in the drafts folder,
| close Gnus and start it again, before I can send the message.
>
| Is there any way to automatically refresh the connection every few
| minutes?
Well, I have this in my .gnus file (found on the net someday); for groups
with level=2 it makes an automatic check:
=======================================
(defun gnus-demon-scan-mail-or-news-and-update (level)
"Recherche de news et mail, mise à jour du tampon *Group*."
(let ((win (current-window-configuration)))
(unwind-protect
(save-window-excursion
(save-excursion
(when (gnus-alive-p)
(save-excursion
(set-buffer gnus-group-buffer)
(gnus-group-get-new-news level)))))
(set-window-configuration win))))
; level 2: only mail groups are scanned.
(defun gnus-demon-scan-mail-and-update ()
"Scan for new mail, updating the *Group* buffer."
(gnus-demon-scan-mail-or-news-and-update 2))
(gnus-demon-add-handler 'gnus-demon-scan-mail-and-update 5 nil)
;; ;;
(defun my-check-mail ()
"Fetch new mails only."
(gnus-group-get-new-news 2))
(add-hook 'gnus-startup-hook
'(lambda ()
(gnus-demon-add-handler 'my-check-mail 2 0)))
======================================
hth,
--
Jean
next parent reply other threads:[~2009-03-06 7:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.2453.1236297442.31690.help-gnu-emacs@gnu.org>
2009-03-06 7:42 ` Jean Magnan de Bornier [this message]
2009-03-06 9:42 ` How to prevent Gnus from losing connection with nnimap? Nikolaj Schumacher
2009-03-09 20:23 ` [Solved] " Sven Bretfeld
2009-03-05 23:57 Sven Bretfeld
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r61bqeqk.fsf@bornier.net \
--to=jean@bornier.net \
--cc=help-gnu-emacs@gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).