lisp/gnus-offline.el , lisp/gnus-ofsetup.el: Sync up with pgnus-ichikawa
authorichikawa <ichikawa>
Mon, 1 Feb 1999 06:45:23 +0000 (06:45 +0000)
committerichikawa <ichikawa>
Mon, 1 Feb 1999 06:45:23 +0000 (06:45 +0000)
ChangeLog
lisp/gnus-offline.el
lisp/gnus-ofsetup.el

index 9e03afd..9573c05 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+1999-02-01  Tatsuya Ichikawa  <t-ichi@po.shiojiri.ne.jp>
+            Tsukamoto Tetsuo  <czkmt@remus.dti.ne.jp>
+
+       * lisp/gnus-offline.el (gnus-offline-gnus-get-new-news): Modify for
+       pGnus with mail-source.el.
+
+       * lisp/gnus-offline.el: Use (running-pterodactyl-gnus-0_73-or-later)
+        to check pGnus 0.73 or later instead of (locate-library "mail-source")
+       
+1999-01-30  Tatsuya Ichikawa  <t-ichi@po.shiojiri.ne.jp>
+
+       * lisp/gnus-offline.el: Rewrite to work with pGnus v0.74 based T-gnus.
+       * lisp/gnus-ofsetup.el: Ditto.
+
 1999-01-28  Katsumi Yamaoka   <yamaoka@jpl.org>
 
        * lisp/gnus-msg.el (gnus-summary-mail-digest): Reselect the message
index b07498f..630af57 100644 (file)
@@ -1,5 +1,5 @@
 ;;; gnus-offline.el --- To process mail & news at offline environment.
-;;; $Id: gnus-offline.el,v 1.1.4.6 1999-01-26 02:40:55 yamaoka Exp $
+;;; $Id: gnus-offline.el,v 1.1.4.7 1999-02-01 06:45:20 ichikawa Exp $
 
 ;;; Copyright (C) 1998 Tatsuya Ichikawa
 ;;;                    Yukihiro Ito
@@ -8,7 +8,7 @@
 ;;;         Hidekazu Nakamura <u90121@uis-inf.co.jp>
 ;;;         Tsukamoto Tetsuo <czkmt@remus.dti.ne.jp>
 
-;;; Version: 2.02
+;;; Version: 2.10
 ;;; Keywords: news , mail , offline , gnus
 ;;;
 ;;; SPECIAL THANKS
@@ -59,7 +59,7 @@
 ;;; In Gnus group buffer , type g to get all news and mail.
 ;;; Then send mail and news in spool directory.
 ;;;
