1 ;;; gnus-offline.el --- To process mail & news at offline environment.
2 ;;; $Id: gnus-offline.el,v 1.1.2.5.2.5 1998-11-09 14:44:06 ichikawa Exp $
4 ;;; Copyright (C) 1998 Tatsuya Ichikawa
6 ;;; Author: Tatsuya Ichikawa <t-ichi@po.shiojiri.ne.jp>
7 ;;; Yukihiro Ito <ito@rs.civil.tohoku.ac.jp>
8 ;;; Hidekazu Nakamura <u90121@uis-inf.co.jp>
11 ;;; Keywords: news , mail , offline , gnus
14 ;;; Keiichi Suzuki <kei-suzu@mail.wbs.or.jp>
15 ;;; KORIYAMA Naohiro <kory@ba2.so-net.or.jp>
16 ;;; Katsumi Yamaoka <yamaoka@jpl.org>
18 ;;; This file is part of Semi-gnus.
20 ;;; GNU Emacs is free software; you can redistribute it and/or modify
21 ;;; it under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 2, or (at your option)
23 ;;; any later version.
25 ;;; GNU Emacs is distributed in the hope that it will be useful,
26 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Emacs; see the file COPYING. If not, write to the
32 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
33 ;;; Boston, MA 02111-1307, USA.
37 ;;; This file works only with after version of Emacs 19.30.
38 ;;; This file needs miee.el and SEMI.
39 ;;; If you set gnus-offline-drafts-queue-type to 'agent , you don't need
41 ;;; You must use Semi-gnus 6.X.X.
45 ;;; Add following code at the end in your .emacs
47 ;;; (load "gnus-ofsetup")
48 ;;; (gnus-setup-for-offline)
49 ;;; (load gnus-offline-setting-file)
51 ;;; put following code in you .gnus-offline.el.
53 ;;; (setq gnus-offline-dialup-program-arguments '("-a" "-b"))
54 ;;; (setq gnus-offline-hangup-program-arguments '("-c" "-d"))
56 ;;; If you use gnus-agent as souper , put gnus-agent setup code in you .gnus.el
58 ;;; If you use nnspool as souper , put following code in your .emacs before
59 ;;; gnus-offline setting.
61 ;;; Then , put hang.exe in exec-path directory.
63 ;;; In Gnus group buffer , type g to get all news and mail.
64 ;;; Then send mail and news in spool directory.
67 ;;; gnus-offline-dialup-program-arguments
68 ;;; ... List of dialup program arguments.
69 ;;; gnus-offline-hangup-program-arguments
70 ;;; ... List of hangup program arguments.
71 ;;; gnus-offline-mail-treat-environ ... toggle sending mail online/offline.
72 ;;; gnus-offline-articles-to-fetch ... toggle fetch articles.
73 ;;; both->mail->news->both...
74 ;;; gnus-offline-load-hook ... hook before gnus-offline load.
75 ;;; gnus-offline-before-online-hook ... hook before all online jobs.
76 ;;; gnus-offline-after-online-hook ... hook after all online jobs.
77 ;;; gnus-offline-interval-time ... Interval time to do all online jobs.
79 ;;; gnus-offline-dialup-function ... Function to diualup.
80 ;;; gnus-offline-hangup-function ... Function to hangup.
84 (eval '(run-hooks 'gnus-offline-load-hook))
90 (unless (and (condition-case ()
96 (defmacro defgroup (&rest args))
97 (defmacro defcustom (symbol value &optional doc &rest args)
98 (` (defvar (, symbol) (, value) (, doc))))
100 (defgroup gnus-offline nil
101 "Offline backend utility for Gnus."
102 :prefix "gnus-offline-"
106 (defconst gnus-offline-version-number "2.00b1")
107 (defconst gnus-offline-codename
109 ;; "This is the time" ; 2.00
110 ;; "A matter of trust"
115 (defconst gnus-offline-version (format "Gnus offline backend utiliy v%s"
116 gnus-offline-version-number))
118 (defcustom gnus-offline-dialup-program-arguments nil
119 "*Program arguments of gnus-offline-dialup-program."
121 :type '(repeat (string :tag "Argument")))
123 (defcustom gnus-offline-hangup-program-arguments nil
124 "*Program arguments of gnus-offline-hangup-program."
126 :type '(repeat (string :tag "Argument")))
128 (defcustom gnus-offline-auto-hangup t
129 "*Whether dialup-network automatically hang up when all online jobs has done."
133 (defcustom gnus-offline-load-hook nil
134 "*Hook to be run after the gnus-offline package has been loaded."
138 (defcustom gnus-offline-before-online-hook nil
139 "*Hook to be run before all online jobs."
143 (defcustom gnus-offline-after-online-hook nil
144 "*Hook to be run after all online jobs."
148 (defcustom gnus-offline-mail-treat-environ 'offline
149 "*If online , gnus-offline send all mail under online environ.
150 If offline , gnus-offline send all mail temporary to spool dir."
152 :type '(choice (const offline)
155 (defcustom gnus-offline-articles-to-fetch 'both
156 "*If both , gnus-offline fetch mail and news articles.
157 If mail , gnus-offline only fetch mail articles.
158 If news , gnus-offline only fetch news articles."
160 :type '(choice (const both)
164 (defcustom gnus-offline-interval-time 0
165 "*Interval time(minutes) to do online jobs.
166 If set to 0 , timer call is disabled."
170 (defcustom gnus-offline-mail-group-level 1
171 "*Group level for mail group."
175 (defcustom gnus-offline-after-empting-spool-hook nil
176 "*Hook to be run before empting spool."
180 (defcustom gnus-offline-before-empting-spool-hook nil
181 "*Hook to be run after empting spool."
185 (defcustom gnus-offline-dialup-function 'gnus-offline-connect-server
186 "*Function to dialup."
190 (defcustom gnus-offline-hangup-function 'gnus-offline-hangup-line
191 "*Function to hangup."
195 ;;; Internal variables.
196 (defvar gnus-offline-connected nil
197 "*If value is t , dialup line is connected status.
198 If value is nil , dialup line is disconnected status.")
200 (defvar gnus-offline-news-fetch-method nil
201 "*Method to fetch news articles.")
203 (defvar gnus-offline-mail-fetch-method nil
204 "*Method to fetch mail articles.")
206 (defvar gnus-offline-header-string
207 (format "%s - \"%s\""
209 gnus-offline-codename)
210 "*Header string for gnus-offline.")
212 (defvar gnus-offline-stored-group-level nil
213 "*Mail Group level before changing.")
215 (defvar gnus-offline-movemail-arguments nil
216 "*All command line arguments of exec-directory/movemail.")
218 ;;; Temporary variable:
225 (defvar gnus-offline-map (make-sparse-keymap))
227 ;;; To silence byte compiler
229 (fboundp 'eval-when-compile)
233 (eval-region (point-min) (point)))
234 (let (case-fold-search)
238 (unless (boundp symbol)
239 (make-local-variable symbol)
240 (eval (list 'setq symbol nil)))))
243 sendmail-to-spool-directory
244 news-spool-request-post-directory
252 gnus-agent-handle-level
254 (make-local-variable 'byte-compile-warnings)
255 (setq byte-compile-warnings nil))))
257 (put 'gnus-offline-set-unplugged-state 'menu-enable 'gnus-offline-connected)
262 (defun gnus-offline-setup ()
263 "*Initialize gnus-offline function"
265 ;; Load setting file - required.
266 (load gnus-offline-setting-file)
269 (gnus-offline-define-menu-and-key)
271 ;; To transfer Mail/News function.
272 (cond ((eq gnus-offline-mail-treat-environ 'offline)
273 ;; send mail under online environ.
274 (gnus-offline-set-offline-sendmail-function))
275 ((eq gnus-offline-mail-treat-environ 'online)
276 ;; send mail under offline environ.
277 (gnus-offline-set-online-sendmail-function))))
280 (defun gnus-offline-set-offline-sendmail-function ()
281 "*Initialize sendmail-function when unplugged status."
282 (if (eq gnus-offline-drafts-queue-type 'miee)
283 (setq message-send-mail-function 'sendmail-to-spool-in-gnspool-format)
284 (setq message-send-mail-function 'gnus-agent-send-mail)))
286 (defun gnus-offline-set-online-sendmail-function ()
287 "*Initialize sendmail-function when plugged status."
288 (if (eq gnus-offline-MTA-type 'smtp)
289 (setq message-send-mail-function 'message-send-mail-with-smtp)
290 (setq message-send-mail-function 'message-send-mail-with-sendmail)))
292 (defun gnus-offline-set-offline-post-news-function ()
293 "*Initialize sendnews-function when unplugged status."
294 (if (eq gnus-offline-drafts-queue-type 'miee)
295 (setq message-send-news-function 'gnspool-request-post)))
297 (defun gnus-offline-set-online-post-news-function ()
298 "*Initialize sendnews-function when plugged status."
299 (setq message-send-news-function 'message-send-news-with-gnus))
301 ;; Get new news jobs. (gnus-agent and nnspool)
303 (defun gnus-offline-gnus-get-new-news (&optional arg)
304 "*Override function \"gnus-grou-get-new-news\"."
306 (run-hooks 'gnus-offline-before-online-hook)
307 (if (functionp gnus-offline-dialup-function)
308 (funcall gnus-offline-dialup-function))
309 (gnus-offline-get-new-news-function)
310 (gnus-group-get-new-news arg))
315 (defun gnus-offline-connect-server ()
317 ;; Dialup if gnus-offline-dialup-program is specified
318 (if (stringp gnus-offline-dialup-program)
320 (message "Dialing ...")
321 (apply 'call-process gnus-offline-dialup-program nil nil nil
322 gnus-offline-dialup-program-arguments)
324 (message "Dialing ... done."))))
327 ;; Jobs before get new news , send mail and post news.
329 (defun gnus-offline-get-new-news-function ()
330 "*Prepare to get new news/mail."
331 ;; Set mail group level
332 (if (eq gnus-offline-articles-to-fetch 'mail)
333 (gnus-offline-set-mail-group-level gnus-offline-mail-group-level))
335 ;; Set to online environ.
336 (setq gnus-offline-connected t)
338 ;; Set send mail/news functions to online functions.
339 (gnus-offline-set-online-sendmail-function)
340 (gnus-offline-set-online-post-news-function)
341 (message "Set to online status.")
344 (if (eq gnus-offline-articles-to-fetch 'news)
345 (gnus-offline-disable-fetch-mail))
347 ;; fetch both mail and news. or Only mail.
348 (gnus-offline-enable-fetch-news)
349 (if (memq gnus-offline-articles-to-fetch '(both mail))
350 (gnus-offline-enable-fetch-mail))
352 ;; fetch only mail for gnus-agent
353 (if (and (eq gnus-offline-news-fetch-method 'nnagent)
354 (eq gnus-offline-articles-to-fetch 'mail))
355 (setq gnus-agent-handle-level gnus-offline-mail-group-level)))
358 ;; Change mail group level to handle only mail.
360 (defun gnus-offline-set-mail-group-level (level)
361 "*Set nnm* group level."
362 (switch-to-buffer gnus-group-buffer)
363 (goto-char (point-min))
365 ;; Save current level
366 (if (not gnus-offline-stored-group-level)
367 (while (re-search-forward " nnm" nil t)
368 (setq gnus-offline-stored-group-level
369 (append gnus-offline-stored-group-level
370 (list (gnus-group-group-level)))))
374 (goto-char (point-min))
375 (while (re-search-forward " nnm" nil t)
376 (gnus-group-set-current-level 1 level)
381 ;; Restore mail group level
383 (defun gnus-offline-restore-mail-group-level ()
384 "*Restore nnm* group level."
385 (switch-to-buffer gnus-group-buffer)
386 (goto-char (point-min))
388 (while (re-search-forward " nnm" nil t)
389 (gnus-group-set-current-level 1 (nth num gnus-offline-stored-group-level))
392 (beginning-of-line)))
394 ;; Jobs after getting new news.
396 (defun gnus-offline-after-get-new-news ()
397 "*After getting news and mail jobs."
398 (if (memq gnus-offline-articles-to-fetch '(both mail))
401 ;; send mail/news in spool
402 (gnus-offline-empting-spool)
403 (if (eq gnus-offline-articles-to-fetch 'mail)
405 ;; Send only mail and hang up...
406 (if (and gnus-offline-connected
407 gnus-offline-auto-hangup)
408 (gnus-offline-set-unplugged-state))
409 ;; Disable fetch mail.
410 (gnus-offline-disable-fetch-mail)
411 (gnus-offline-after-jobs-done)))))
414 (if (memq gnus-offline-articles-to-fetch '(both news))
416 (if gnus-offline-connected
417 (cond ((eq gnus-offline-news-fetch-method 'nnagent)
418 ;; Get New News (gnus-agent)
419 (gnus-agent-toggle-plugged t)
422 (gnus-agent-fetch-session)
424 ;; Hang Up line. then set to offline status.
425 (if (and gnus-offline-connected
426 gnus-offline-auto-hangup)
427 (gnus-offline-set-unplugged-state))
429 ;; All online jobs has done.
430 (gnus-offline-after-jobs-done))
432 (if (eq gnus-offline-news-fetch-method 'nnspool)
433 ;; Get New News (nnspool)
434 (gnspool-get-news))))))))
436 ;; Disable fetch mail
438 (defun gnus-offline-disable-fetch-mail ()
439 "*Set do not fetch mail."
440 (setq nnmail-spool-file nil))
444 (defun gnus-offline-enable-fetch-mail ()
445 "*Set to fetch mail."
446 (setq gnus-offline-mail-fetch-method 'nnmail)
447 (setq nnmail-movemail-program 'pop3-fma-movemail)
448 (setq nnmail-spool-file (append
449 pop3-fma-local-spool-file-alist
453 pop3-fma-spool-file-alist))))
457 (defun gnus-offline-enable-fetch-news ()
458 "*Set to fetch news."
459 (if (eq gnus-offline-news-fetch-method 'nnagent)
461 (setq gnus-agent-handle-level gnus-level-subscribed)
462 (gnus-agent-toggle-plugged t))))
465 ;; Add your custom header.
467 (defun gnus-offline-add-custom-header (header string)
468 "*Add X-Gnus-Offline-Backend header to Mail/News message."
470 (progn (goto-char (point-min))
472 (concat "^" (regexp-quote mail-header-separator) "\n"))
474 (goto-char (point-min))
475 (or (re-search-forward (concat "^" header) delimline t)
477 (goto-char delimline)
480 (setq hdr (concat header " "))
481 (setq str (concat hdr string))
482 (setq hdr (concat str "\n"))
483 (insert-string hdr)))))
485 ;; Add X-Offline-Backend header.
487 (defun gnus-offline-message-add-header ()
488 "*Add X-Gnus-Offline-Backend header to Mail/News message."
489 (if (eq gnus-offline-mail-treat-environ 'offline)
491 (if (eq gnus-offline-news-fetch-method 'nnagent)
492 (setq ver nnagent-version)
493 (setq ver nnspool-version))
494 (setq str (format "\n with %s" ver)
495 string (concat gnus-offline-header-string str))
496 (gnus-offline-add-custom-header "X-Gnus-Offline-Backend:" string))))
500 ;; Toggle plugged/unplugged
502 (defun gnus-offline-toggle-plugged (plugged)
503 "*Override function \"Jj\" - gnus-agent-toggle-plugged."
504 (interactive (list (not gnus-offline-connected)))
507 (setq gnus-offline-connected plugged)
508 (gnus-agent-toggle-plugged plugged)
509 ;; Set send mail/news function to offline functions.
510 (gnus-offline-set-online-sendmail-function)
511 (gnus-offline-set-online-post-news-function))
512 ;; Set to offline status
513 (gnus-offline-set-unplugged-state)))
515 ;; Function of hang up line.
517 (defun gnus-offline-set-unplugged-state ()
518 "*Set to unplugged state."
521 (if (functionp gnus-offline-hangup-function)
522 (funcall gnus-offline-hangup-function))
523 (setq gnus-offline-connected nil)
524 (if (eq gnus-offline-news-fetch-method 'nnagent)
525 (gnus-agent-toggle-plugged nil))
527 ;; Set send mail/news function to offline functions.
528 (gnus-offline-set-offline-sendmail-function)
529 (gnus-offline-set-offline-post-news-function)
531 (setenv "MAILHOST" nil))
533 ;; Hangup line function
535 (defun gnus-offline-hangup-line ()
536 "*Hangup line function."
537 (message "Hang up line ... ")
538 (if (stringp gnus-offline-hangup-program)
539 (apply 'start-process "hup" nil gnus-offline-hangup-program
540 gnus-offline-hangup-program-arguments))
541 (message "Hang up line ... done."))
543 ;; Hang Up line routine whe using nnspool
545 (defun gnus-offline-nnspool-hangup-line ()
546 (if (and gnus-offline-connected
547 gnus-offline-auto-hangup)
548 (gnus-offline-set-unplugged-state))
549 (gnus-offline-after-jobs-done))
551 ;; Function of all jobs has done.
553 (defun gnus-offline-after-jobs-done ()
554 "*Jobs after all online jobs."
555 (run-hooks 'gnus-offline-after-online-hook)
556 (if (eq gnus-offline-articles-to-fetch 'mail)
557 (gnus-offline-restore-mail-group-level))
558 (if (eq gnus-offline-news-fetch-method 'nnagent)
559 (gnus-offline-agent-expire))
561 (message "All online jobs have done."))
565 ;; Toggle auto hang up
567 (defun gnus-offline-toggle-auto-hangup ()
568 "*Toggle auto hangup flag."
570 (setq string "Auto hang up logic")
571 (if gnus-offline-auto-hangup
573 (setq gnus-offline-auto-hangup nil
575 (setq gnus-offline-auto-hangup t
577 (message (format "%s %s" string str)))
579 ;; Toggle offline/online to send mail.
581 (defun gnus-offline-toggle-on/off-send-mail ()
582 "*Toggel online/offline sendmail."
584 (if (eq gnus-offline-mail-treat-environ 'offline)
586 ;; Sending mail under online environ.
587 (gnus-offline-set-online-sendmail-function)
588 (setq gnus-offline-mail-treat-environ 'online)
589 (message "Sending mail immidiately."))
590 ;; Sending mail under offline environ.
591 (gnus-offline-set-offline-sendmail-function)
592 (setq gnus-offline-mail-treat-environ 'offline)
593 (message "Sending mail temporary to spool directory.")))
595 ;; Toggle articles to fetch ... both -> mail -> news -> both
597 (defun gnus-offline-toggle-articles-to-fetch ()
598 "*Set articles to fetch... both(Mail/News) -> mail only -> News only -> both"
600 (setq string "Articles fetch from server.")
601 (cond ((eq gnus-offline-articles-to-fetch 'both)
602 (setq gnus-offline-articles-to-fetch 'mail
604 ((eq gnus-offline-articles-to-fetch 'mail)
605 (setq gnus-offline-articles-to-fetch 'news
608 (setq gnus-offline-articles-to-fetch 'both
609 str "Mail/News both")))
610 (message (format "%s %s" string str)))
612 ;; Toggle movemail program pop3.el -> movemail -> pop3.el
614 (defun gnus-offline-toggle-movemail-program ()
615 "*Toggle movemail program movemail -> pop3.el -> movemail ->..."
617 (setq string "Set nnmail-movemail-program")
618 (cond ((eq pop3-fma-movemail-type 'lisp)
619 (setq pop3-fma-movemail-type 'exe
622 (setq pop3-fma-movemail-type 'lisp
624 (message (format "%s %s" string str)))
626 ;; Send mail and Post news using Miee or gnus-agent.
628 (defun gnus-offline-empting-spool ()
629 "*Send all drafts on queue."
630 (run-hooks 'gnus-offline-before-empting-spool-hook)
631 (if (eq gnus-offline-drafts-queue-type 'miee)
632 ;; Send queued message by miee.el.
634 (if (eq gnus-offline-mail-treat-environ 'offline)
636 (message "Sending mails in spool ...")
637 ;; Using miee to send mail.
639 (message "Sending mails in spool ... done.")))
640 (message "Posting news in spool ...")
641 ;; Using miee to post news.
642 (if (and (not (stringp msspool-news-server))
643 (not msspool-news-service))
645 (setq msspool-news-server (nth 1 gnus-select-method))
646 (setq msspool-news-service 119)))
648 (message "Posting news in spool ... done."))
649 ;; Send queued message by gnus-agent
650 (message "Sending messages in spool ...")
651 (gnus-group-send-drafts)
652 (message "Sending messages in spool ... done."))
654 (run-hooks 'gnus-offline-after-empting-spool-hook))
658 (defun gnus-offline-set-interval-time ()
659 "*Set interval time for gnus-daemon."
661 (setq gnus-offline-interval-time
662 (string-to-int (read-from-minibuffer
663 (format "Interval time (now %s minutes) : "
664 gnus-offline-interval-time)
666 (if (< gnus-offline-interval-time 2)
668 (message "Retrieving message logic by timer is disabled.")
669 (setq gnus-offline-interval-time 0))
670 (message (format "Interval time set to %d minutes" gnus-offline-interval-time)))
671 (gnus-offline-processed-by-timer))
673 ;; Expire articles using gnus-agent.
675 (defun gnus-offline-agent-expire ()
676 "*Expire expirable article on News group."
682 (defun gnus-offline-define-menu-and-key ()
684 (if (eq gnus-offline-drafts-queue-type 'miee)
685 (add-hook 'gnus-group-mode-hook 'gnus-offline-define-menu-on-miee)
686 (add-hook 'gnus-group-mode-hook 'gnus-offline-define-menu-on-agent))
687 (add-hook 'gnus-group-mode-hook
689 (local-set-key "\C-coh" 'gnus-offline-set-unplugged-state)
690 (local-set-key "\C-com" 'gnus-offline-toggle-movemail-program)
691 (local-set-key "\C-cof" 'gnus-offline-toggle-articles-to-fetch)
692 (local-set-key "\C-coo" 'gnus-offline-toggle-on/off-send-mail)
693 (local-set-key "\C-cox" 'gnus-offline-toggle-auto-hangup)
694 (local-set-key "\C-cos" 'gnus-offline-set-interval-time)
695 (substitute-key-definition
696 'gnus-group-get-new-news 'gnus-offline-gnus-get-new-news
698 (if (eq gnus-offline-news-fetch-method 'nnagent)
700 (substitute-key-definition
701 'gnus-agent-toggle-plugged 'gnus-offline-toggle-plugged
702 gnus-agent-group-mode-map)
703 (local-set-key "\C-coe" 'gnus-offline-agent-expire)))))
704 (if (eq gnus-offline-news-fetch-method 'nnagent)
705 (add-hook 'gnus-summary-mode-hook
707 (substitute-key-definition
708 'gnus-agent-toggle-plugged 'gnus-offline-toggle-plugged
709 gnus-agent-summary-mode-map)))))
711 (defun gnus-offline-define-menu-on-miee ()
712 "*Set menu bar on MIEE menu."
716 gnus-offline-hup-separator]
723 (cons "Gnus Offline Utility"
724 (make-sparse-keymap "Gnus Offline Utiliry")))
730 gnus-offline-toggle-movemail-program]
731 '("Toggle movemail program" .
732 gnus-offline-toggle-movemail-program))
738 gnus-offline-toggle-articles-to-fetch]
739 '("Toggle articles to fetch" .
740 gnus-offline-toggle-articles-to-fetch))
746 gnus-offline-toggle-on/off-send-mail]
747 '("Toggle online/offline send mail" .
748 gnus-offline-toggle-on/off-send-mail))
754 gnus-offline-toggle-auto-hangup]
755 '("Toggle auto hang up" . gnus-offline-toggle-auto-hangup))
761 gnus-offline-expire-separator]
764 (if (eq gnus-offline-news-fetch-method 'nnagent)
769 gnus-offline-agent-expire]
770 '("Expire articles" . gnus-offline-agent-expire)))
776 gnus-offline-set-interval-time]
777 '("Set interval time." . gnus-offline-set-interval-time))
783 gnus-offline-hup-separator]
790 gnus-offline-set-unplugged-state]
791 '("Hang Up Line." . gnus-offline-set-unplugged-state)))
793 ;; define menu without miee.
795 (defun gnus-offline-define-menu-on-agent ()
796 "*Set menu bar on OFFLINE menu."
798 (lookup-key global-map [menu-bar])
800 (cons "Offline" (make-sparse-keymap "Offline"))
801 'help) ;; Actually this adds before "Help".
806 gnus-offline-toggle-movemail-program]
807 '("Toggle movemail program" . gnus-offline-toggle-movemail-program))
812 gnus-offline-toggle-articles-to-fetch]
813 '("Toggle articles to fetch" . gnus-offline-toggle-articles-to-fetch))
818 gnus-offline-toggle-on/off-send-mail]
819 '("Toggle online/offline send mail" . gnus-offline-toggle-on/off-send-mail))
824 gnus-offline-toggle-auto-hangup]
825 '("Toggle auto hang up" . gnus-offline-toggle-auto-hangup))
830 gnus-offline-separator]
833 (if (eq gnus-offline-news-fetch-method 'nnagent)
838 gnus-offline-agent-expire]
839 '("Expire articles" . gnus-offline-agent-expire))))
844 gnus-offline-set-interval-time]
845 '("Set interval time." . gnus-offline-set-interval-time))
850 gnus-offline-hup-separator]
856 gnus-offline-set-unplugged-state]
857 '("Hang Up Line." . gnus-offline-set-unplugged-state)))
861 (defun gnus-offline-processed-by-timer ()
862 "*Set timer interval."
863 (if (and (> gnus-offline-interval-time 0)
864 (not gnus-offline-connected))
866 (gnus-demon-add-handler 'gnus-offline-gnus-get-new-news
867 gnus-offline-interval-time
868 gnus-offline-interval-time))
869 (if (= gnus-offline-interval-time 0)
870 (gnus-demon-remove-handler 'gnus-offline-gnus-get-new-news t)))
873 (provide 'gnus-offline)
874 ;;; gnus-offline.el ends here