;ELC   
;;; Compiled by amu@quiche-lorraine.mit.edu on Thu Jan  6 19:17:14 2000
;;; from file /afs/sipb.mit.edu/contrib/emacs/packages/gnus-5.8.3/lisp/gnus-demon.el
;;; in Emacs version 20.4.1
;;; with bytecomp version 2.56
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`gnus-demon.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\301\302!\210\301\303!\210\301\304!\210\301\305!\210\301\306!\210\301\307!\210\310\311\312 \"\203' \301\313!\210\202+ \301\314!\210\315\316\317\320\302%\207" [:group require gnus gnus-int nnheader nntp nnmail gnus-util string-match "XEmacs" emacs-version itimer timer custom-declare-group gnus-demon nil "Demonic behaviour."] 6)
#@599 Alist of daemonic handlers to be run at intervals.
Each handler is a list on the form

(FUNCTION TIME IDLE)

FUNCTION is the function to be called.
TIME is the number of `gnus-demon-timestep's between each call.
If nil, never call.  If t, call each `gnus-demon-timestep'.
If IDLE is t, only call if Emacs has been idle for a while.  If IDLE
is a number, only call when Emacs has been idle more than this number
of `gnus-demon-timestep's.  If IDLE is nil, don't care about
idleness.  If IDLE is a number and TIME is nil, then call once each
time Emacs has been idle for IDLE `gnus-demon-timestep's.
(custom-declare-variable 'gnus-demon-handlers 'nil '(#$ . 990) :group 'gnus-demon :type '(repeat (list function (choice :tag "Time" (const :tag "never" nil) (const :tag "one" t) (integer :tag "steps" 1)) (choice :tag "Idle" (const :tag "don't care" nil) (const :tag "for a while" t) (integer :tag "steps" 1)))))
#@44 *Number of seconds in each demon timestep.
(custom-declare-variable 'gnus-demon-timestep '60 '(#$ . -1906) :group 'gnus-demon :type 'integer)
(byte-code "\306\300!\204 \307\300	B\306\302!\204 \307\302	B\306\303!\204  \310\303	B\306\304!\204, \307\304	B\306\305!\2048 \307\305	B\307\207" [gnus-demon-timer current-load-list gnus-demon-idle-has-been-called gnus-demon-idle-time gnus-demon-handler-state gnus-demon-last-keys boundp nil 0] 2)
#@48 *If non-nil, no daemonic function will be run.
(defvar gnus-inhibit-demon nil (#$ . -2363))
#@54 Add the handler FUNCTION to be run at TIME and IDLE.
(defalias 'gnus-demon-add-handler #[(function time idle) "\304!\210	\nEB\305 \207" [function time idle gnus-demon-handlers gnus-demon-remove-handler gnus-demon-init] 3 (#$ . 2461)])
#@56 Remove the handler FUNCTION from the list of handlers.
(defalias 'gnus-demon-remove-handler #[(function &optional no-init) "\303	\236	\"\n?\205 \304 \207" [function gnus-demon-handlers no-init delq gnus-demon-init] 3 (#$ . 2706)])
#@29 Initialize the Gnus daemon.
(defalias 'gnus-demon-init #[nil "\306 \210\205 \307	\211\310#\311\312\"\313\314\211\207" [gnus-demon-handlers gnus-demon-timestep gnus-demon-timer gnus-demon-handler-state gnus-demon-idle-time gnus-demon-idle-has-been-called gnus-demon-cancel nnheader-run-at-time gnus-demon mapcar #[(handler) "@\301A@!\3028E\207" [handler gnus-demon-time-to-step 2] 4] 0 nil] 4 (#$ . 2946) nil])
(gnus-add-shutdown 'gnus-demon-cancel 'gnus)
#@26 Cancel any Gnus daemons.
(defalias 'gnus-demon-cancel #[nil "\203 \302!\210\303\303\303\304\305\217\207" [gnus-demon-timer gnus-demon-idle-has-been-called nnheader-cancel-timer nil (byte-code "\300\301!\207" [nnheader-cancel-function-timers gnus-demon] 2) ((error t))] 3 (#$ . 3417) nil])
#@31 Whether Emacs is idle or not.
(defalias 'gnus-demon-is-idle-p #[nil "\302 \211	\232\206\f \303)\207" [keys gnus-demon-last-keys recent-keys nil] 3 (#$ . 3717)])
#@66 Find out how many seconds to TIME, which is on the form "17:43".
(defalias 'gnus-demon-time-to-step #[(time) ";\204 \207\306 \307	!\310!\211\311\234\312\234\313\311\f\n\314\234\f\n\315\234W\2049 \f\n\315\234U\203= \n\312\234X\203= \312\202> \311\\\n\316\234\n\317\234\n\320\234\n\321\234\n\322\234&	\211@	@Z\323_A@	A@Z\\\324\245!.\207" [time now nowParts thenParts thenHour thenMin current-time decode-time parse-time-string 0 1 encode-time 3 2 4 5 6 7 8 65536 round then diff gnus-demon-timestep] 12 (#$ . 3887)])
#@63 The Gnus daemon that takes care of running all Gnus handlers.
(defalias 'gnus-demon #[nil "\306 \203 T\202 \307\310\311\312 !?\205\302 \n?\205\302 \313\310\211\211\205\301 \211A@\211A@\211\247\203\205 \307U\204N AS\211\240\210\307U\203( \3148\211\203n \f\247\203h \fW\202k \307W\203( \315\316\317\217\210A\320@\236A@!\240\210\202( \3148\211\203( \f\247\204\240 \306 \203\240 \321\322\323\217\210\202( @	>\204( \fW\203( \306 \203( \324\325\326\217\210@	B\202( -\207" [gnus-demon-idle-time gnus-demon-idle-has-been-called gnus-inhibit-demon gnus-demon-handler-state idle time gnus-demon-is-idle-p 0 nil window-minibuffer-p selected-window t 2 #1=#:G81948 (byte-code "@ \207" [handler] 1) ((error)) gnus-demon-time-to-step #2=#:G81949 (byte-code "@ \207" [handler] 1) ((error)) #3=#:G81950 (byte-code "@ \207" [handler] 1) ((error)) handler handlers gnus-demon-handlers] 6 (#$ . 4431)])
#@38 Add daemonic NoCeM handling to Gnus.
(defalias 'gnus-demon-add-nocem #[nil "\300\301\302\303#\207" [gnus-demon-add-handler gnus-demon-scan-nocem 60 30] 4 (#$ . 5373)])
#@39 Scan NoCeM groups for NoCeM messages.
(defalias 'gnus-demon-scan-nocem #[nil "\300\213\207" [((gnus-nocem-scan-groups))] 1 (#$ . 5547)])
#@44 Add daemonic server disconnection to Gnus.
(defalias 'gnus-demon-add-disconnection #[nil "\300\301\302\303#\207" [gnus-demon-add-handler gnus-demon-close-connections nil 30] 4 (#$ . 5690)])
(defalias 'gnus-demon-close-connections #[nil "\300\213\207" [((gnus-close-backends))] 1])
#@143 Add daemonic nntp server disconnection to Gnus.
If no commands have gone out via nntp during the last five
minutes, the connection is closed.
(defalias 'gnus-demon-add-nntp-close-connection #[nil "\300\301\302\303#\207" [gnus-demon-add-handler gnus-demon-nntp-close-connections 5 nil] 4 (#$ . 5978)])
(defalias 'gnus-demon-nntp-close-connection #[nil "\300\213\207" [((byte-code "\301\302\303!\"\205 \304 \207" [nntp-last-command-time time-less-p (0 300) time-since nntp-close-server] 4))] 1])
#@55 Add daemonic scanning of mail from the mail backends.
(defalias 'gnus-demon-add-scanmail #[nil "\300\301\302\303#\207" [gnus-demon-add-handler gnus-demon-scan-mail 120 60] 4 (#$ . 6480)])
(defalias 'gnus-demon-scan-mail #[nil "\300\213\207" [((byte-code "\305\n\211A@@\211\2050 \306	@\307\310\311\217*\203 \312	!\204( \313	!\203 \314\305	\"\210\202 *\207" [gnus-opened-servers server servers group func nil request-scan #1=#:G81951 (byte-code ";\203\f \303!@\202 \304	!\204 \305	!\210\306\307\310\311	\n#!!)\207" [group method func gnus-find-method-for-group featurep require fboundp intern format "%s-%s"] 6) ((error)) gnus-server-opened gnus-open-server gnus-request-scan] 3))] 1])
#@58 Add daemonic scanning of new articles from all backends.
(defalias 'gnus-demon-add-rescan #[nil "\300\301\302\303#\207" [gnus-demon-add-handler gnus-demon-scan-news 120 60] 4 (#$ . 7186)])
(defalias 'gnus-demon-scan-news #[nil "\301 \302\216\303\213*\207" [win current-window-configuration ((set-window-configuration win)) ((byte-code "\212\301 \205 \212q\210\302 ))\207" [gnus-group-buffer gnus-alive-p gnus-group-get-new-news] 1))] 1])
#@57 Add daemonic updating of timestamps in empty newgroups.
(defalias 'gnus-demon-add-scan-timestamps #[nil "\300\301\302\303#\207" [gnus-demon-add-handler gnus-demon-scan-timestamps nil 30] 4 (#$ . 7633)])
#@76 Set the timestamp on all newsgroups with no unread and no ticked articles.
(defalias 'gnus-demon-scan-timestamps #[nil "\306 \205K \307 A\310\211\211\211\211A@\211\205I \f@\311\"J@\312\313\f8\236A\n\247\203 \n\314U\203 	\204 \315\316#\210\202 .\207" [gnus-newsrc-alist has-ticked unread group info newsrc gnus-alive-p current-time nil intern-soft tick 3 0 gnus-group-set-parameter timestamp cur-time gnus-newsrc-hashtb] 6 (#$ . 7842)])
(provide 'gnus-demon)
