Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Get rid of "Mail source error... continue (y/n)?""
@ 2003-02-07 14:25 Sergei Organov
  0 siblings, 0 replies; only message in thread
From: Sergei Organov @ 2003-02-07 14:25 UTC (permalink / raw)



A few of my groups get mail from a POP3 server and sometimes gnus encounters
problems talking to the server during group buffer update. Whenever a
problem occurs gnus stops and prompts me if I wish to continue. This is Ok
when I run update manually. However, I'd like to update from gnus-demon
periodically as well and here batch behavior is required.

I'd like to arrange things so that gnus will just continue whenever POP3
problem is encountered and 'gnus-group-get-new-news' is invoked from the
demon. Yet I didn't find any other solution but to override the 'yes-or-no-p'
function (that is used for prompting) to just return `t'. I have very little
knowledge of elisp, so I'd like to get some feedback on the code below.
Does it actually do what I think it does? Is there better way to achieve the
initial goal (fixing the POP3 server aside)?

(require 'cl)
(defun gnus-demon-update-group-buffer-level-1 ()
  "Update the group buffer."
  (save-window-excursion
    ;; Override yes-or-no-p function to just return t to get rid of
    ;; "Mail source error... continue (y/n)?" prompt.
    (letf ((symbol-function 'yes-or-no-p) '(lambda () t))
      (gnus-group-get-new-news 1))))

(gnus-demon-add-handler 'gnus-demon-update-group-buffer-level-1 10 2)


Thanks in advance.

--
Sergei.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-02-07 14:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-07 14:25 Get rid of "Mail source error... continue (y/n)?"" Sergei Organov

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).