From e45804acb3ed02548c010df1bc39dc53afee493d Mon Sep 17 00:00:00 2001 From: ichikawa Date: Mon, 1 Feb 1999 06:45:23 +0000 Subject: [PATCH] lisp/gnus-offline.el , lisp/gnus-ofsetup.el: Sync up with pgnus-ichikawa --- ChangeLog | 14 +++++ lisp/gnus-offline.el | 90 +++++++++++++++++++------------- lisp/gnus-ofsetup.el | 142 +++++++++++++++++++++++++++++++------------------- 3 files changed, 155 insertions(+), 91 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e03afd..9573c05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +1999-02-01 Tatsuya Ichikawa + Tsukamoto Tetsuo + + * 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 + + * lisp/gnus-offline.el: Rewrite to work with pGnus v0.74 based T-gnus. + * lisp/gnus-ofsetup.el: Ditto. + 1999-01-28 Katsumi Yamaoka * lisp/gnus-msg.el (gnus-summary-mail-digest): Reselect the message diff --git a/lisp/gnus-offline.el b/lisp/gnus-offline.el index b07498f..630af57 100644 --- a/lisp/gnus-offline.el +++ b/lisp/gnus-offline.el @@ -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 ;;; Tsukamoto Tetsuo -;;; 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. @@ -105,7 +105,6 @@ (require 'cl) (require 'custom) -(require 'pop3-fma) (require 'easymenu) (unless (and (condition-case () @@ -124,12 +123,13 @@ :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 状態へ" message-online-state message-offline-state] "----" ("Gnus Offline" - ["movemail の切替え" gnus-offline-toggle-movemail-program t] + ["movemail の切替え" gnus-offline-toggle-movemail-program + (not (locate-library "mail-source"))] ["取得記事種類の変更" gnus-offline-toggle-articles-to-fetch t] ["Mail 送信方法(On/Off)の切替え" gnus-offline-toggle-on/off-send-mail t] ["自動切断の切替え" 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 の切替え" gnus-offline-toggle-movemail-program t] + ["movemail の切替え" gnus-offline-toggle-movemail-program + (not (locate-library "mail-source"))] ["取得記事種類の変更" gnus-offline-toggle-articles-to-fetch t] ["Mail 送信方法(On/Off)の切替え" gnus-offline-toggle-on/off-send-mail t] ["自動切断の切替え" gnus-offline-toggle-auto-hangup t] @@ -891,7 +906,8 @@ If value is nil , dialup line is disconnected status.") "----" ["回線の切断" 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] diff --git a/lisp/gnus-ofsetup.el b/lisp/gnus-ofsetup.el index 2f03ac7..6fb5b75 100644 --- a/lisp/gnus-ofsetup.el +++ b/lisp/gnus-ofsetup.el @@ -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 @@ -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 @@ -172,43 +173,65 @@ ;; 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") @@ -283,7 +306,6 @@ ;; 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") @@ -296,20 +318,32 @@ (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")) ) -- 1.7.10.4