From 22f34105c4914ff7daf6bc6162d3f50dc9259cc6 Mon Sep 17 00:00:00 2001 From: keiichi Date: Fri, 5 Feb 1999 02:59:14 +0000 Subject: [PATCH] Sync up with gnus-6_10. --- README-offline.en | 104 ++++++++++++++++++++++ README-offline.ja | 239 ++++++++++++++++++++++++++++++++++++++++++++++++++ lisp/gnus-msg.el | 6 +- lisp/gnus-offline.el | 107 ++++++++++++++++++---- lisp/gnus-ofsetup.el | 165 +++++++++++++++++++++++----------- lisp/gnus-start.el | 42 +++++---- lisp/gnus-sum.el | 6 +- lisp/nnheader.el | 10 ++- lisp/smiley.el | 9 +- 9 files changed, 585 insertions(+), 103 deletions(-) create mode 100644 README-offline.en create mode 100644 README-offline.ja diff --git a/README-offline.en b/README-offline.en new file mode 100644 index 0000000..58c379c --- /dev/null +++ b/README-offline.en @@ -0,0 +1,104 @@ + +User definable variables in gnus-offline + +o gnus-offline-dialup-program + Program name to dialup. + +o gnus-offline-dialup-program-arguments + List of dialup program arguments. + +o gnus-offline-hangup-program + Program name to hangup. + +o gnus-offline-hangup-program-arguments + List of hangup program arguments. + +o gnus-offline-mail-spool-directory + Spool directory for sending mail. + This variable is available only using MIEE. + +o gnus-offline-news-spool-directory + Spool directory for sending news. + This variable is available only using MIEE. + +o gnus-offline-mail-treat-environ + If t , gnus-offline sends mail to spool first. + If nil , gnus-offline sends mail immediatry. + +o gnus-offline-articles-to-fetch + Article type you want to fetch. + + 'both ... Fetch both Mail/News. + 'Mail ... Fetch only Mail. + 'News ... Fetch only News. + + Default value is both. + +o gnus-offline-popup-menu + Whether use menu. + +o gnus-offline-load-hook + Hook before gnus-offline load. + +o gnus-offline-before-online-hook + Hook before all online jobs. + +o gnus-offline-after-online-hook + Hook after all online jobs. + +o gnus-offline-interval-time + Interval time to do all online jobs.(minutes) + +o gnus-offline-MTA-type + MTA type to sending mail. + + 'smtp ... Use smtp.el. + 'sendmail ... Use sendmail.el. + +o gnus-offline-drafts-queue-type + Message queue type when spooling message. + + 'miee ... Use miee.el. + 'agent ... Use gnus-agent.el. + +o gnus-offline-after-empting-spool-hook + Hook before empting spool. + +o gnus-offline-before-empting-spool-hook + Hook after emoting spool. + +o gnus-offline-dialup-function + Function to dialup. + +o gnus-offline-hangup-function + Function to hangup. + +o gnus-offline-pop-password-file + File name to save username , mailserver and password. + +o gnus-offline-pop-password-decoding-function + Function to decode password. + +Commands in gnus-offline. + +o M-x gnus-offline-toggle-plugged + Toggle offline/online state. + +o M-x gnus-offline-toggle-auto-hangup + Change current state to offline. + +o M-x gnus-offline-toggle-on/off-send-mail + Toggle method to sending mail. + +o M-x gnus-offline-toggle-articles-to-fetch + Toggle articles you want to fetch. + +o M-x gnus-offline-toggle-movemail-program + Toggle movemail program. + +o M-x gnus-offline-set-interval-time + Set interval time(minute) to fetch article. + +o M-x gnus-offline-agent-expire + Expire articles. + diff --git a/README-offline.ja b/README-offline.ja new file mode 100644 index 0000000..c9001d5 --- /dev/null +++ b/README-offline.ja @@ -0,0 +1,239 @@ +1) gnus-offline (Gnus Offline Backend Utility)って何? + +これは Semi-gnus でメッセージをより容易にオフライン環境で扱うためのユー +ティリティです。 + +主として Semi-gnus の `Agent' と呼ばれる機能のために書か +れています。 + +また、gnspool などの外部プログラムを用いた nnspool でも使うことができま +す。また、別途配布の Miee.el を送信に使用することも可能です。 + +;; gnus-offline を使わなくてもオフラインでの読み書きは出来ますが、 +;; gnus-offline を使えばより設定・操作が簡単に出来ます。 + +具体的には + +・動作に必要な変数の対話的設定が可能 + +・グループバッファで“g”とタイプするだけで ダイアルアップ->メイルおよび +ネットニュースの送受信->ダイアルアップの切断 という動作を一気に行うこと +が可能になります。(ただし接続・および切断は別途専用のツールが必要です) + +なお、このドキュメントでは送受信ともに gnus-agent を使うことを前提に解説 +します。 + +2) インストール + +Semi-gnus をお使いの場合、gnus-offline.el は特に何も考えなくても +Semi-gnus と同時にインストールされます。そうでない場合は load-path の +通ったディレクトリに gnus-offline.el と gnus-ofsetup.el を(バイトコン +パイルして)置きます。 + +3) 使い方 + +・Semi-gnus の一般的な使用方法について info などで調べて設定してください。 + +・以下のコードを .emacs に加えます。 + + (load "gnus-ofsetup") + (gnus-setup-for-offline) + (load gnus-offline-setting-file) + +・以下のコードを .gnus に加えます。 + + (gnus-agentize) + +・Emacs を再起動します。すると、gnus-ofsetup.el が起動しますので、対話的 +に必要な変数の設定を行います。(何を入力したらいいかわからない場合は 4) +を参照するか、TAB で入力可能な候補を一覧表示させるかしてください)すべて +設定するとホームディレクトリに .gnus-offline.el というファイルが出来上が +ります。 + +・このあと一旦オンラインでサーバーに接続して、購読するグループを決めてく +ださい。(詳しい方法は Gnus の info を見てください) + +・.gnus に以下のコードを加えます。 + +(gnus-agent-toggle-plugged nil) + +これで Gnus を再起動すればグループバッファで“g”とタイプすることにより +前記の動作をするはずです。 + + +◆また、同梱の pop3-fma.el を用いると複数のメイルアカウントを管理するこ +とが出来ます。 + +・pop3-fma-spool-file-alist +    '( + ("po:アカウント1@popサーバ1" pass) + ("po:アカウント2@popサーバ2" pass) + : + : + )) +・pop3-fma-movemail-type + メイル受信に movemail.exe を使う('exe)か pop3.el('lisp) を使うか。 + + +4) gnus-offline で設定可能な変数一覧 + +・gnus-offline-dialup-program + ダイアルアップするプログラム名 + +・gnus-offline-dialup-program-arguments + ダイアルアッププログラムの引数のリスト + 例えば、gnus-offline-dialup-program に "-s AAA" を渡す場合は + (setq gnus-offline-dialup-program-arguments '("-s" "AAA")) + と記述してください。 + +・gnus-offline-hangup-program + 回線を切断するプログラム名 + +・gnus-offline-hangup-program-arguments + 切断するプログラムの引数のリスト + 例えば、gnus-offline-hangup-program に "-s AAA" を渡す場合は + (setq gnus-offline-hangup-program-arguments '("-s" "AAA")) + と記述してください。 + +・gnus-offline-mail-spool-directory + 送信メールのスプールディレクトリ + Offline 状態で Mail を送信すると一旦ここで指定したディレクトリに保存され + ます。 + MIEE を使用する場合以外無効です。 + +・gnus-offline-news-spool-directory + 送信ニュースのスプールディレクトリ + Offline 状態で News を送信すると一旦ここで指定したディレクトリに保存され + ます。 + MIEE を使用する場合以外無効です。 + +・gnus-offline-mail-treat-environ + Mail の送信を Online/Offline で行う事を切り替える + +・gnus-offline-articles-to-fetch + fetch する記事を切り替える both->mail->news->both... + 'both ... Mail/News を両方受信 + 'Mail ... Mail だけ受信 + 'News ... News だけ受信 + デフォルト値は 'both です。 + +・gnus-offline-popup-menu + メニューを使うかどうかを指定します。デフォルトは "t" です。 + +・gnus-offline-load-hook + gnus-offline が load されるときに評価される hook + +・gnus-offline-before-online-hook + Online job 直前に評価される hook + +・gnus-offline-after-online-hook + Online job 終了直前に評価される hook + +・gnus-offline-interval-time + Online job を行う間隔(分) + Emacs が idle 状態になってからここで指定した時間毎に Online 状態にし + Mail/News を取得します。 + +・gnus-offline-MTA-type + Message を Online 時に送信するプログラムのタイプで、デフォルトは 'smtp + です。 + 'smtp ... smtp.el を使用 + 'sendmail ... sendmail.el を使用 + +・gnus-offline-drafts-queue-type + 送信メッセージをキューに溜めるもののタイプで、デフォルトは 'miee です。 + 'miee は miee.el を使用. + 'agent は gnus-agent.el を使用. + +・gnus-offline-after-empting-spool-hook + 送信メッセージのキューを空にする前に評価される hook + +・gnus-offline-before-empting-spool-hook + 送信メッセージを送信後に、空になった後評価される hook + +・gnus-offline-dialup-function + 接続に使用する関数名 + +・gnus-offline-hangup-function + 切断に使用する関数名 + +・gnus-offline-pop-password-file + ユーザー名、メールサーバー、パスワードを保存するためのファイル名 + +・gnus-offline-pop-password-decoding-function + パスワードを保存する際の暗号化を行うための関数。 + +5) gnus-offline M-x で実行可能なコマンド一覧 + +・M-x gnus-offline-toggle-plugged + offline 状態/Online 状態を切替えます。 + +・M-x gnus-offline-toggle-auto-hangup + offline 状態にします。 + +・M-x gnus-offline-toggle-on/off-send-mail + Online 状態/Offline 状態での Mail 送信状態を切替えます。 + Online 状態では直接送信しますが、Offline 状態では一旦 spool に書き込み、 + "g" を押した時に全部送信されます。 + +・M-x gnus-offline-toggle-articles-to-fetch + 取得する記事を選択します。both -> mail -> news -> both ... のように + 切り替わります。 + +・M-x gnus-offline-toggle-movemail-program + movemail プログラムを切替えます。 + +・M-x gnus-offline-set-interval-time + 記事/Mail の取得、送信を自動的に行う間隔(分)を設定します。 + この間隔は Emacs が Idle になってからの時間です。 + +・M-x gnus-offline-agent-expire + 既読の記事を expire します。 + +6)【!!!重要!!!】 pop パスワードの管理方法について + +デフォルトでは pop サーバのパスワードは pop サーバーにアクセスする度に入 +力する必要があります。(基本的にこのままにしておくことを推奨します) + +しかし、「これだと面倒だしどうせ自分一人しか使わないコンピュータだからそ +れほどパスワードの管理には注意を払う必要がない」という場合にはいくつかの +(手間を省く)方法があります。ただし、当然パスワードを盗まれる危険は増しま +すので以下の方法のいずれかを実行する際には 100% 自己の責任のもとで行って +ください。 + + +まず、パスワードをファイルに残しては置きたくないがメモリ上に変数として残っ +ていても構わない、という場合は、~/.gnus-offline.el に以下のようなコード +を加えてください。 + +(setq pop3-fma-save-password-information t) + +こうすることにより、パスワードは Gnus 起動時に入力するだけになります。 + +また、ファイルに残しても構わないがメモリ上の変数として残したくない場合、 +または全くパスワードの入力を省きたい場合は、.gnus-offline.el に以下のよ +うなコードを加え、パスワードファイルを指定します。 + +(setq gnus-offline-pop-password-file "~/.pop.passwd") + +指定したパスワードファイル(この例では~/.pop.passwd)を作成し、パスワード +の情報を以下のような形式で書きます。 + + (setq pop3-fma-password + '(("SERVER1" "ACCOUNT1" "PASSWORD1") + ("SERVER2" "ACCOUNT2" "PASSWORD2") + ............................ + )) + +このファイルをうっかり開いてしまってもパスワードが見えないように、 +base64 でエンコードすることをお勧めします。その為には + + M-: (base64-encode-region (point-min) (point-max)) + +のようにします(M-: は通常 eval-expression に割りあてられています)。 +もしここでエンコードしなかったならば、~/.gnus-offline.el に + + (setq gnus-offline-pop-password-decoding-function nil) + +と書きます。(ただしこれは非常に危険です。) + ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index 3ff6494..5ca0e78 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -698,16 +698,20 @@ If FULL-HEADERS (the prefix), include full headers when forwarding." (interactive "P") (let ((subject "Digested Articles") (articles (gnus-summary-work-articles n)) - article) + article frame) (gnus-setup-message 'forward (gnus-summary-select-article) (if post (message-news nil subject) (message-mail nil subject)) + (when (and message-use-multi-frames (cdr articles)) + (setq frame (window-frame (get-buffer-window (current-buffer))))) (message-goto-body) (while (setq article (pop articles)) (save-window-excursion (set-buffer gnus-summary-buffer) (gnus-summary-select-article nil nil nil article) (gnus-summary-remove-process-mark article)) + (when frame + (select-frame frame)) (insert (mime-make-tag "message" "rfc822") "\n") (insert-buffer-substring gnus-original-article-buffer)) (push-mark) diff --git a/lisp/gnus-offline.el b/lisp/gnus-offline.el index d43b850..b573c30 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.6.1 1999-01-18 10:29:35 keiichi Exp $ +;;; $Id: gnus-offline.el,v 1.1.6.2 1999-02-05 02:59:06 keiichi 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,6 +59,27 @@ ;;; In Gnus group buffer , type g to get all news and mail. ;;; Then send mail and news in spool directory. ;;; +;;; 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. +;;; If you decide to use it, then write in .emacs or .gnus-offline.el +;;; something like: +;;; +;;; (setq gnus-offline-pop-password-file "~/.pop.passwd") +;;; +;;; and write in this file something like: +;;; +;;; (setq pop3-fma-password +;;; '(("SERVER1" "ACCOUNT1" "PASSWORD1") +;;; ("SERVER2" "ACCOUNT2" "PASSWORD2") +;;; ............................ +;;; )) +;;; +;;; If you want to encode the file with base64, try: +;;; +;;; M-: (base64-encode-region (point-min) (point-max)) +;;; ;;; Variables. ;;; gnus-offline-dialup-program-arguments ;;; ... List of dialup program arguments. @@ -74,6 +95,9 @@ ;;; (minutes) ;;; gnus-offline-dialup-function ... Function to diualup. ;;; gnus-offline-hangup-function ... Function to hangup. +;;; gnus-offline-pop-password-file ... File to keep the POP password info. +;;; gnus-offline-pop-password-decoding-function +;;; ... Function to decode the password info. ;;; Code: @@ -81,7 +105,6 @@ (require 'cl) (require 'custom) -(require 'pop3-fma) (require 'easymenu) (unless (and (condition-case () @@ -100,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" ) @@ -189,6 +213,23 @@ If set to 0 , timer call is disabled." :group 'gnus-offline :type 'function) +(defcustom gnus-offline-pop-password-file nil + "*File name for saving one's POP password information. +This variable should be nil if there's some possibility that +your passwords be stolen." + :group 'gnus-offline + :type '(choice (file :tag "File") + (const nil))) + +(defcustom gnus-offline-pop-password-decoding-function + (function (lambda () (base64-decode-region (point-min) (point-max)))) + "*Function for decoding one's password information. +The value has no effect when `gnus-offline-pop-password-file' +is nil. +This variable might be nil if you don't need to encode your passwords." + :group 'gnus-offline + :type 'function) + ;;; Internal variables. (defvar gnus-offline-connected nil "*If value is t , dialup line is connected status. @@ -212,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) @@ -340,7 +384,26 @@ 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) - (gnus-group-get-new-news arg)) + (if (null gnus-offline-pop-password-file) + (gnus-group-get-new-news arg) + (let ((buffer (get-buffer-create "*offline-temp*"))) + (unwind-protect + (progn + (if (boundp 'pop3-fma-password) + (setq pop3-fma-save-password-information t)) + (save-excursion + (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)) + (if (boundp 'pop3-fma-password) + (setq pop3-fma-password nil + pop3-fma-save-password-information nil) + (setq mail-source-password-cache nil)) + (kill-buffer buffer))))) ;; ;; dialup... @@ -477,13 +540,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 (featurep 'running-pterodactyl-gnus-0_73-or-later)) + (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 ;; @@ -727,7 +793,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 (featurep 'running-pterodactyl-gnus-0_73-or-later)) + (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) @@ -778,7 +845,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 (featurep 'running-pterodactyl-gnus-0_73-or-later))] ["取得記事種類の変更" gnus-offline-toggle-articles-to-fetch t] ["Mail 送信方法(On/Off)の切替え" gnus-offline-toggle-on/off-send-mail t] ["自動切断の切替え" gnus-offline-toggle-auto-hangup t] @@ -799,7 +867,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 (featurep 'running-pterodactyl-gnus-0_73-or-later))] ["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] @@ -822,7 +891,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 (featurep 'running-pterodactyl-gnus-0_73-or-later))] ["取得記事種類の変更" gnus-offline-toggle-articles-to-fetch t] ["Mail 送信方法(On/Off)の切替え" gnus-offline-toggle-on/off-send-mail t] ["自動切断の切替え" gnus-offline-toggle-auto-hangup t] @@ -832,7 +902,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 (featurep 'running-pterodactyl-gnus-0_73-or-later))] ["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 a711a88..a183c1a 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.6.1 1999-01-18 10:29:36 keiichi Exp $ +;;; $Id: gnus-ofsetup.el,v 1.1.6.2 1999-02-05 02:59:08 keiichi 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,42 +173,85 @@ ;; 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) + (let ((user (read-from-minibuffer "Mail Account name : ")) + (server (read-from-minibuffer "Mail server : ")) + (auth (completing-read + "Authentification Method (TAB to completion): " + '(("pop" 1) ("apop" 2)) nil t nil)) + (islisp (y-or-n-p "Do you use pop3.el to fetch mail? "))) + (if (not islisp) + (let ((prog (read-file-name "movemail program name: " + exec-directory "movemail")) + (args (read-from-minibuffer "movemail options: " "-pf"))) + (setq mail-source + (append mail-source + (list + (list + auth + :user user + :server server + :program prog + :args (format "%s %s" args + (concat "po:" user))))))) + (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))) + + (setq save-passwd + (y-or-n-p "Do you save password information to newsrc file? ")) ;; Write to setting file. (setq tmp-buffer (get-buffer-create "* Setting")) @@ -283,7 +327,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 +339,36 @@ (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 save-passwd + (insert "(add-hook 'gnus-setup-news-hook \n (lambda ()\n (add-to-list 'gnus-variable-list 'pop3-fma-password)))\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-setup-news-hook 'read-pw-set-mail-source-passwd-cache)\n") + (if save-passwd + (insert "(add-hook 'gnus-setup-news-hook \n (lambda ()\n (add-to-list 'gnus-variable-list 'mail-source-password-cache)))\n")) + ) (write-region (point-min) (point-max) gnus-offline-setting-file) (kill-buffer "* Setting")) ) diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index 9a5aa09..e2e30d8 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -1632,30 +1632,30 @@ newsgroup." (defun gnus-read-active-file (&optional force not-native) (gnus-group-set-mode-line) (let ((methods - (append - (if (and (not not-native) - (gnus-check-server gnus-select-method)) - ;; The native server is available. - (cons gnus-select-method gnus-secondary-select-methods) - ;; The native server is down, so we just do the - ;; secondary ones. - gnus-secondary-select-methods) - ;; Also read from the archive server. - (when (gnus-archive-server-wanted-p) - (list "archive")))) - list-type) + (mapcar + (lambda (m) (if (stringp m) (gnus-server-get-method nil m) m)) + (append + (if (and (not not-native) + (gnus-check-server gnus-select-method)) + ;; The native server is available. + (cons gnus-select-method gnus-secondary-select-methods) + ;; The native server is down, so we just do the + ;; secondary ones. + gnus-secondary-select-methods) + ;; Also read from the archive server. + (when (gnus-archive-server-wanted-p) + (list "archive"))))) + method where mesg list-type) (setq gnus-have-read-active-file nil) (save-excursion (set-buffer nntp-server-buffer) - (while methods - (let* ((method (if (stringp (car methods)) - (gnus-server-get-method nil (car methods)) - (car methods))) - (where (nth 1 method)) - (mesg (format "Reading active file%s via %s..." + (while (setq method (pop methods)) + (unless (member method methods) + (setq where (nth 1 method) + mesg (format "Reading active file%s via %s..." (if (and where (not (zerop (length where)))) (concat " from " where) "") - (car method)))) + (car method))) (gnus-message 5 mesg) (when (gnus-check-server method) ;; Request that the backend scan its incoming messages. @@ -1702,9 +1702,7 @@ newsgroup." (gnus-active-to-gnus-format method gnus-active-hashtb nil t) ;; We mark this active file as read. (push method gnus-have-read-active-file) - (gnus-message 5 "%sdone" mesg)))))) - (setq methods (cdr methods)))))) - + (gnus-message 5 "%sdone" mesg)))))))))) (defun gnus-ignored-newsgroups-has-to-p () "Non-nil iff gnus-ignored-newsgroups includes \"^to\\\\.\" as an element." diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index b2b0fe6..82f93d2 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -1,5 +1,5 @@ ;;; gnus-sum.el --- summary mode commands for Semi-gnus -;; Copyright (C) 1996,97,98 Free Software Foundation, Inc. +;; Copyright (C) 1996,97,98,99 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; MORIOKA Tomohiko @@ -3454,11 +3454,11 @@ If LINE, insert the rebuilt thread starting on line LINE." (defsubst gnus-article-sort-by-author (h1 h2) "Sort articles by root author." (string-lessp - (let ((addr (mime-read-field 'From h1))) + (let ((addr (car (mime-read-field 'From h1)))) (or (std11-full-name-string addr) (std11-address-string addr) "")) - (let ((addr (mime-read-field 'From h2))) + (let ((addr (car (mime-read-field 'From h2)))) (or (std11-full-name-string addr) (std11-address-string addr) "")) diff --git a/lisp/nnheader.el b/lisp/nnheader.el index 4249394..7f1e947 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -1,5 +1,5 @@ ;;; nnheader.el --- header access macros for Semi-gnus and its backends -;; Copyright (C) 1987,88,89,90,93,94,95,96,97,98 Free Software Foundation, Inc. +;; Copyright (C) 1987-1990,1993-1999 Free Software Foundation, Inc. ;; Author: Masanobu UMEDA ;; Lars Magne Ingebrigtsen @@ -52,7 +52,7 @@ (defvar nnheader-file-name-translation-alist nil "*Alist that says how to translate characters in file names. -For instance, if \":\" is illegal as a file character in file names +For instance, if \":\" is invalid as a file character in file names on your system, you could say something like: \(setq nnheader-file-name-translation-alist '((?: . ?_)))") @@ -277,7 +277,8 @@ on your system, you could say something like: 0 (let ((num (ignore-errors (read (current-buffer))))) (if (numberp num) num 0))) - (or (eobp) (forward-char 1)))) + (unless (eobp) + (search-forward "\t" eol 'move)))) (defun nnheader-parse-nov () (let ((eol (gnus-point-at-eol))) @@ -457,7 +458,8 @@ the line could be found." (defun nnheader-insert-references (references message-id) "Insert a References header based on REFERENCES and MESSAGE-ID." (if (and (not references) (not message-id)) - () ; This is illegal, but not all articles have Message-IDs. + ; This is invalid, but not all articles have Message-IDs. + () (mail-position-on-field "References") (let ((begin (save-excursion (beginning-of-line) (point))) (fill-column 78) diff --git a/lisp/smiley.el b/lisp/smiley.el index 87ea5e0..65dc913 100644 --- a/lisp/smiley.el +++ b/lisp/smiley.el @@ -255,8 +255,13 @@ above them." (while (re-search-forward regexp nd t) (let* ((start (match-beginning group)) (end (match-end group)) - (glyph (smiley-create-glyph (buffer-substring start end) - file))) + (glyph + (and (or (eq start 1) + (not (string-match "\\(\\^\\|;\\|_\\);)" + (buffer-substring + (1- start) (+ start 2))))) + (smiley-create-glyph (buffer-substring start end) + file)))) (when glyph (mapcar 'delete-annotation (annotations-at end)) (let ((ext (make-extent start end)) -- 1.7.10.4