-;;; Security Notice.
+;;; Security Notice. (This is available before version 2.02)
 ;;;
 ;;; You can set the variable gnus-offline-pop-password-file to save your POP
 ;;; passwords. But TAKE CARE. Use it at your own risk.
 
 (require 'cl)
 (require 'custom)
-(require 'pop3-fma)
 (require 'easymenu)
 
 (unless (and (condition-case ()
   :group 'mail
   :group 'news)
 
-(defconst gnus-offline-version-number "2.02")
+(defconst gnus-offline-version-number "2.10b1")
 (defconst gnus-offline-codename
 ;;  "Beta5"                    ; Beta
 ;;  "This is the time"         ; 2.00
 ;;  "A matter of trust"
-  "Modern Woman"
+;;  "Modern Woman"
+  "Ahhhhhhh!!"                 ; 2.10b1
 ;;  "Code of silence"
   )
 
@@ -253,6 +253,9 @@ If value is nil , dialup line is disconnected status.")
 (defvar gnus-offline-movemail-arguments nil
   "*All command line arguments of exec-directory/movemail.")
 
+(defvar gnus-offline-mail-source nil
+  "*nnmail-spool-file save variable.")
+
 ;;; Temporary variable:
 (defvar string)
 (defvar hdr)
@@ -381,25 +384,30 @@ If value is nil , dialup line is disconnected status.")
   (if (functionp gnus-offline-dialup-function)
       (funcall gnus-offline-dialup-function))
   (gnus-offline-get-new-news-function)
-  (let (buffer)
-    (unwind-protect
-       (progn
-         (save-excursion
-           (or pop3-fma-password
-               (when gnus-offline-pop-password-file
-                 (setq pop3-fma-save-password-information t)
-                 (setq buffer (get-buffer-create "*offline-temp*"))
-                 (set-buffer buffer)
-                 (erase-buffer)
-                 (insert-file-contents-as-binary gnus-offline-pop-password-file)
-                 (and gnus-offline-pop-password-decoding-function
-                      (funcall gnus-offline-pop-password-decoding-function))
-                 (eval-buffer))))
-         (gnus-group-get-new-news arg))
-      (when gnus-offline-pop-password-file
-       (setq pop3-fma-password nil)
-       (setq pop3-fma-save-password-information nil)
-       (kill-buffer buffer)))))
+  (if (not (locate-library "mail-source"))
+      (progn
+       (let (buffer)
+         (unwind-protect
+             (progn
+               (save-excursion
+                 (or pop3-fma-password
+                     (when gnus-offline-pop-password-file
+                       (setq pop3-fma-save-password-information t)
+                       (setq buffer (get-buffer-create "*offline-temp*"))
+                       (set-buffer buffer)
+                       (erase-buffer)
+                       (insert-file-contents-as-binary gnus-offline-pop-password-file)
+                       (and gnus-offline-pop-password-decoding-function
+                            (funcall gnus-offline-pop-password-decoding-function))
+                       (eval-buffer))))
+               (gnus-group-get-new-news arg))
+           (when gnus-offline-pop-password-file
+             (setq pop3-fma-password nil)
+             (setq pop3-fma-save-password-information nil)
+             (kill-buffer buffer)))))
+    ;;
+    ;; Use mail-source.el
+    (gnus-group-get-new-news arg)))
 
 ;;
 ;; dialup...
@@ -536,13 +544,16 @@ If value is nil , dialup line is disconnected status.")
 (defun gnus-offline-enable-fetch-mail ()
   "*Set to fetch mail."
   (setq gnus-offline-mail-fetch-method 'nnmail)
-  (setq nnmail-movemail-program 'pop3-fma-movemail)
-  (setq nnmail-spool-file (append
-                          pop3-fma-local-spool-file-alist
-                          (mapcar
-                           (lambda (spool)
-                             (car spool))
-                           pop3-fma-spool-file-alist))))
+  (if (not (locate-library "mail-source"))
+      (progn
+       (setq nnmail-movemail-program 'pop3-fma-movemail)
+       (setq nnmail-spool-file (append
+                                pop3-fma-local-spool-file-alist
+                                (mapcar
+                                 (lambda (spool)
+                                   (car spool))
+                                 pop3-fma-spool-file-alist))))
+    (setq nnmail-spool-file gnus-offline-mail-source)))
 ;;
 ;; Enable fetch news
 ;;
@@ -786,7 +797,8 @@ If value is nil , dialup line is disconnected status.")
   (add-hook 'gnus-group-mode-hook
            '(lambda ()
               (local-set-key "\C-coh" 'gnus-offline-set-unplugged-state)
-              (local-set-key "\C-com" 'gnus-offline-toggle-movemail-program)
+              (if (not (locate-library "mail-source"))
+                  (local-set-key "\C-com" 'gnus-offline-toggle-movemail-program))
               (local-set-key "\C-cof" 'gnus-offline-toggle-articles-to-fetch)
               (local-set-key "\C-coo" 'gnus-offline-toggle-on/off-send-mail)
               (local-set-key "\C-cox" 'gnus-offline-toggle-auto-hangup)
@@ -837,7 +849,8 @@ If value is nil , dialup line is disconnected status.")
         ["Online \e$B>uBV$X\e(B" message-online-state message-offline-state]
         "----"
         ("Gnus Offline"
-         ["movemail \e$B$N@ZBX$(\e(B" gnus-offline-toggle-movemail-program t]
+         ["movemail \e$B$N@ZBX$(\e(B" gnus-offline-toggle-movemail-program
+          (not (locate-library "mail-source"))]
          ["\e$B<hF@5-;v<oN`$NJQ99\e(B" gnus-offline-toggle-articles-to-fetch t]
          ["Mail \e$BAw?.J}K!\e(B(On/Off)\e$B$N@ZBX$(\e(B" gnus-offline-toggle-on/off-send-mail t]
          ["\e$B<+F0@ZCG$N@ZBX$(\e(B" gnus-offline-toggle-auto-hangup t]
@@ -858,7 +871,8 @@ If value is nil , dialup line is disconnected status.")
        ["Message Online" message-online-state message-offline-state]
        "----"
        ("Gnus Offline"
-       ["Toggle movemail program" gnus-offline-toggle-movemail-program t]
+       ["Toggle movemail program" gnus-offline-toggle-movemail-program
+        (not (locate-library "mail-source"))]
        ["Toggle articles to fetch" gnus-offline-toggle-articles-to-fetch t]
        ["Toggle online/offline send mail" gnus-offline-toggle-on/off-send-mail t]
        ["Toggle auto hangup" gnus-offline-toggle-auto-hangup t]
@@ -881,7 +895,8 @@ If value is nil , dialup line is disconnected status.")
    "Gnus offline Menu"
    (if (featurep 'meadow)
        '("Offline"
-        ["movemail \e$B$N@ZBX$(\e(B" gnus-offline-toggle-movemail-program t]
+        ["movemail \e$B$N@ZBX$(\e(B" gnus-offline-toggle-movemail-program
+         (not (locate-library "mail-source"))]
         ["\e$B<hF@5-;v<oN`$NJQ99\e(B" gnus-offline-toggle-articles-to-fetch t]
         ["Mail \e$BAw?.J}K!\e(B(On/Off)\e$B$N@ZBX$(\e(B" gnus-offline-toggle-on/off-send-mail t]
         ["\e$B<+F0@ZCG$N@ZBX$(\e(B" gnus-offline-toggle-auto-hangup t]
@@ -891,7 +906,8 @@ If value is nil , dialup line is disconnected status.")
         "----"
         ["\e$B2s@~$N@ZCG\e(B" gnus-offline-set-unplugged-state gnus-offline-connected])
      '("Offline"
-       ["Toggle movemail program" gnus-offline-toggle-movemail-program t]
+       ["Toggle movemail program" gnus-offline-toggle-movemail-program
+       (not (locate-library "mail-source"))]
        ["Toggle articles to fetch" gnus-offline-toggle-articles-to-fetch t]
        ["Toggle online/offline send mail" gnus-offline-toggle-on/off-send-mail t]
        ["Toggle auto hangup" gnus-offline-toggle-auto-hangup t]
index 2f03ac7..6fb5b75 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gnus-ofsetup.el --- Setup advisor for Offline reading for Mail/News.
 ;;;
-;;; $Id: gnus-ofsetup.el,v 1.1.4.1 1998-12-24 03:34:48 yamaoka Exp $
+;;; $Id: gnus-ofsetup.el,v 1.1.4.2 1999-02-01 06:45:23 ichikawa Exp $
 ;;;
 ;;; Copyright (C) 1998 Tatsuya Ichikawa
 ;;; Author: Tatsuya Ichikawa <t-ichi@po.shiojiri.ne.jp>
@@ -41,8 +41,9 @@
 (defvar pop3-fma-movemail-type nil)
 (defvar pop3-fma-movemail-arguments nil)
 (defvar use-miee nil)
-(defvar address)
-(defvar options)
+(defvar address nil)
+(defvar mail-source nil)
+(defvar options nil)
 
 ;;; To silence byte compiler
 (and
          ;; Set E-Mail Address and pop3 movemail type.
          (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 i (- i 1)))
-         
-         ;; Replace "hoge" -> 'hoge
-         (mapcar
-          (lambda (x)
-            (if (string-equal (nth 1 x) "pass")
-                (setcar (cdr x) 'pass)
-              (setcar (cdr x) 'apop)))
-          address)
-         (setq pop3-fma-spool-file-alist address)
-         
-         ;; Set movemail type.
-         (let ((movemail-type
-                (completing-read
-                 "Select movemail type for retreave mail (TAB to completion): "
-                 '(("exe" 1) ("lisp" 2))
-                 nil t nil))
-               )
-           (if (string-equal movemail-type "exe")
-               (let ((options
-                      (read-from-minibuffer "movemail options: ")))
-                 (setq pop3-fma-movemail-arguments (split-string options "[\t ]+"))))
-           (if (string-equal movemail-type "exe")
-               (setq pop3-fma-movemail-type 'exe)
-             (setq pop3-fma-movemail-type 'lisp))))
-       
+         (if (not (locate-library "mail-source"))
+             (progn
+               (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 i (- i 1)))
+               ;; Replace "hoge" -> 'hoge
+               (mapcar
+                (lambda (x)
+                  (if (string-equal (nth 1 x) "pass")
+                      (setcar (cdr x) 'pass)
+                    (setcar (cdr x) 'apop)))
+                address)
+               (setq pop3-fma-spool-file-alist address)
+               ;; Set movemail type.
+               (let ((movemail-type
+                      (completing-read
+                       "Select movemail type for retreave mail (TAB to completion): "
+                       '(("exe" 1) ("lisp" 2))
+                       nil t nil))
+                     )
+                 (if (string-equal movemail-type "exe")
+                     (let ((options
+                            (read-from-minibuffer "movemail options: ")))
+                       (setq pop3-fma-movemail-arguments (split-string options "[\t ]+"))))
+                 (if (string-equal movemail-type "exe")
+                     (setq pop3-fma-movemail-type 'exe)
+                   (setq pop3-fma-movemail-type 'lisp))))
+           ;;
+           ;; Use mail-source.el
+           (setq mail-source nil)
+           (while (> i 0)
+             (setq user (read-from-minibuffer "Mail Account name : "))
+             (setq server (read-from-minibuffer "Mail server : "))
+             (setq auth (completing-read
+                         "Authentification Method (TAB to completion): "
+                         '(("pop" 1) ("apop" 2)) nil t nil))
+             (setq mail-source
+                   (append mail-source
+                           (list
+                            (list
+                             auth :user user :server server))))
+             (setq i (- i 1)))
+           ;; Replace "hoge" -> 'hoge
+           (mapcar
+            (lambda (x)
+              (if (string-equal (nth 0 x) "pop")
+                  (setcar x 'pop)
+                (setcar x 'apop)))
+            mail-source)
+           (setq gnus-offline-mail-source mail-source)))
        ;; Write to setting file.
        (setq tmp-buffer (get-buffer-create "* Setting"))
        (set-buffer "* Setting")
        ;; 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")
 
        ;; Write setting about hooks.
        (insert "(add-hook 'gnus-group-mode-hook 'gnus-offline-processed-by-timer t)\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 (prin1-to-string pop3-fma-spool-file-alist))
-       (insert ")\n")
-       (insert "(setq pop3-fma-movemail-type '")
-       (insert (prin1-to-string pop3-fma-movemail-type))
-       (insert ")\n")
-       (if (eq pop3-fma-movemail-type 'exe)
+       (if (not (locate-library "mail-source"))
            (progn
-             (insert "(setq pop3-fma-movemail-arguments '")
-             (insert (prin1-to-string pop3-fma-movemail-arguments))
-             (insert ")\n")))
+             ;; Write setting about pop3-fma.
+             (insert "(setq nnmail-spool-file nil)\n")
+             (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 (prin1-to-string pop3-fma-spool-file-alist))
+             (insert ")\n")
+             (insert "(setq pop3-fma-movemail-type '")
+             (insert (prin1-to-string pop3-fma-movemail-type))
+             (insert ")\n")
+             (if (eq pop3-fma-movemail-type 'exe)
+                 (progn
+                   (insert "(setq pop3-fma-movemail-arguments '")
+                   (insert (prin1-to-string pop3-fma-movemail-arguments))
+                   (insert ")\n"))))
+         ;; Write stting about mail-source.el
+         (insert "(setq gnus-offline-mail-source '")
+         (insert (prin1-to-string gnus-offline-mail-source))
+         (insert ")\n")
+         (insert "(setq nnmail-spool-file gnus-offline-mail-source)\n")
+         (insert "(require 'read-passwd)\n")
+         (insert "(setq mail-source-read-passwd 'read-pw-read-passwd)\n")
+         (insert "(add-hook 'gnus-before-startup-hook 'read-pw-set-mail-source-passwd-cache)\n");
+         )
        (write-region (point-min) (point-max) gnus-offline-setting-file)
        (kill-buffer "* Setting"))
     )