1 ;;; gnus-offline.el --- To process mail & news at offline environment.
2 ;;; $Id: gnus-offline.el,v 1.1.2.5.2.7 1998-11-11 14:36:13 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.00")
107 (defconst gnus-offline-codename
108 "This is the time" ; 2.00
109 ;; "A matter of trust"
114 (defconst gnus-offline-version (format "Gnus offline backend utiliy v%s"
115 gnus-offline-version-number))
117 (defcustom gnus-offline-dialup-program-arguments nil
118 "*Program arguments of gnus-offline-dialup-program."
120 :type '(repeat (string :tag "Argument")))
122 (defcustom gnus-offline-hangup-program-arguments nil
123 "*Program arguments of gnus-offline-hangup-program."
125 :type '(repeat (string :tag "Argument")))
127 (defcustom gnus-offline-auto-hangup t
128 "*Whether dialup-network automatically hang up when all online jobs has done."
132 (defcustom gnus-offline-load-hook nil
133 "*Hook to be run after the gnus-offline package has been loaded."
137 (defcustom gnus-offline-before-online-hook nil
138 "*Hook to be run before all online jobs."
142 (defcustom gnus-offline-after-online-hook nil
143 "*Hook to be run after all online jobs."
147 (defcustom gnus-offline-mail-treat-environ 'offline
148 "*If online , gnus-offline send all mail under online environ.
149 If offline , gnus-offline send all mail temporary to spool dir."
151 :type '(choice (const offline)
154 (defcustom gnus-offline-articles-to-fetch 'both
155 "*If both , gnus-offline fetch mail and news articles.
156 If mail , gnus-offline only fetch mail articles.
157 If news , gnus-offline only fetch news articles."
159 :type '(choice (const both)
163 (defcustom gnus-offline-interval-time 0
164 "*Interval time(minutes) to do online jobs.
165 If set to 0 , timer call is disabled."
169 (defcustom gnus-offline-mail-group-level 1
170 "*Group level for mail group."
174 (defcustom gnus-offline-after-empting-spool-hook nil
175 "*Hook to be run before empting spool."
179 (defcustom gnus-offline-before-empting-spool-hook nil
180 "*Hook to be run after empting spool."
184 (defcustom gnus-offline-dialup-function 'gnus-offline-connect-server
185 "*Function to dialup."
189 (defcustom gnus-offline-hangup-function 'gnus-offline-hangup-line
190 "*Function to hangup."
194 ;;; Internal variables.
195 (defvar gnus-offline-connected nil
196 "*If value is t , dialup line is connected status.
197 If value is nil , dialup line is disconnected status.")
199 (defvar gnus-offline-news-fetch-method nil
200 "*Method to fetch news articles.")
202 (defvar gnus-offline-mail-fetch-method nil
203 "*Method to fetch mail articles.")
205 (defvar gnus-offline-header-string
206 (format "%s - \"%s\""
208 gnus-offline-codename)
209 "*Header string for gnus-offline.")
211 (defvar gnus-offline-stored-group-level nil
212 "*Mail Group level before changing.")
214 (defvar gnus-offline-movemail-arguments nil
215 "*All command line arguments of exec-directory/movemail.")
217 ;;; Temporary variable:
224 (defvar gnus-offline-map (make-sparse-keymap))
226 ;;; To silence byte compiler
228 (fboundp 'eval-when-compile)
232 (eval-region (point-min) (point)))
233 (let (case-fold-search)
237 (unless (boundp symbol)
238 (make-local-variable symbol)
239 (eval (list 'setq symbol nil)))))
242 sendmail-to-spool-directory
243 news-spool-request-post-directory
251 gnus-agent-handle-level
253 (make-local-variable 'byte-compile-warnings)
254 (setq byte-compile-warnings nil))))
256 (put 'gnus-offline-set-unplugged-state 'menu-enable 'gnus-offline-connected)
257 (define-process-argument-editing "/hang\\.exe\\'"
258 (lambda (x) (general-process-argument-editing-function
264 (defun gnus-offline-setup ()
265 "*Initialize gnus-offline function"
267 ;; Load setting file - required.
268 (load gnus-offline-setting-file)
271 (gnus-offline-define-menu-and-key)
273 ;; To transfer Mail/News function.
274 (cond ((eq gnus-offline-mail-treat-environ 'offline)
275 ;; send mail under online environ.
276 (gnus-offline-set-offline-sendmail-function))
277 ((eq gnus-offline-mail-treat-environ 'online)
278 ;; send mail under offline environ.
279 (gnus-offline-set-online-sendmail-function))))
282 (defun gnus-offline-set-offline-sendmail-function ()
283 "*Initialize sendmail-function when unplugged status."
284 (if (eq gnus-offline-drafts-queue-type 'miee)
285 (setq message-send-mail-function 'sendmail-to-spool-in-gnspool-format)
286 (setq message-send-mail-function 'gnus-agent-send-mail)))
288 (defun gnus-offline-set-online-sendmail-function ()
289 "*Initialize sendmail-function when plugged status."
290 (if (eq gnus-offline-MTA-type 'smtp)
291 (setq message-send-mail-function 'message-send-mail-with-smtp)
292 (setq message-send-mail-function 'message-send-mail-with-sendmail)))
294 (defun gnus-offline-set-offline-post-news-function ()
295 "*Initialize sendnews-function when unplugged status."
296 (if (eq gnus-offline-drafts-queue-type 'miee)
297 (setq message-send-news-function 'gnspool-request-post)))
299 (defun gnus-offline-set-online-post-news-function ()
300 "*Initialize sendnews-function when plugged status."
301 (setq message-send-news-function 'message-send-news-with-gnus))
303 ;; Get new news jobs. (gnus-agent and nnspool)
305 (defun gnus-offline-gnus-get-new-news (&optional arg)
306 "*Override function \"gnus-grou-get-new-news\"."
308 (run-hooks 'gnus-offline-before-online-hook)
309 (if (functionp gnus-offline-dialup-function)
310 (funcall gnus-offline-dialup-function))
311 (gnus-offline-get-new-news-function)
312 (gnus-group-get-new-news arg))
317 (defun gnus-offline-connect-server ()
319 ;; Dialup if gnus-offline-dialup-program is specified
320 (if (stringp gnus-offline-dialup-program)
322 (message "Dialing ...")
323 (apply 'call-process gnus-offline-dialup-program nil nil nil
324 gnus-offline-dialup-program-arguments)
326 (message "Dialing ... done."))))
329 ;; Jobs before get new news , send mail and post news.
331 (defun gnus-offline-get-new-news-function ()
332 "*Prepare to get new news/mail."
333 ;; Set mail group level
334 (if (eq gnus-offline-articles-to-fetch 'mail)
335 (gnus-offline-set-mail-group-level gnus-offline-mail-group-level))
337 ;; Set to online environ.
338 (setq gnus-offline-connected t)
340 ;; Set send mail/news functions to online functions.
341 (gnus-offline-set-online-sendmail-function)
342 (gnus-offline-set-online-post-news-function)
343 (message "Set to online status.")
346 (if (eq gnus-offline-articles-to-fetch 'news)
347 (gnus-offline-disable-fetch-mail))
349 ;; fetch both mail and news. or Only mail.
350 (gnus-offline-enable-fetch-news)
351 (if (memq gnus-offline-articles-to-fetch '(both mail))
352 (gnus-offline-enable-fetch-mail))
354 ;; fetch only mail for gnus-agent
355 (if (and (eq gnus-offline-news-fetch-method 'nnagent)
356 (eq gnus-offline-articles-to-fetch 'mail))
357 (setq gnus-agent-handle-level gnus-offline-mail-group-level)))
360 ;; Change mail group level to handle only mail.
362 (defun gnus-offline-set-mail-group-level (level)
363 "*Set nnm* group level."
364 (switch-to-buffer gnus-group-buffer)
365 (goto-char (point-min))
367 ;; Save current level
368 (if (not gnus-offline-stored-group-level)
369 (while (re-search-forward " nnm" nil t)
370 (setq gnus-offline-stored-group-level
371 (append gnus-offline-stored-group-level
372 (list (gnus-group-group-level)))))
376 (goto-char (point-min))
377 (while (re-search-forward " nnm" nil t)
378 (gnus-group-set-current-level 1 level)
383 ;; Restore mail group level
385 (defun gnus-offline-restore-mail-group-level ()
386 "*Restore nnm* group level."
387 (switch-to-buffer gnus-group-buffer)
388 (goto-char (point-min))
390 (while (re-search-forward " nnm" nil t)
391 (gnus-group-set-current-level 1 (nth num gnus-offline-stored-group-level))
394 (beginning-of-line)))
396 ;; Jobs after getting new news.
398 (defun gnus-offline-after-get-new-news ()
399 "*After getting news and mail jobs."
400 (if (memq gnus-offline-articles-to-fetch '(both mail))
403 ;; send mail/news in spool
404 (gnus-offline-empting-spool)
405 (if (eq gnus-offline-articles-to-fetch 'mail)
407 ;; Send only mail and hang up...
408 (if (and gnus-offline-connected
409 gnus-offline-auto-hangup)
410 (gnus-offline-set-unplugged-state))
411 ;; Disable fetch mail.
412 (gnus-offline-disable-fetch-mail)
413 (gnus-offline-after-jobs-done)))))
416 (if (memq gnus-offline-articles-to-fetch '(both news))
418 (if gnus-offline-connected
419 (cond ((eq gnus-offline-news-fetch-method 'nnagent)
420 ;; Get New News (gnus-agent)
421 (gnus-agent-toggle-plugged t)
424 (gnus-agent-fetch-session)
426 ;; Hang Up line. then set to offline status.
427 (if (and gnus-offline-connected
428 gnus-offline-auto-hangup)
429 (gnus-offline-set-unplugged-state))
431 ;; All online jobs has done.
432 (gnus-offline-after-jobs-done))
434 (if (eq gnus-offline-news-fetch-method 'nnspool)
435 ;; Get New News (nnspool)
436 (gnspool-get-news))))))))
438 ;; Disable fetch mail
440 (defun gnus-offline-disable-fetch-mail ()
441 "*Set do not fetch mail."
442 (setq nnmail-spool-file nil))
446 (defun gnus-offline-enable-fetch-mail ()
447 "*Set to fetch mail."
448 (setq gnus-offline-mail-fetch-method 'nnmail)
449 (setq nnmail-movemail-program 'pop3-fma-movemail)
450 (setq nnmail-spool-file (append
451 pop3-fma-local-spool-file-alist
455 pop3-fma-spool-file-alist))))
459 (defun gnus-offline-enable-fetch-news ()
460 "*Set to fetch news."
461 (if (eq gnus-offline-news-fetch-method 'nnagent)
463 (setq gnus-agent-handle-level gnus-level-subscribed)
464 (gnus-agent-toggle-plugged t))))
467 ;; Add your custom header.
469 (defun gnus-offline-add-custom-header (header string)
470 "*Add X-Gnus-Offline-Backend header to Mail/News message."
472 (progn (goto-char (point-min))
474 (concat "^" (regexp-quote mail-header-separator) "\n"))
476 (goto-char (point-min))
477 (or (re-search-forward (concat "^" header) delimline t)
479 (goto-char delimline)
482 (setq hdr (concat header " "))
483 (setq str (concat hdr string))
484 (setq hdr (concat str "\n"))
485 (insert-string hdr)))))
487 ;; Add X-Offline-Backend header.
489 (defun gnus-offline-message-add-header ()
490 "*Add X-Gnus-Offline-Backend header to Mail/News message."
491 (if (eq gnus-offline-mail-treat-environ 'offline)
493 (if (eq gnus-offline-news-fetch-method 'nnagent)
494 (setq ver nnagent-version)
495 (setq ver nnspool-version))
496 (setq str (format "\n with %s" ver)
497 string (concat gnus-offline-header-string str))
498 (gnus-offline-add-custom-header "X-Gnus-Offline-Backend:" string))))
502 ;; Toggle plugged/unplugged
504 (defun gnus-offline-toggle-plugged (plugged)
505 "*Override function \"Jj\" - gnus-agent-toggle-plugged."
506 (interactive (list (not gnus-offline-connected)))
509 (setq gnus-offline-connected plugged)
510 (gnus-agent-toggle-plugged plugged)
511 ;; Set send mail/news function to offline functions.
512 (gnus-offline-set-online-sendmail-function)
513 (gnus-offline-set-online-post-news-function))
514 ;; Set to offline status
515 (gnus-offline-set-unplugged-state)))
517 ;; Function of hang up line.
519 (defun gnus-offline-set-unplugged-state ()
520 "*Set to unplugged state."
523 (if (functionp gnus-offline-hangup-function)
524 (funcall gnus-offline-hangup-function))
525 (setq gnus-offline-connected nil)
526 (if (eq gnus-offline-news-fetch-method 'nnagent)
527 (gnus-agent-toggle-plugged nil))
529 ;; Set send mail/news function to offline functions.
530 (gnus-offline-set-offline-sendmail-function)
531 (gnus-offline-set-offline-post-news-function)
533 (setenv "MAILHOST" nil))
535 ;; Hangup line function
537 (defun gnus-offline-hangup-line ()
538 "*Hangup line function."
539 (message "Hang up line ... ")
540 (if (stringp gnus-offline-hangup-program)
541 (apply 'start-process "hup" nil gnus-offline-hangup-program
542 gnus-offline-hangup-program-arguments))
543 (message "Hang up line ... done."))
545 ;; Hang Up line routine whe using nnspool
547 (defun gnus-offline-nnspool-hangup-line ()
548 (if (and gnus-offline-connected
549 gnus-offline-auto-hangup)
550 (gnus-offline-set-unplugged-state))
551 (gnus-offline-after-jobs-done))
553 ;; Function of all jobs has done.
555 (defun gnus-offline-after-jobs-done ()
556 "*Jobs after all online jobs."
557 (run-hooks 'gnus-offline-after-online-hook)
558 (if (eq gnus-offline-articles-to-fetch 'mail)
559 (gnus-offline-restore-mail-group-level))
560 (if (eq gnus-offline-news-fetch-method 'nnagent)
561 (gnus-offline-agent-expire))
563 (message "All online jobs have done."))
567 ;; Toggle auto hang up
569 (defun gnus-offline-toggle-auto-hangup ()
570 "*Toggle auto hangup flag."
572 (setq string "Auto hang up logic")
573 (if gnus-offline-auto-hangup
575 (setq gnus-offline-auto-hangup nil
577 (setq gnus-offline-auto-hangup t
579 (message (format "%s %s" string str)))
581 ;; Toggle offline/online to send mail.
583 (defun gnus-offline-toggle-on/off-send-mail ()
584 "*Toggel online/offline sendmail."
586 (if (eq gnus-offline-mail-treat-environ 'offline)
588 ;; Sending mail under online environ.
589 (gnus-offline-set-online-sendmail-function)
590 (setq gnus-offline-mail-treat-environ 'online)
591 (message "Sending mail immidiately."))
592 ;; Sending mail under offline environ.
593 (gnus-offline-set-offline-sendmail-function)
594 (setq gnus-offline-mail-treat-environ 'offline)
595 (message "Sending mail temporary to spool directory.")))
597 ;; Toggle articles to fetch ... both -> mail -> news -> both
599 (defun gnus-offline-toggle-articles-to-fetch ()
600 "*Set articles to fetch... both(Mail/News) -> mail only -> News only -> both"
602 (setq string "Articles fetch from server.")
603 (cond ((eq gnus-offline-articles-to-fetch 'both)
604 (setq gnus-offline-articles-to-fetch 'mail
606 ((eq gnus-offline-articles-to-fetch 'mail)
607 (setq gnus-offline-articles-to-fetch 'news
610 (setq gnus-offline-articles-to-fetch 'both
611 str "Mail/News both")))
612 (message (format "%s %s" string str)))
614 ;; Toggle movemail program pop3.el -> movemail -> pop3.el
616 (defun gnus-offline-toggle-movemail-program ()
617 "*Toggle movemail program movemail -> pop3.el -> movemail ->..."
619 (setq string "Set nnmail-movemail-program")
620 (cond ((eq pop3-fma-movemail-type 'lisp)
621 (setq pop3-fma-movemail-type 'exe
624 (setq pop3-fma-movemail-type 'lisp
626 (message (format "%s %s" string str)))
628 ;; Send mail and Post news using Miee or gnus-agent.
630 (defun gnus-offline-empting-spool ()
631 "*Send all drafts on queue."
632 (run-hooks 'gnus-offline-before-empting-spool-hook)
633 (if (eq gnus-offline-drafts-queue-type 'miee)
634 ;; Send queued message by miee.el.
636 (if (eq gnus-offline-mail-treat-environ 'offline)
638 (message "Sending mails in spool ...")
639 ;; Using miee to send mail.
641 (message "Sending mails in spool ... done.")))
642 (message "Posting news in spool ...")
643 ;; Using miee to post news.
644 (if (and (not (stringp msspool-news-server))
645 (not msspool-news-service))
647 (setq msspool-news-server (nth 1 gnus-select-method))
648 (setq msspool-news-service 119)))
650 (message "Posting news in spool ... done."))
651 ;; Send queued message by gnus-agent
652 (message "Sending messages in spool ...")
653 (gnus-group-send-drafts)
654 (message "Sending messages in spool ... done."))
656 (run-hooks 'gnus-offline-after-empting-spool-hook))
660 (defun gnus-offline-set-interval-time ()
661 "*Set interval time for gnus-daemon."
663 (setq gnus-offline-interval-time
664 (string-to-int (read-from-minibuffer
665 (format "Interval time (now %s minutes) : "
666 gnus-offline-interval-time)
668 (if (< gnus-offline-interval-time 2)
670 (message "Retrieving message logic by timer is disabled.")
671 (setq gnus-offline-interval-time 0))
672 (message (format "Interval time set to %d minutes" gnus-offline-interval-time)))
673 (gnus-offline-processed-by-timer))
675 ;; Expire articles using gnus-agent.
677 (defun gnus-offline-agent-expire ()
678 "*Expire expirable article on News group."
684 (defun gnus-offline-define-menu-and-key ()
686 (if (eq gnus-offline-drafts-queue-type 'miee)
687 (add-hook 'gnus-group-mode-hook 'gnus-offline-define-menu-on-miee)
688 (add-hook 'gnus-group-mode-hook 'gnus-offline-define-menu-on-agent))
689 (add-hook 'gnus-group-mode-hook
691 (local-set-key "\C-coh" 'gnus-offline-set-unplugged-state)
692 (local-set-key "\C-com" 'gnus-offline-toggle-movemail-program)
693 (local-set-key "\C-cof" 'gnus-offline-toggle-articles-to-fetch)
694 (local-set-key "\C-coo" 'gnus-offline-toggle-on/off-send-mail)
695 (local-set-key "\C-cox" 'gnus-offline-toggle-auto-hangup)
696 (local-set-key "\C-cos" 'gnus-offline-set-interval-time)
697 (substitute-key-definition
698 'gnus-group-get-new-news 'gnus-offline-gnus-get-new-news
700 (if (eq gnus-offline-news-fetch-method 'nnagent)
702 (substitute-key-definition
703 'gnus-agent-toggle-plugged 'gnus-offline-toggle-plugged
704 gnus-agent-group-mode-map)
705 (local-set-key "\C-coe" 'gnus-offline-agent-expire)))))
706 (if (eq gnus-offline-news-fetch-method 'nnagent)
707 (add-hook 'gnus-summary-mode-hook
709 (substitute-key-definition
710 'gnus-agent-toggle-plugged 'gnus-offline-toggle-plugged
711 gnus-agent-summary-mode-map)))))
713 (defun gnus-offline-define-menu-on-miee ()
714 "*Set menu bar on MIEE menu."
718 gnus-offline-hup-separator]
725 (cons "Gnus Offline Utility"
726 (make-sparse-keymap "Gnus Offline Utiliry")))
732 gnus-offline-toggle-movemail-program]
733 '("Toggle movemail program" .
734 gnus-offline-toggle-movemail-program))
740 gnus-offline-toggle-articles-to-fetch]
741 '("Toggle articles to fetch" .
742 gnus-offline-toggle-articles-to-fetch))
748 gnus-offline-toggle-on/off-send-mail]
749 '("Toggle online/offline send mail" .
750 gnus-offline-toggle-on/off-send-mail))
756 gnus-offline-toggle-auto-hangup]
757 '("Toggle auto hang up" . gnus-offline-toggle-auto-hangup))
763 gnus-offline-expire-separator]
766 (if (eq gnus-offline-news-fetch-method 'nnagent)
771 gnus-offline-agent-expire]
772 '("Expire articles" . gnus-offline-agent-expire)))
778 gnus-offline-set-interval-time]
779 '("Set interval time." . gnus-offline-set-interval-time))
785 gnus-offline-hup-separator]
792 gnus-offline-set-unplugged-state]
793 '("Hang Up Line." . gnus-offline-set-unplugged-state)))
795 ;; define menu without miee.
797 (defun gnus-offline-define-menu-on-agent ()
798 "*Set menu bar on OFFLINE menu."
800 (lookup-key global-map [menu-bar])
802 (cons "Offline" (make-sparse-keymap "Offline"))
803 'help) ;; Actually this adds before "Help".
808 gnus-offline-toggle-movemail-program]
809 '("Toggle movemail program" . gnus-offline-toggle-movemail-program))
814 gnus-offline-toggle-articles-to-fetch]
815 '("Toggle articles to fetch" . gnus-offline-toggle-articles-to-fetch))
820 gnus-offline-toggle-on/off-send-mail]
821 '("Toggle online/offline send mail" . gnus-offline-toggle-on/off-send-mail))
826 gnus-offline-toggle-auto-hangup]
827 '("Toggle auto hang up" . gnus-offline-toggle-auto-hangup))
832 gnus-offline-separator]
835 (if (eq gnus-offline-news-fetch-method 'nnagent)
840 gnus-offline-agent-expire]
841 '("Expire articles" . gnus-offline-agent-expire))))
846 gnus-offline-set-interval-time]
847 '("Set interval time." . gnus-offline-set-interval-time))
852 gnus-offline-hup-separator]
858 gnus-offline-set-unplugged-state]
859 '("Hang Up Line." . gnus-offline-set-unplugged-state)))
863 (defun gnus-offline-processed-by-timer ()
864 "*Set timer interval."
865 (if (and (> gnus-offline-interval-time 0)
866 (not gnus-offline-connected))
868 (gnus-demon-add-handler 'gnus-offline-gnus-get-new-news
869 gnus-offline-interval-time
870 gnus-offline-interval-time))
871 (if (= gnus-offline-interval-time 0)
872 (gnus-demon-remove-handler 'gnus-offline-gnus-get-new-news t)))
875 (provide 'gnus-offline)
876 ;;; gnus-offline.el ends here