From 8bd3c5b81c1a08d32c0834259a7af04aacd99937 Mon Sep 17 00:00:00 2001 From: ichikawa Date: Tue, 10 Nov 1998 14:53:51 +0000 Subject: [PATCH] lisp/gnus-offline.el , lisp/gnus-ofsetup.el : bug fix. --- ChangeLog | 6 +++ lisp/gnus-offline.el | 11 ++-- lisp/gnus-ofsetup.el | 143 +++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 123 insertions(+), 37 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b6b933..6f808a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1998-11-10 Tatsuya Ichikawa + + * lisp/gnus-offline.el: bug fix. + + * lisp/gnus-ofsetup.el: Bug fix. + 1998-11-09 Tatsuya Ichikawa * lisp/gnus-offline.el: v2.00b1 Separate setting part and diff --git a/lisp/gnus-offline.el b/lisp/gnus-offline.el index 280a870..2e78f30 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.2.5.2.5 1998-11-09 14:44:06 ichikawa Exp $ +;;; $Id: gnus-offline.el,v 1.1.2.5.2.6 1998-11-10 14:53:51 ichikawa Exp $ ;;; Copyright (C) 1998 Tatsuya Ichikawa ;;; Yukihiro Ito @@ -7,7 +7,7 @@ ;;; Yukihiro Ito ;;; Hidekazu Nakamura -;;; Version: 2.00b1 +;;; Version: 2.00 ;;; Keywords: news , mail , offline , gnus ;;; ;;; SPECIAL THANKS @@ -103,10 +103,9 @@ :group 'mail :group 'news) -(defconst gnus-offline-version-number "2.00b1") +(defconst gnus-offline-version-number "2.00") (defconst gnus-offline-codename - "Beta1" -;; "This is the time" ; 2.00 + "This is the time" ; 2.00 ;; "A matter of trust" ;; "Modern Woman" ;; "Code of silence" @@ -265,7 +264,7 @@ If value is nil , dialup line is disconnected status.") ;; Load setting file - required. (load gnus-offline-setting-file) - ;; Menus. + ;; Menu and keymap (gnus-offline-define-menu-and-key) ;; To transfer Mail/News function. diff --git a/lisp/gnus-ofsetup.el b/lisp/gnus-ofsetup.el index 0a813b4..6edc8bc 100644 --- a/lisp/gnus-ofsetup.el +++ b/lisp/gnus-ofsetup.el @@ -1,10 +1,19 @@ ;;; gnus-ofsetup.el --- Setup advisor for Offline reading for Mail/News. -;;; $Id: gnus-ofsetup.el,v 1.1.2.1 1998-11-09 14:44:07 ichikawa Exp $ +;;; $Id: gnus-ofsetup.el,v 1.1.2.2 1998-11-10 14:53:51 ichikawa Exp $ ;;; Code: (defvar gnus-offline-setting-file "~/.gnus-offline.el") (defvar gnus-offline-use-miee nil) +(defvar gnus-offline-news-fetch-method nil) +(defvar gnus-offline-mail-fetch-method nil) +(defvar gnus-offline-hangup-program nil) +(defvar gnus-offline-dialup-program nil) +(defvar pop3-fma-spool-file-alist nil) +(defvar pop3-fma-movemail-type nil) +(defvar pop3-fma-movemail-arguments nil) +(defvar address) +(defvar options) ;;; To silence byte compiler (and @@ -44,64 +53,115 @@ (progn (let ((news-method (completing-read - "Select method for offline News reading: " + "Method for offline News reading (TAB to completion): " '(("gnus-agent" 1) ("nnspool" 2)) nil t nil)) (mail-method 'nnmail) (use-miee (y-or-n-p "Use MIEE post/send message ")) (program - (read-from-minibuffer "Dialup/Hangup program: ")) + (read-file-name "Dialup/Hangup program(type nil you do not use): ")) (mta-type (completing-read - "Select MTA type for sending mail: " + "Select MTA type for sending mail (TAB to completion): " '(("smtp" 1) ("sendmail" 2)) nil t nil)) + (num-of-address + (read-from-minibuffer "How many e-mail address do you have: ")) ) - (if (equal news-method "gnus-agent") + ;; + ;; Set variables. + (if (string-equal news-method "gnus-agent") (setq gnus-offline-news-fetch-method 'nnagent) (setq gnus-offline-news-fetch-method 'nnspool)) + ;; (setq gnus-offline-mail-fetch-method mail-method) (setq gnus-offline-use-miee use-miee) - (setq gnus-offline-hangup-program program) - (setq gnus-offline-dialup-program program) + ;; Set programs. + (if (string-equal program "nil") + (progn + (setq gnus-offline-hangup-program nil) + (setq gnus-offline-dialup-program nil)) + (let ((options + (read-from-minibuffer "Dialup program options: "))) + (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 program) + (setq gnus-offline-dialup-program program)) + + ;; Set spool directory for outgoing messages. (if use-miee (progn - ;; Setting for MIEE. + ;; Setting for MIEE with nnspool. (let ((news-spool - (read-from-minibuffer "News spool directory for sending: ")) + (read-from-minibuffer "News spool directory for sending: " "~/spool/mail.out")) (mail-spool - (read-from-minibuffer "Mail spool directory for sending: "))) + (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))) + (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) + (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))) - (if (equal mta-type "smtp") + + ;; Determin MTA type. + (if (string-equal mta-type "smtp") (setq gnus-offline-MTA-type 'smtp) (setq gnus-offline-MTA-type 'sendmail) ) + ;; + ;; 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)))) - ;; Set offline news posting function and post directory using MIEE. - (if gnus-offline-use-miee - (progn - ;; 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) - (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))) - ) - ;; Write to setting file. (setq tmp-buffer (get-buffer-create "* Setting")) (set-buffer "* Setting") @@ -124,9 +184,19 @@ (insert "(setq gnus-offline-dialup-program ") (insert (prin1-to-string gnus-offline-dialup-program)) (insert ")\n") + (if (stringp gnus-offline-dialup-program) + (progn + (insert "(setq gnus-offline-dialup-program-arguments '") + (insert (prin1-to-string gnus-offline-dialup-program-arguments)) + (insert ")\n"))) (insert "(setq gnus-offline-hangup-program ") (insert (prin1-to-string gnus-offline-hangup-program)) (insert ")\n") + (if (stringp gnus-offline-hangup-program) + (progn + (insert "(setq gnus-offline-hangup-program-arguments '") + (insert (prin1-to-string gnus-offline-hangup-program-arguments)) + (insert ")\n"))) (if gnus-offline-use-miee (progn (insert "(setq gnus-offline-mail-spool-directory ") @@ -155,10 +225,21 @@ (if (eq gnus-offline-news-fetch-method 'nnspool) (insert "(add-hook 'after-getting-news-hook 'gnus-offline-nnspool-hangup-line)\n")) (insert "(add-hook 'message-send-hook 'gnus-offline-message-add-header)\n") - (insert "(require 'pop3-fma)\n") - (insert "(add-hook 'message-send-hook 'pop3-fma-message-add-header)\n") (insert "(autoload 'gnus-offline-setup \"gnus-offline\")\n") (insert "(add-hook 'gnus-load-hook 'gnus-offline-setup)\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-region (point-min) (point-max) gnus-offline-setting-file) (kill-buffer "* Setting")) ) -- 1.7.10.4