1 ;;; gnus-offline.el --- To process mail & news at offline environment.
2 ;;; $Id: gnus-offline.el,v 1.1.2.5.2.12 1998-12-08 22:51:13 yamaoka 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 ;;; If you use gnus-agent as souper , put gnus-agent setup code in you .gnus.el
53 ;;; If you use nnspool as souper , put following code in your .emacs before
54 ;;; gnus-offline setting.
56 ;;; Then , put hang.exe in exec-path directory.
58 ;;; In Gnus group buffer , type g to get all news and mail.
59 ;;; Then send mail and news in spool directory.
62 ;;; gnus-offline-dialup-program-arguments
63 ;;; ... List of dialup program arguments.
64 ;;; gnus-offline-hangup-program-arguments
65 ;;; ... List of hangup program arguments.
66 ;;; gnus-offline-mail-treat-environ ... toggle sending mail online/offline.
67 ;;; gnus-offline-articles-to-fetch ... toggle fetch articles.
68 ;;; both->mail->news->both...
69 ;;; gnus-offline-load-hook ... hook before gnus-offline load.
70 ;;; gnus-offline-before-online-hook ... hook before all online jobs.
71 ;;; gnus-offline-after-online-hook ... hook after all online jobs.
72 ;;; gnus-offline-interval-time ... Interval time to do all online jobs.
74 ;;; gnus-offline-dialup-function ... Function to diualup.
75 ;;; gnus-offline-hangup-function ... Function to hangup.
79 (eval '(run-hooks 'gnus-offline-load-hook))
85 (unless (and (condition-case ()
91 (defmacro defgroup (&rest args))
92 (defmacro defcustom (symbol value &optional doc &rest args)
93 (` (defvar (, symbol) (, value) (, doc))))
95 (defgroup gnus-offline nil
96 "Offline backend utility for Gnus."
97 :prefix "gnus-offline-"
101 (defconst gnus-offline-version-number "2.00")
102 (defconst gnus-offline-codename
104 "This is the time" ; 2.00
105 ;; "A matter of trust"
110 (defconst gnus-offline-version (format "Gnus offline backend utiliy v%s"
111 gnus-offline-version-number))
113 (defcustom gnus-offline-dialup-program-arguments nil
114 "*Program arguments of gnus-offline-dialup-program."
116 :type '(repeat (string :tag "Argument")))
118 (defcustom gnus-offline-hangup-program-arguments nil
119 "*Program arguments of gnus-offline-hangup-program."
121 :type '(repeat (string :tag "Argument")))
123 (defcustom gnus-offline-auto-hangup t
124 "*Whether dialup-network automatically hang up when all online jobs has done."
128 (defcustom gnus-offline-load-hook nil
129 "*Hook to be run after the gnus-offline package has been loaded."
133 (defcustom gnus-offline-before-online-hook nil
134 "*Hook to be run before all online jobs."
138 (defcustom gnus-offline-after-online-hook nil
139 "*Hook to be run after all online jobs."
143 (defcustom gnus-offline-mail-treat-environ 'offline
144 "*If online , gnus-offline send all mail under online environ.
145 If offline , gnus-offline send all mail temporary to spool dir."
147 :type '(choice (const offline)
150 (defcustom gnus-offline-articles-to-fetch 'both
151 "*If both , gnus-offline fetch mail and news articles.
152 If mail , gnus-offline only fetch mail articles.
153 If news , gnus-offline only fetch news articles."
155 :type '(choice (const both)
159 (defcustom gnus-offline-interval-time 0
160 "*Interval time(minutes) to do online jobs.
161 If set to 0 , timer call is disabled."
165 (defcustom gnus-offline-mail-group-level 1
166 "*Group level for mail group."
170 (defcustom gnus-offline-after-empting-spool-hook nil
171 "*Hook to be run before empting spool."
175 (defcustom gnus-offline-before-empting-spool-hook nil
176 "*Hook to be run after empting spool."
180 (defcustom gnus-offline-dialup-function 'gnus-offline-connect-server
181 "*Function to dialup."
185 (defcustom gnus-offline-hangup-function 'gnus-offline-hangup-line
186 "*Function to hangup."
190 ;;; Internal variables.
191 (defvar gnus-offline-connected nil
192 "*If value is t , dialup line is connected status.
193 If value is nil , dialup line is disconnected status.")
195 (defvar gnus-offline-news-fetch-method nil
196 "*Method to fetch news articles.")
198 (defvar gnus-offline-mail-fetch-method nil
199 "*Method to fetch mail articles.")
201 (defvar gnus-offline-header-string
202 (format "%s - \"%s\""
204 gnus-offline-codename)
205 "*Header string for gnus-offline.")
207 (defvar gnus-offline-stored-group-level nil
208 "*Mail Group level before changing.")
210 (defvar gnus-offline-movemail-arguments nil
211 "*All command line arguments of exec-directory/movemail.")
213 ;;; Temporary variable:
220 (defvar gnus-offline-error-buffer " *Error*")
221 (defvar gnus-offline-map (make-sparse-keymap))
223 ;;; To silence byte compiler
225 (fboundp 'eval-when-compile)
229 (eval-region (point-min) (point)))
230 (let (case-fold-search)
234 (unless (boundp symbol)
235 (make-local-variable symbol)
236 (eval (list 'setq symbol nil)))))
239 sendmail-to-spool-directory
240 news-spool-request-post-directory
248 gnus-agent-handle-level
250 (make-local-variable 'byte-compile-warnings)
251 (setq byte-compile-warnings nil))))
253 (put 'gnus-offline-set-unplugged-state 'menu-enable 'gnus-offline-connected)
254 (if (eq system-type 'windows-nt)
255 (define-process-argument-editing "/hang\\.exe\\'"
256 (lambda (x) (general-process-argument-editing-function
257 x nil t t nil t t))))
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 offline 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 ;; Setting Error check.
281 (defun gnus-offline-error-check ()
282 ;; Check gnus-agent and nnspool setting.
283 (cond ((eq gnus-offline-news-fetch-method 'nnagent)
284 ;; nnagent and gnus-agent loaded ??
285 (if (not (and (featurep 'gnus-agent)
286 (featurep 'nnagent)))
288 (get-buffer-create gnus-offline-error-buffer)
289 (set-buffer gnus-offline-error-buffer)
291 (insert "WARNING!!: gnus-agent.el or nnagent.el is not loaded.\n")
292 (insert "Please check your .emacs or .gnus.el to work gnus-agent fine.")
293 (pop-to-buffer gnus-offline-error-buffer))))
295 ((eq gnus-offline-news-fetch-method 'nnspool)
296 (if (not (featurep 'nnspool))
298 (get-buffer-create gnus-offline-error-buffer)
299 (set-buffer gnus-offline-error-buffer)
301 (insert "WARNING!!: nnspool.el is not loaded.\n")
302 (insert "Please check your .emacs or .gnus.el to work nnspool fine.")
303 (pop-to-buffer gnus-offline-error-buffer))))))
306 (defun gnus-offline-set-offline-sendmail-function ()
307 "*Initialize sendmail-function when unplugged status."
308 (if (eq gnus-offline-drafts-queue-type 'miee)
309 (setq message-send-mail-function 'sendmail-to-spool-in-gnspool-format)
310 (setq message-send-mail-function 'gnus-agent-send-mail)))
312 (defun gnus-offline-set-online-sendmail-function ()
313 "*Initialize sendmail-function when plugged status."
314 (if (eq gnus-offline-MTA-type 'smtp)
315 (setq message-send-mail-function 'message-send-mail-with-smtp)
316 (setq message-send-mail-function 'message-send-mail-with-sendmail)))
318 (defun gnus-offline-set-offline-post-news-function ()
319 "*Initialize sendnews-function when unplugged status."
320 (if (eq gnus-offline-drafts-queue-type 'miee)
321 (setq message-send-news-function 'gnspool-request-post)))
323 (defun gnus-offline-set-online-post-news-function ()
324 "*Initialize sendnews-function when plugged status."
325 (setq message-send-news-function 'message-send-news-with-gnus))
327 ;; Get new news jobs. (gnus-agent and nnspool)
329 (defun gnus-offline-gnus-get-new-news (&optional arg)
330 "*Override function \"gnus-group-get-new-news\"."
332 (run-hooks 'gnus-offline-before-online-hook)
333 (if (functionp gnus-offline-dialup-function)
334 (funcall gnus-offline-dialup-function))
335 (gnus-offline-get-new-news-function)
336 (gnus-group-get-new-news arg))
341 (defun gnus-offline-connect-server ()
343 ;; Dialup if gnus-offline-dialup-program is specified
344 (if (stringp gnus-offline-dialup-program)
346 (message "Dialing ...")
347 (apply 'call-process gnus-offline-dialup-program nil nil nil
348 gnus-offline-dialup-program-arguments)
350 (message "Dialing ... done."))))
353 ;; Jobs before get new news , send mail and post news.
355 (defun gnus-offline-get-new-news-function ()
356 "*Prepare to get new news/mail."
357 ;; Set mail group level
358 (if (eq gnus-offline-articles-to-fetch 'mail)
359 (gnus-offline-set-mail-group-level gnus-offline-mail-group-level))
361 ;; Set to online environ.
362 (setq gnus-offline-connected t)
364 ;; Set send mail/news functions to online functions.
365 (gnus-offline-set-online-sendmail-function)
366 (gnus-offline-set-online-post-news-function)
367 (message "Set to online status.")
370 (if (eq gnus-offline-articles-to-fetch 'news)
371 (gnus-offline-disable-fetch-mail))
373 ;; fetch both mail and news. or Only mail.
374 (gnus-offline-enable-fetch-news)
375 (if (memq gnus-offline-articles-to-fetch '(both mail))
376 (gnus-offline-enable-fetch-mail))
378 ;; fetch only mail for gnus-agent
379 (if (and (eq gnus-offline-news-fetch-method 'nnagent)
380 (eq gnus-offline-articles-to-fetch 'mail))
381 (setq gnus-agent-handle-level gnus-offline-mail-group-level)))
384 ;; Change mail group level to handle only mail.
386 (defun gnus-offline-set-mail-group-level (level)
387 "*Set nnm* group level."
388 (switch-to-buffer gnus-group-buffer)
389 (goto-char (point-min))
391 ;; Save current level
392 (if (not gnus-offline-stored-group-level)
393 (while (re-search-forward " nnm" nil t)
394 (setq gnus-offline-stored-group-level
395 (append gnus-offline-stored-group-level
396 (list (gnus-group-group-level)))))
400 (goto-char (point-min))
401 (while (re-search-forward " nnm" nil t)
402 (gnus-group-set-current-level 1 level)
407 ;; Restore mail group level
409 (defun gnus-offline-restore-mail-group-level ()
410 "*Restore nnm* group level."
411 (switch-to-buffer gnus-group-buffer)
412 (goto-char (point-min))
414 (while (re-search-forward " nnm" nil t)
415 (gnus-group-set-current-level 1 (nth num gnus-offline-stored-group-level))
418 (beginning-of-line)))
420 ;; Jobs after getting new news.
422 (defun gnus-offline-after-get-new-news ()
423 "*After getting news and mail jobs."
424 (if (memq gnus-offline-articles-to-fetch '(both mail))
427 ;; send mail/news in spool
428 (gnus-offline-empting-spool)
429 (if (eq gnus-offline-articles-to-fetch 'mail)
431 ;; Send only mail and hang up...
432 (if (and gnus-offline-connected
433 gnus-offline-auto-hangup)
434 (gnus-offline-set-unplugged-state))
435 ;; Disable fetch mail.
436 (gnus-offline-disable-fetch-mail)
437 (gnus-offline-after-jobs-done)))))
440 (if (memq gnus-offline-articles-to-fetch '(both news))
442 (if gnus-offline-connected
443 (cond ((eq gnus-offline-news-fetch-method 'nnagent)
444 ;; Get New News (gnus-agent)
445 (gnus-agent-toggle-plugged t)
448 (gnus-agent-fetch-session)
450 ;; Hang Up line. then set to offline status.
451 (if (and gnus-offline-connected
452 gnus-offline-auto-hangup)
453 (gnus-offline-set-unplugged-state))
455 ;; All online jobs has done.
456 (gnus-offline-after-jobs-done))
458 (if (eq gnus-offline-news-fetch-method 'nnspool)
459 ;; Get New News (nnspool)
460 (gnspool-get-news))))))))
462 ;; Disable fetch mail
464 (defun gnus-offline-disable-fetch-mail ()
465 "*Set do not fetch mail."
466 (setq nnmail-spool-file nil))
470 (defun gnus-offline-enable-fetch-mail ()
471 "*Set to fetch mail."
472 (setq gnus-offline-mail-fetch-method 'nnmail)
473 (setq nnmail-movemail-program 'pop3-fma-movemail)
474 (setq nnmail-spool-file (append
475 pop3-fma-local-spool-file-alist
479 pop3-fma-spool-file-alist))))
483 (defun gnus-offline-enable-fetch-news ()
484 "*Set to fetch news."
485 (if (eq gnus-offline-news-fetch-method 'nnagent)
487 (setq gnus-agent-handle-level gnus-level-subscribed)
488 (gnus-agent-toggle-plugged t))))
491 ;; Add your custom header.
493 (defun gnus-offline-add-custom-header (header string)
494 "*Add X-Gnus-Offline-Backend header to Mail/News message."
496 (progn (goto-char (point-min))
498 (concat "^" (regexp-quote mail-header-separator) "\n"))
500 (goto-char (point-min))
501 (or (re-search-forward (concat "^" header) delimline t)
503 (goto-char delimline)
506 (setq hdr (concat header " "))
507 (setq str (concat hdr string))
508 (setq hdr (concat str "\n"))
509 (insert-string hdr)))))
511 ;; Add X-Offline-Backend header.
513 (defun gnus-offline-message-add-header ()
514 "*Add X-Gnus-Offline-Backend header to Mail/News message."
515 (if (eq gnus-offline-mail-treat-environ 'offline)
517 (if (eq gnus-offline-news-fetch-method 'nnagent)
518 (setq ver nnagent-version)
519 (setq ver nnspool-version))
520 (setq str (format "\n with %s" ver)
521 string (concat gnus-offline-header-string str))
522 (gnus-offline-add-custom-header "X-Gnus-Offline-Backend:" string))))
526 ;; Toggle plugged/unplugged
528 (defun gnus-offline-toggle-plugged (plugged)
529 "*Override function \"Jj\" - gnus-agent-toggle-plugged."
530 (interactive (list (not gnus-offline-connected)))
533 (setq gnus-offline-connected plugged)
534 (gnus-agent-toggle-plugged plugged)
535 ;; Set send mail/news function to offline functions.
536 (gnus-offline-set-online-sendmail-function)
537 (gnus-offline-set-online-post-news-function))
538 ;; Set to offline status
539 (gnus-offline-set-unplugged-state)))
541 ;; Function of hang up line.
543 (defun gnus-offline-set-unplugged-state ()
544 "*Set to unplugged state."
547 (if (functionp gnus-offline-hangup-function)
548 (funcall gnus-offline-hangup-function))
549 (setq gnus-offline-connected nil)
550 (if (eq gnus-offline-news-fetch-method 'nnagent)
551 (gnus-agent-toggle-plugged nil))
553 ;; Set send mail/news function to offline functions.
554 (gnus-offline-set-offline-sendmail-function)
555 (gnus-offline-set-offline-post-news-function)
557 (setenv "MAILHOST" nil))
559 ;; Hangup line function
561 (defun gnus-offline-hangup-line ()
562 "*Hangup line function."
563 (message "Hang up line ... ")
564 (if (stringp gnus-offline-hangup-program)
565 (apply 'start-process "hup" nil gnus-offline-hangup-program
566 gnus-offline-hangup-program-arguments))
567 (message "Hang up line ... done."))
569 ;; Hang Up line routine whe using nnspool
571 (defun gnus-offline-nnspool-hangup-line ()
572 (if (and gnus-offline-connected
573 gnus-offline-auto-hangup)
574 (gnus-offline-set-unplugged-state))
575 (gnus-offline-after-jobs-done))
577 ;; Function of all jobs has done.
579 (defun gnus-offline-after-jobs-done ()
580 "*Jobs after all online jobs."
581 (run-hooks 'gnus-offline-after-online-hook)
582 (if (eq gnus-offline-articles-to-fetch 'mail)
583 (gnus-offline-restore-mail-group-level))
584 (if (eq gnus-offline-news-fetch-method 'nnagent)
585 (or (featurep 'xemacs)
586 (gnus-offline-agent-expire)))
587 (if (and (featurep 'xemacs)
588 (fboundp 'play-sound-file))
591 (gnus-group-save-newsrc)
592 (message "All online jobs has done."))
596 ;; Toggle auto hang up
598 (defun gnus-offline-toggle-auto-hangup ()
599 "*Toggle auto hangup flag."
601 (setq string "Auto hang up logic")
602 (if gnus-offline-auto-hangup
604 (setq gnus-offline-auto-hangup nil
606 (setq gnus-offline-auto-hangup t
608 (message (format "%s %s" string str)))
610 ;; Toggle offline/online to send mail.
612 (defun gnus-offline-toggle-on/off-send-mail ()
613 "*Toggel online/offline sendmail."
615 (if (eq gnus-offline-mail-treat-environ 'offline)
617 ;; Sending mail under online environ.
618 (gnus-offline-set-online-sendmail-function)
619 (setq gnus-offline-mail-treat-environ 'online)
620 (message "Sending mail immidiately."))
621 ;; Sending mail under offline environ.
622 (gnus-offline-set-offline-sendmail-function)
623 (setq gnus-offline-mail-treat-environ 'offline)
624 (message "Sending mail temporary to spool directory.")))
626 ;; Toggle articles to fetch ... both -> mail -> news -> both
628 (defun gnus-offline-toggle-articles-to-fetch ()
629 "*Set articles to fetch... both(Mail/News) -> mail only -> News only -> both"
631 (setq string "Articles fetch from server.")
632 (cond ((eq gnus-offline-articles-to-fetch 'both)
633 (setq gnus-offline-articles-to-fetch 'mail
635 ((eq gnus-offline-articles-to-fetch 'mail)
636 (setq gnus-offline-articles-to-fetch 'news
639 (setq gnus-offline-articles-to-fetch 'both
640 str "Mail/News both")))
641 (message (format "%s %s" string str)))
643 ;; Toggle movemail program pop3.el -> movemail -> pop3.el
645 (defun gnus-offline-toggle-movemail-program ()
646 "*Toggle movemail program movemail -> pop3.el -> movemail ->..."
648 (setq string "Set nnmail-movemail-program")
649 (cond ((eq pop3-fma-movemail-type 'lisp)
650 (setq pop3-fma-movemail-type 'exe
653 (setq pop3-fma-movemail-type 'lisp
655 (message (format "%s %s" string str)))
657 ;; Send mail and Post news using Miee or gnus-agent.
659 (defun gnus-offline-empting-spool ()
660 "*Send all drafts on queue."
661 (run-hooks 'gnus-offline-before-empting-spool-hook)
662 (if (eq gnus-offline-drafts-queue-type 'miee)
663 ;; Send queued message by miee.el.
665 (if (eq gnus-offline-mail-treat-environ 'offline)
667 (message "Sending mails in spool ...")
668 ;; Using miee to send mail.
670 (message "Sending mails in spool ... done.")))
671 (message "Posting news in spool ...")
672 ;; Using miee to post news.
673 (if (and (not (stringp msspool-news-server))
674 (not msspool-news-service))
676 (setq msspool-news-server (nth 1 gnus-select-method))
677 (setq msspool-news-service 119)))
679 (message "Posting news in spool ... done."))
680 ;; Send queued message by gnus-agent
681 (message "Sending messages in spool ...")
682 (gnus-group-send-drafts)
683 (message "Sending messages in spool ... done."))
685 (run-hooks 'gnus-offline-after-empting-spool-hook))
689 (defun gnus-offline-set-interval-time ()
690 "*Set interval time for gnus-daemon."
692 (setq gnus-offline-interval-time
693 (string-to-int (read-from-minibuffer
694 (format "Interval time (now %s minutes) : "
695 gnus-offline-interval-time)
697 (if (< gnus-offline-interval-time 2)
699 (message "Retrieving message logic by timer is disabled.")
700 (setq gnus-offline-interval-time 0))
701 (message (format "Interval time set to %d minutes" gnus-offline-interval-time)))
702 (gnus-offline-processed-by-timer))
704 ;; Expire articles using gnus-agent.
706 (defun gnus-offline-agent-expire ()
707 "*Expire expirable article on News group."
713 (defun gnus-offline-define-menu-and-key ()
715 (if (eq gnus-offline-drafts-queue-type 'miee)
716 (add-hook 'gnus-group-mode-hook 'gnus-offline-define-menu-on-miee)
717 (add-hook 'gnus-group-mode-hook 'gnus-offline-define-menu-on-agent))
718 (add-hook 'gnus-group-mode-hook
720 (local-set-key "\C-coh" 'gnus-offline-set-unplugged-state)
721 (local-set-key "\C-com" 'gnus-offline-toggle-movemail-program)
722 (local-set-key "\C-cof" 'gnus-offline-toggle-articles-to-fetch)
723 (local-set-key "\C-coo" 'gnus-offline-toggle-on/off-send-mail)
724 (local-set-key "\C-cox" 'gnus-offline-toggle-auto-hangup)
725 (local-set-key "\C-cos" 'gnus-offline-set-interval-time)
726 (substitute-key-definition
727 'gnus-group-get-new-news 'gnus-offline-gnus-get-new-news
729 (if (eq gnus-offline-news-fetch-method 'nnagent)
731 (substitute-key-definition
732 'gnus-agent-toggle-plugged 'gnus-offline-toggle-plugged
733 gnus-agent-group-mode-map)
734 (local-set-key "\C-coe" 'gnus-offline-agent-expire)))))
735 (if (eq gnus-offline-news-fetch-method 'nnagent)
736 (add-hook 'gnus-summary-mode-hook
738 (substitute-key-definition
739 'gnus-agent-toggle-plugged 'gnus-offline-toggle-plugged
740 gnus-agent-summary-mode-map)))))
742 (defun gnus-offline-define-menu-on-miee ()
743 "*Set menu bar on MIEE menu."
747 gnus-offline-hup-separator]
754 (cons "Gnus Offline Utility"
755 (make-sparse-keymap "Gnus Offline Utiliry")))
761 gnus-offline-toggle-movemail-program]
762 '("Toggle movemail program" .
763 gnus-offline-toggle-movemail-program))
769 gnus-offline-toggle-articles-to-fetch]
770 '("Toggle articles to fetch" .
771 gnus-offline-toggle-articles-to-fetch))
777 gnus-offline-toggle-on/off-send-mail]
778 '("Toggle online/offline send mail" .
779 gnus-offline-toggle-on/off-send-mail))
785 gnus-offline-toggle-auto-hangup]
786 '("Toggle auto hang up" . gnus-offline-toggle-auto-hangup))
792 gnus-offline-expire-separator]
795 (if (eq gnus-offline-news-fetch-method 'nnagent)
800 gnus-offline-agent-expire]
801 '("Expire articles" . gnus-offline-agent-expire)))
807 gnus-offline-set-interval-time]
808 '("Set interval time." . gnus-offline-set-interval-time))
814 gnus-offline-hup-separator]
821 gnus-offline-set-unplugged-state]
822 '("Hang Up Line." . gnus-offline-set-unplugged-state)))
824 ;; define menu without miee.
826 (defun gnus-offline-define-menu-on-agent ()
827 "*Set menu bar on OFFLINE menu."
829 (lookup-key global-map [menu-bar])
831 (cons "Offline" (make-sparse-keymap "Offline"))
832 'help) ;; Actually this adds before "Help".
837 gnus-offline-toggle-movemail-program]
838 '("Toggle movemail program" . gnus-offline-toggle-movemail-program))
843 gnus-offline-toggle-articles-to-fetch]
844 '("Toggle articles to fetch" . gnus-offline-toggle-articles-to-fetch))
849 gnus-offline-toggle-on/off-send-mail]
850 '("Toggle online/offline send mail" . gnus-offline-toggle-on/off-send-mail))
855 gnus-offline-toggle-auto-hangup]
856 '("Toggle auto hang up" . gnus-offline-toggle-auto-hangup))
861 gnus-offline-separator]
864 (if (eq gnus-offline-news-fetch-method 'nnagent)
869 gnus-offline-agent-expire]
870 '("Expire articles" . gnus-offline-agent-expire))))
875 gnus-offline-set-interval-time]
876 '("Set interval time." . gnus-offline-set-interval-time))
881 gnus-offline-hup-separator]
887 gnus-offline-set-unplugged-state]
888 '("Hang Up Line." . gnus-offline-set-unplugged-state)))
892 (defun gnus-offline-processed-by-timer ()
893 "*Set timer interval."
894 (if (and (> gnus-offline-interval-time 0)
895 (not gnus-offline-connected))
897 (gnus-demon-add-handler 'gnus-offline-gnus-get-new-news
898 gnus-offline-interval-time
899 gnus-offline-interval-time))
900 (if (= gnus-offline-interval-time 0)
901 (gnus-demon-remove-handler 'gnus-offline-gnus-get-new-news t)))
904 (provide 'gnus-offline)
905 ;;; gnus-offline.el ends here