From: yamaoka Date: Sun, 21 Sep 2003 04:00:51 +0000 (+0000) Subject: Synch to Gnus 200309210058. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=808f8e2fda07ab2cd9642652a1f617080fdcb238;p=elisp%2Fgnus.git- Synch to Gnus 200309210058. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1215807..ec12146 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,8 +1,13 @@ +2003-09-20 Jesper Harder + + * rfc2047.el (rfc2047-encode): Limit line length to 76 characters. + 2003-09-20 Simon Josefsson - * imap.el (imap-starttls-open): Erase buffer and disable process - filter before invoking STARTTLS negotiation, to support new - starttls.el that uses GNUTLS. + * tls.el (tls-process-connection-type): Doc fix. + + * imap.el (imap-starttls-open): Rewrite, should support both old + starttls.el and new starttls.el that uses GNUTLS. 2003-09-18 Katsumi Yamaoka diff --git a/lisp/imap.el b/lisp/imap.el index 6b856bb..08983a0 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -738,38 +738,36 @@ sure of changing the value of `foo'." (let* ((port (or port imap-default-port)) (process (as-binary-process (starttls-open-stream name buffer server port))) - done) + done tls-info) (message "imap: Connecting with STARTTLS...") (when process (while (and (memq (process-status process) '(open run)) (set-buffer buffer) ;; XXX "blue moon" nntp.el bug - (goto-char (point-min)) + (goto-char (point-max)) + (forward-line -1) (not (imap-parse-greeting))) (accept-process-output process 1) (sit-for 1)) + (imap-send-command "STARTTLS") + (while (and (memq (process-status process) '(open run)) + (set-buffer buffer) ;; XXX "blue moon" nntp.el bug + (goto-char (point-max)) + (forward-line -1) + (not (re-search-forward "[0-9]+ OK.*\r?\n" nil t))) + (accept-process-output process 1) + (sit-for 1)) (and imap-log (with-current-buffer (get-buffer-create imap-log-buffer) (buffer-disable-undo) (goto-char (point-max)) (insert-buffer-substring buffer))) - (let ((imap-process process)) - (unwind-protect - (progn - (set-process-filter imap-process 'imap-arrival-filter) - (erase-buffer) - (when (and (eq imap-stream 'starttls) - (imap-ok-p (imap-send-command-wait "STARTTLS"))) - (set-process-filter imap-process nil) - (starttls-negotiate imap-process))) - (set-process-filter imap-process nil))) - (when (memq (process-status process) '(open run)) + (when (and (setq tls-info (starttls-negotiate process)) + (memq (process-status process) '(open run))) (setq done process))) - (if done - (progn - (message "imap: Connecting with STARTTLS...done") - done) - (message "imap: Connecting with STARTTLS...failed") - nil))) + (if (stringp tls-info) + (message "imap: STARTTLS info: %s" tls-info)) + (message "imap: Connecting with STARTTLS...%s" (if done "done" "failed")) + done)) ;; Server functions; authenticator stuff: diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index b709c4e..02e7943 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -418,6 +418,9 @@ By default, the region is treated as containing addresses (see ((big5 gb2312 euc-kr) 2) (utf-8 4) (t 8))) + (pre (- b (save-restriction + (widen) + (rfc2047-point-at-bol)))) ;; encoded-words must not be longer than 75 characters, ;; including charset, encoding etc. This leaves us with ;; 75 - (length start) - 2 - 2 characters. The last 2 is for @@ -425,6 +428,9 @@ By default, the region is treated as containing addresses (see ;; each character expands to 8 bytes which is expanded by a ;; factor of 4/3 by base64 encoding. (length (floor (- 75 (length start) 4) (* factor (/ 4.0 3.0)))) + ;; Limit line length to 76 characters. + (length1 (max 1 (floor (- 76 (length start) 4 pre) + (* factor (/ 4.0 3.0))))) (first t)) (if mime-charset (save-restriction @@ -433,9 +439,14 @@ By default, the region is treated as containing addresses (see ;; break into lines before encoding (goto-char (point-min)) (while (not (eobp)) - (goto-char (min (point-max) (+ length (point)))) + (if first + (progn + (goto-char (min (point-max) (+ length1 (point)))) + (setq first nil)) + (goto-char (min (point-max) (+ length (point))))) (unless (eobp) - (insert ?\n)))) + (insert ?\n))) + (setq first t)) (if (and (mm-multibyte-p) (mm-coding-system-p cs)) (mm-encode-coding-region (point-min) (point-max) cs)) diff --git a/lisp/tls.el b/lisp/tls.el index a2cced9..9c5466f 100644 --- a/lisp/tls.el +++ b/lisp/tls.el @@ -68,7 +68,7 @@ after successful negotiation." :group 'tls) (defcustom tls-process-connection-type nil - "*Value for `process-connection-type' to use when starting process." + "*Value for `process-connection-type' to use when starting TLS process." :type 'boolean :group 'tls) diff --git a/texi/ChangeLog b/texi/ChangeLog index 32d9691..20f3c9b 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,9 @@ +2003-09-20 Jesper Harder + + * gnus.texi (Fancy Mail Splitting): Make split-on-body work for + respooling. Suggested by Harald Maier . + (Fancy Mail Splitting): Reformat. + 2003-09-15 Jesper Harder * gnus.texi (Posting Styles): Fix typo. @itemize attribute names. diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index b318094..7f4d26b 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -13119,16 +13119,15 @@ UNDELETED} はおそらくたいていの人には最良の選択でしょうが、ときど @end lisp この変数は @dfn{分割} の様式になっています。分割は (あるいは) それぞれの -分割が他の分割を含む再帰的構造です。これは使用可能な五つの分割構文です: +分割が他の分割を含む再帰的構造です。これは使用可能な分割構文です: -@enumerate +@table @code -@item -@samp{group}: もし分割が文字列であると、それはグループ名としてみなされま -す。普通の正規表現の合致がなされます。例は下の方を見て下さい。 +@item group +もし分割が文字列であると、それはグループ名としてみなされます。普通の正規 +表現の合致がなされます。例は下の方を見て下さい。 -@item -@code{(@var{field} @var{value} @code{[-} @var{restrict} @code{[@dots{}]}@code{]} @var{split})}: +@item (@var{field} @var{value} [- @var{restrict} [@dots{}] ] @var{split}) もし分割がリストで、最初の要素が文字列であり、ヘッダー @var{field} (正規 表現) が @var{value} (これも正規表現) を含んでいる場合、メッセージ を @var{split} で指定されたところに蓄積します。@var{restrict} (また他の @@ -13136,24 +13135,24 @@ UNDELETED} はおそらくたいていの人には最良の選択でしょうが、ときど かの文字列に合致したら、@var{split} は無視されます。@var{restrict} の閉 包のどれもが合致しなければ @var{split} が実行されます。 -@item -@code{(| @var{split}@dots{})}: 分割がリストで、最初の要素 -が @code{|} (垂直棒) であると、それぞれの @var{split} をそのうちの一つが -合致するまで実行します。@var{split} はメールメッセージが一つ以上のグルー -プに蓄積されたときに ``合致した'' とします。 +@item (| @var{split} @dots{}) +分割がリストで、最初の要素が @code{|} (垂直棒) であると、それぞれ +の @var{split} をそのうちの一つが合致するまで実行します。@var{split} は +メールメッセージが一つ以上のグループに蓄積されたときに ``合致した'' とし +ます。 -@item -@code{(& @var{split}@dots{})}: 分割がリストで、最初の要素が @code{&} で -あると、リストの全ての @var{split} (複数) を実行します。 +@item (& @var{split} @dots{}) +分割がリストで、最初の要素が @code{&} であると、リストの全て +の @var{split} (複数) を実行します。 -@item -@code{junk}: もし分割がシンボル @code{junk} であると、そのメッセージを保 -存しません (すなわち、消去してしまいます)。非常に注意して使って下さい。 +@item junk +もし分割がシンボル @code{junk} であると、そのメッセージを保存しませ +ん (すなわち、消去してしまいます)。非常に注意して使って下さい。 -@item -@code{(: @var{function} @var{arg1} @var{arg2} @dots{})}: もし分割がリス -トで、最初の要素が @code{:} であると、二番目の要素が @var{args} を引数と -して関数として呼ばれます。関数は @var{split} を返すべきです。 +@item (: @var{function} @var{arg1} @var{arg2} @dots{}) +もし分割がリストで、最初の要素が @code{:} であると、二番目の要素 +が @var{args} を引数として関数として呼ばれます。関数は @var{split} を返 +すべきです。 @cindex body split 例えば以下の関数は、記事のボディに基づいた分割に使えるでしょう: @@ -13161,25 +13160,26 @@ UNDELETED} はおそらくたいていの人には最良の選択でしょうが、ときど @lisp (defun split-on-body () (save-excursion - (set-buffer " *nnmail incoming*") + (set-buffer + (or (get-buffer " *nnmail incoming*") + (get-buffer " *nnml move*"))) (goto-char (point-min)) (when (re-search-forward "Some.*string" nil t) "string.group"))) @end lisp -@code{:} が使われるとき、バッファ @samp{" *nnmail incoming*"} はメッセー -ジの部分に狭められます。 +@var{function} が走らされるとき、バッファはメッセージの部分に狭められま +す。 -@item -@code{(! @var{func} @var{split})}: 分割がリストで、最初の要素 -が @code{!} であると @var{split} が実行され、 +@item (! @var{func} @var{split}) +分割がリストで、最初の要素が @code{!} であると @var{split} が実行され、 @var{func} は @var{split} の結果を引数として呼ばれます。@var{func} は分 割を返すべきです。 -@item -@code{nil}: もし分割が @code{nil} であれば、それは無視されます。 +@item nil +もし分割が @code{nil} であれば、それは無視されます。 -@end enumerate +@end table これらの分割で、@var{fileld} は完全なフィールド名に合致しなければなりま せん。@var{value} は基礎モード (fundamental mode) 構文テーブル (syntax @@ -13190,9 +13190,9 @@ table) に従って完全に合致しなければなりません。正規表現でフィールド名か @vindex nnmail-split-abbrev-alist @var{field} と @var{value} は Lisp シンボル (symbol) である事もでき、そ の場合それらは @code{nnmail-split-abbrev-alist} で指定されているように展 -開されます。これはセルの @code{car} がキーを含んでいて、@code{cdr} が関 -連付けられた値を持っているコンスセル (cons cell) の連想リストです。以下 -の項目が、あらかじめ @code{nnmail-split-abbrev-alist} に定義されています: +開されます。これはセルの @sc{car} がキーを含んでいて、@sc{cdr} が関連付 +けられた値を持っているコンスセル (cons cell) の連想リストです。以下の項 +目が、あらかじめ @code{nnmail-split-abbrev-alist} に定義されています: @table @code @item from diff --git a/texi/gnus.texi b/texi/gnus.texi index d51b862..7151b6b 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -13871,46 +13871,42 @@ Let's look at an example value of this variable first: "misc.misc") @end lisp -This variable has the format of a @dfn{split}. A split is a (possibly) -recursive structure where each split may contain other splits. Here are -the five possible split syntaxes: +This variable has the format of a @dfn{split}. A split is a +(possibly) recursive structure where each split may contain other +splits. Here are the possible split syntaxes: -@enumerate - -@item -@samp{group}: If the split is a string, that will be taken as a group -name. Normal regexp match expansion will be done. See below for -examples. - -@item -@code{(@var{field} @var{value} @code{[-} @var{restrict} -@code{[@dots{}]}@code{]} @var{split})}: If the split is a list, the -first element of which is a string, then store the message as -specified by @var{split}, if header @var{field} (a regexp) contains -@var{value} (also a regexp). If @var{restrict} (yet another regexp) -matches some string after @var{field} and before the end of the -matched @var{value}, the @var{split} is ignored. If none of the -@var{restrict} clauses match, @var{split} is processed. - -@item -@code{(| @var{split}@dots{})}: If the split is a list, and the first -element is @code{|} (vertical bar), then process each @var{split} until -one of them matches. A @var{split} is said to match if it will cause -the mail message to be stored in one or more groups. - -@item -@code{(& @var{split}@dots{})}: If the split is a list, and the first -element is @code{&}, then process all @var{split}s in the list. +@table @code -@item -@code{junk}: If the split is the symbol @code{junk}, then don't save -(i.e., delete) this message. Use with extreme caution. - -@item -@code{(: @var{function} @var{arg1} @var{arg2} @dots{})}: If the split is -a list, and the first element is @code{:}, then the second element will -be called as a function with @var{args} given as arguments. The -function should return a @var{split}. +@item group +If the split is a string, that will be taken as a group name. Normal +regexp match expansion will be done. See below for examples. + +@item (@var{field} @var{value} [- @var{restrict} [@dots{}] ] @var{split}) +If the split is a list, the first element of which is a string, then +store the message as specified by @var{split}, if header @var{field} +(a regexp) contains @var{value} (also a regexp). If @var{restrict} +(yet another regexp) matches some string after @var{field} and before +the end of the matched @var{value}, the @var{split} is ignored. If +none of the @var{restrict} clauses match, @var{split} is processed. + +@item (| @var{split} @dots{}) +If the split is a list, and the first element is @code{|} (vertical +bar), then process each @var{split} until one of them matches. A +@var{split} is said to match if it will cause the mail message to be +stored in one or more groups. + +@item (& @var{split} @dots{}) +If the split is a list, and the first element is @code{&}, then +process all @var{split}s in the list. + +@item junk +If the split is the symbol @code{junk}, then don't save (i.e., delete) +this message. Use with extreme caution. + +@item (: @var{function} @var{arg1} @var{arg2} @dots{}) +If the split is a list, and the first element is @samp{:}, then the +second element will be called as a function with @var{args} given as +arguments. The function should return a @var{split}. @cindex body split For instance, the following function could be used to split based on the @@ -13919,25 +13915,27 @@ body of the messages: @lisp (defun split-on-body () (save-excursion - (set-buffer " *nnmail incoming*") + (set-buffer + (or (get-buffer " *nnmail incoming*") + (get-buffer " *nnml move*"))) (goto-char (point-min)) (when (re-search-forward "Some.*string" nil t) "string.group"))) @end lisp -The @samp{" *nnmail incoming*"} is narrowed to the message in question -when the @code{:} function is run. +The buffer is narrowed to the message in question when @var{function} +is run. -@item -@code{(! @var{func} @var{split})}: If the split is a list, and the -first element is @code{!}, then @var{split} will be processed, and -@var{func} will be called as a function with the result of @var{split} -as argument. @var{func} should return a split. +@item (! @var{func} @var{split}) +If the split is a list, and the first element is @code{!}, then +@var{split} will be processed, and @var{func} will be called as a +function with the result of @var{split} as argument. @var{func} +should return a split. -@item -@code{nil}: If the split is @code{nil}, it is ignored. +@item nil +If the split is @code{nil}, it is ignored. -@end enumerate +@end table In these splits, @var{field} must match a complete field name. @var{value} must match a complete word according to the fundamental mode @@ -13949,7 +13947,7 @@ field names or words. In other words, all @var{value}'s are wrapped in @var{field} and @var{value} can also be Lisp symbols, in that case they are expanded as specified by the variable @code{nnmail-split-abbrev-alist}. This is an alist of cons cells, -where the @code{car} of a cell contains the key, and the @code{cdr} +where the @sc{car} of a cell contains the key, and the @sc{cdr} contains the associated value. Predefined entries in @code{nnmail-split-abbrev-alist} include: