lisp/gnus-offline.el,lisp/gnus-ofsetup.el: Bug fix .. Beta4 release.
authorichikawa <ichikawa>
Thu, 12 Nov 1998 14:04:09 +0000 (14:04 +0000)
committerichikawa <ichikawa>
Thu, 12 Nov 1998 14:04:09 +0000 (14:04 +0000)
ChangeLog
lisp/gnus-offline.el
lisp/gnus-ofsetup.el

index 99d4af4..cc5dc5f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1998-11-12  Tatsuya Ichikawa  <t-ichi@po.shiojiri.ne.jp>
+
+       * lisp/gnus-offline.el: bug fix.
+
+       * lisp/gnus-ofsetup.el: Bug fix.
+
 1998-11-12  Katsumi Yamaoka   <yamaoka@jpl.org>
 
        * texi/Makefile.in (.texi:): Don't escape double quote.
index 5da32b2..2334ab4 100644 (file)
@@ -1,5 +1,5 @@
 ;;; gnus-offline.el --- To process mail & news at offline environment.
-;;; $Id: gnus-offline.el,v 1.1.2.5.2.7 1998-11-11 14:36:13 ichikawa Exp $
+;;; $Id: gnus-offline.el,v 1.1.2.5.2.8 1998-11-12 14:04:08 ichikawa Exp $
 
 ;;; Copyright (C) 1998 Tatsuya Ichikawa
 ;;;                    Yukihiro Ito
@@ -7,7 +7,7 @@
 ;;;         Yukihiro Ito <ito@rs.civil.tohoku.ac.jp>
 ;;;         Hidekazu Nakamura <u90121@uis-inf.co.jp>
 
-;;; Version: 2.00
+;;; Version: 2.00b4
 ;;; Keywords: news , mail , offline , gnus
 ;;;
 ;;; SPECIAL THANKS
 ;;;    (gnus-setup-for-offline)
 ;;;    (load gnus-offline-setting-file)
 ;;;
-;;; put following code in you .gnus-offline.el.
-;;;
-;;;  (setq gnus-offline-dialup-program-arguments '("-a" "-b"))
-;;;  (setq gnus-offline-hangup-program-arguments '("-c" "-d"))
-;;;
 ;;; If you use gnus-agent as souper , put gnus-agent setup code in you .gnus.el
 ;;;
 ;;; If you use nnspool as souper , put following code in your .emacs before
   :group 'mail
   :group 'news)
 
-(defconst gnus-offline-version-number "2.00")
+(defconst gnus-offline-version-number "2.00b4")
 (defconst gnus-offline-codename
-  "This is the time"           ; 2.00
+  "Beta4"                      ; Beta
+;;  "This is the time"         ; 2.00
 ;;  "A matter of trust"
 ;;  "Modern Woman"
 ;;  "Code of silence"
@@ -221,6 +217,7 @@ If value is nil , dialup line is disconnected status.")
 (defvar ver)
 (defvar passwd)
 (defvar num)
+(defvar gnus-offline-error-buffer " *Error*")
 (defvar gnus-offline-map (make-sparse-keymap))
 
 ;;; To silence byte compiler
@@ -254,9 +251,10 @@ If value is nil , dialup line is disconnected status.")
      (setq byte-compile-warnings nil))))
        
 (put 'gnus-offline-set-unplugged-state 'menu-enable 'gnus-offline-connected)
-(define-process-argument-editing "/hang\\.exe\\'"
-  (lambda (x) (general-process-argument-editing-function
-              x nil t t nil t t)))
+(if (eq system-type 'windows-nt)
+    (define-process-argument-editing "/hang\\.exe\\'"
+      (lambda (x) (general-process-argument-editing-function
+                  x nil t t nil t t))))
 ;;; Functions
 ;;
 ;; Setting up...
@@ -277,6 +275,32 @@ If value is nil , dialup line is disconnected status.")
        ((eq gnus-offline-mail-treat-environ 'online)
         ;; send mail under offline environ.
         (gnus-offline-set-online-sendmail-function))))
+
+;;
+;; Setting Error check.
+(defun gnus-offline-error-check ()
+  ;; Check gnus-agent and nnspool setting.
+  (cond ((eq gnus-offline-news-fetch-method 'nnagent)
+        ;; nnagent and gnus-agent loaded ??
+        (if (not (and (featurep 'gnus-agent)
+                      (featurep 'nnagent)))
+            (progn
+              (get-buffer-create gnus-offline-error-buffer)
+              (set-buffer gnus-offline-error-buffer)
+              (erase-buffer)
+              (insert "WARNING!!: gnus-agent.el or nnagent.el is not loaded.\n")
+              (insert "Please check your .emacs or .gnus.el to work gnus-agent fine.")
+              (pop-to-buffer gnus-offline-error-buffer))))
+       
+       ((eq gnus-offline-news-fetch-method 'nnspool)
+        (if (not (featurep 'nnspool))
+            (progn
+              (get-buffer-create gnus-offline-error-buffer)
+              (set-buffer gnus-offline-error-buffer)
+              (erase-buffer)
+              (insert "WARNING!!: nnspool.el is not loaded.\n")
+              (insert "Please check your .emacs or .gnus.el to work nnspool fine.")
+              (pop-to-buffer gnus-offline-error-buffer))))))
 ;;
 ;;
 (defun gnus-offline-set-offline-sendmail-function ()
index f34902c..1b90fd8 100644 (file)
@@ -1,5 +1,33 @@
 ;;; gnus-ofsetup.el --- Setup advisor for Offline reading for Mail/News.
-;;; $Id: gnus-ofsetup.el,v 1.1.2.3 1998-11-11 14:36:14 ichikawa Exp $
+;;;
+;;; $Id: gnus-ofsetup.el,v 1.1.2.4 1998-11-12 14:04:09 ichikawa Exp $
+;;;
+;;; Copyright (C) 1998 Tatsuya Ichikawa
+;;; Author: Tatsuya Ichikawa <t-ichi@po.shiojiri.ne.jp>
+;;;
+;;; This file is part of Semi-gnus.
+;;;
+;;; GNU Emacs is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2, or (at your option)
+;;; any later version.
+
+;;; GNU Emacs is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;;; Boston, MA 02111-1307, USA.
+;;;
+;;;; Commentary:
+;;; How to use.
+;;;
+;;;      M-x load[RET]gnus-ofsetup
+;;;      M-x gnus-setup-for-offline
+;;;
 
 ;;; Code:
 
          ;;
          (setq gnus-offline-mail-fetch-method mail-method)
          (setq gnus-offline-use-miee use-miee)
+         
          ;; Set programs.
          (if (string-equal program "nil")
              (progn
                (setq gnus-offline-dialup-program nil))
            (let ((options
                   (read-from-minibuffer "Dialup program options: ")))
-             (setq gnus-offline-dialup-program-arguments (split-string options "[\t ]+")))
+             (setq gnus-offline-dialup-program-arguments
+                   (split-string options "[\t ]+")))
            (let ((options
                   (read-from-minibuffer "Hangup program options: ")))
-             (setq gnus-offline-hangup-program-arguments (split-string options "[\t ]+")))
+             (setq gnus-offline-hangup-program-arguments
+                   (split-string options "[\t ]+")))
            (setq gnus-offline-hangup-program program)
            (setq gnus-offline-dialup-program program))
-
-         ;; Set spool directory for outgoing messages.
+           
+           ;; Set spool directory for outgoing messages.
          (if use-miee
              (progn
                ;; Setting for MIEE with nnspool.
                (let ((news-spool
-                      (read-from-minibuffer "News spool directory for sending: " "~/spool/mail.out"))
+                      (read-from-minibuffer
+                       "News spool directory for sending: "
+                       "~/spool/mail.out"))
                      (mail-spool
-                      (read-from-minibuffer "Mail spool directory for sending: " "~/spool/news.out")))
+                      (read-from-minibuffer
+                       "Mail spool directory for sending: "
+                       "~/spool/news.out")))
                  (setq gnus-offline-mail-spool-directory mail-spool)
                  (setq gnus-offline-news-spool-directory news-spool)
                  (setq gnus-offline-drafts-queue-type 'miee)
-               
+                 
                  ;; Load MIEE.
                  (load "miee")
                  ;; Set news post function for MIEE.
                  (setq message-send-news-function 'gnspool-request-post)
-                 
                  ;; Spool directory setting - MIEE.
                  (if (not (file-exists-p gnus-offline-mail-spool-directory))
                      (make-directory gnus-offline-mail-spool-directory t))
-                 (setq sendmail-to-spool-directory gnus-offline-mail-spool-directory)
+                 (setq sendmail-to-spool-directory
+                       gnus-offline-mail-spool-directory)
                  (if (not (file-exists-p gnus-offline-news-spool-directory))
                      (make-directory gnus-offline-news-spool-directory t))
-                 (setq news-spool-request-post-directory gnus-offline-news-spool-directory)))
-           ;; Setting for gnus-agent.
-           (setq gnus-offline-drafts-queue-type 'agent)
-           (let ((agent-directory
-                  (read-from-minibuffer "Agent directory: " "~/News/agent")))
-             (setq gnus-agent-directory agent-directory)))
+                 (setq news-spool-request-post-directory
+                       gnus-offline-news-spool-directory)))
+           
+           ;; Set drafts type gnus-agent.
+           (setq gnus-offline-drafts-queue-type 'agent))
          
+         ;; Setting for gnus-agent.
+         (let ((agent-directory
+                (read-from-minibuffer "Agent directory: " "~/News/agent")))
+           (setq gnus-agent-directory agent-directory))
+           
          ;; Determin MTA type.
          (if (string-equal mta-type "smtp")
              (setq gnus-offline-MTA-type 'smtp)
          (setq i (string-to-int num-of-address))
          (setq address nil)
          (while (> i 0)
-           (setq address (append address (list (list
-                              (concat "po:" (read-from-minibuffer "Email address (user@mailhost): "))
-                              (completing-read
-                               "Authentification Method (TAB to completion): "
-                               '(("pass" 1) ("apop" 2)) nil t nil)))))
+           (setq address
+                 (append address
+                         (list
+                          (list
+                           (concat "po:"
+                                   (read-from-minibuffer
+                                    "Email address (user@mailhost): "))
+                           (completing-read
+                            "Authentification Method (TAB to completion): "
+                            '(("pass" 1) ("apop" 2)) nil t nil)))))
            (setq i (- i 1)))
-
+         
          ;; Replace "hoge" -> 'hoge
          (mapcar
           (lambda (x)
               (setcar (cdr x) 'apop)))
           address)
          (setq pop3-fma-spool-file-alist address)
-
+         
          ;; Set movemail type.
          (let ((movemail-type
                 (completing-read
            (if (string-equal movemail-type "exe")
                (setq pop3-fma-movemail-type 'exe)
              (setq pop3-fma-movemail-type 'lisp))))
-         
+       
        ;; Write to setting file.
        (setq tmp-buffer (get-buffer-create "* Setting"))
        (set-buffer "* Setting")
        (insert (current-time-string))
        (insert "\n")
        (insert ";;\n")
+
+       ;; write Basic setting
        (insert "(setq gnus-offline-news-fetch-method '")
        (insert (prin1-to-string gnus-offline-news-fetch-method))
        (insert ")\n")
        (insert "(setq gnus-offline-dialup-program ")
        (insert (prin1-to-string gnus-offline-dialup-program))
        (insert ")\n")
+
+       ;; write dialup/hangup program and options.
        (if (stringp gnus-offline-dialup-program)
            (progn
              (insert "(setq gnus-offline-dialup-program-arguments '")
              (insert "(setq gnus-offline-hangup-program-arguments '")
              (insert (prin1-to-string gnus-offline-hangup-program-arguments))
              (insert ")\n")))
+
+       ;; write setting about MIEE.
        (if gnus-offline-use-miee
            (progn
              (insert "(setq gnus-offline-mail-spool-directory ")
              (insert "(setq gnus-offline-news-spool-directory ")
              (insert (prin1-to-string gnus-offline-news-spool-directory))
              (insert ")\n")
-             (insert "(load \"miee\")\n")
-             (if (equal gnus-offline-news-fetch-method 'nnspool)
-                 (insert "(message-offline-state)\n")))
-         (insert "(setq sendmail-to-spool-directory gnus-offline-mail-spool-directory)\n")
-         (insert "(setq news-spool-request-post-directory gnus-offline-news-spool-directory)\n")
+             (insert "(setq sendmail-to-spool-directory gnus-offline-mail-spool-directory)\n")
+             (insert "(setq news-spool-request-post-directory gnus-offline-news-spool-directory)\n")
+             (insert "(load \"miee\")\n")))
+
+       ;; write setting about nnspool and gnus-agent.
+       (if (equal gnus-offline-news-fetch-method 'nnspool)
+           (insert "(message-offline-state)\n")
          (insert "(setq gnus-agent-directory ")
          (insert (prin1-to-string gnus-agent-directory))
          (insert ")\n"))
+
+       ;; write setting about queue type -- MIEE or nnagent.
        (insert "(setq gnus-offline-drafts-queue-type '")
        (insert (prin1-to-string gnus-offline-drafts-queue-type))
        (insert ")\n")
        (insert "(setq gnus-offline-MTA-type '")
        (insert (prin1-to-string gnus-offline-MTA-type))
        (insert ")\n")
+
+       ;; Offline setting for gnus-nntp-*
        (insert "(setq gnus-nntp-service nil)\n")
        (insert "(setq gnus-nntp-server nil)\n")
        (insert "(setq nnmail-spool-file nil)\n")
-       (insert "(add-hook 'gnus-group-mode-hook 'gnus-offline-processed-by-timer)\n")
+
+       ;; Write setting about hooks.
+       (insert "(add-hook 'gnus-group-mode-hook 'gnus-offline-processed-by-timer t)\n")
+       (insert "(add-hook 'gnus-group-mode-hook 'gnus-offline-error-check t)\n")
        (insert "(add-hook 'gnus-after-getting-new-news-hook 'gnus-offline-after-get-new-news)\n")
        (insert "(add-hook 'gnus-after-getting-news-hook 'gnus-offline-after-get-new-news)\n")
        (if (eq gnus-offline-news-fetch-method 'nnspool)
        (insert "(add-hook 'message-send-hook 'gnus-offline-message-add-header)\n")
        (insert "(autoload 'gnus-offline-setup \"gnus-offline\")\n")
        (insert "(add-hook 'gnus-load-hook 'gnus-offline-setup)\n")
+
+       ;; Write setting about pop3-fma.
        (insert "(require 'pop3-fma)\n")
        (insert "(add-hook 'message-send-hook 'pop3-fma-message-add-header)\n")
        (insert "(setq pop3-fma-spool-file-alist '")
              (insert ")\n")))
        (write-region (point-min) (point-max) gnus-offline-setting-file)
        (kill-buffer "* Setting"))
-       )
-  (load gnus-offline-setting-file)
-  )
+    )
+  (load gnus-offline-setting-file))
+;; gnus-ofsetup.el Ends here.
\ No newline at end of file