From: yamaoka Date: Wed, 28 Jun 2000 23:40:24 +0000 (+0000) Subject: Sync. X-Git-Tag: t-gnus-6_14-quimby-before-AC-changed-~13 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0978938b127bb08a5d727ed1a64245c530ff17e0;p=elisp%2Fgnus.git- Sync. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e19b72c..d64eee9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,20 @@ +2000-06-28 13:52:57 Shenghuo ZHU + + * lpath.el: Fbind image-size. + +2000-06-28 Simon Josefsson + + * nnimap.el (nnimap-split-rule): Update doc with extended syntax. + (nnimap-assoc-match): New function. + (nnimap-split-find-rule): Support extended syntax. + +2000-06-28 Simon Josefsson + + * nnimap.el (nnimap-open-connection): Use port stuff. + + * gnus-util.el (gnus-netrc-machine): Add defaultport parameter, + document port and defaultport. + 2000-06-27 Paul Stodghill * gnus-agent.el (gnus-agent-synchronize): Kill flags buffer. diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index ad55a7b..5b70701 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -908,8 +908,10 @@ ARG is passed to the first function." (forward-line 1)) (nreverse result))))) -(defun gnus-netrc-machine (list machine &optional port) - "Return the netrc values from LIST for MACHINE or for the default entry." +(defun gnus-netrc-machine (list machine &optional port defaultport) + "Return the netrc values from LIST for MACHINE or for the default entry. +If PORT specified, only return entries with matching port tokens. +Entries without port tokens default to DEFAULTPORT." (let ((rest list) result) (while list @@ -925,9 +927,9 @@ ARG is passed to the first function." (when result (setq result (nreverse result)) (while (and result - (not (equal (or port "nntp") + (not (equal (or port defaultport "nntp") (or (gnus-netrc-get (car result) "port") - "nntp")))) + defaultport "nntp")))) (pop result)) (car result)))) diff --git a/lisp/lpath.el b/lisp/lpath.el index 5287845..54b35f1 100644 --- a/lisp/lpath.el +++ b/lisp/lpath.el @@ -49,7 +49,7 @@ find-coding-systems-for-charsets sc-cite-regexp vcard-pretty-print image-type-available-p put-image create-image display-graphic-p - find-image insert-image + find-image insert-image image-size make-overlay overlay-put make-symbolic-link)) (maybe-bind '(global-face-data mark-active transient-mark-mode mouse-selection-click-count @@ -103,7 +103,7 @@ url-generic-parse-url valid-image-instantiator-format-p babel-fetch babel-wash sc-cite-regexp put-image create-image display-graphic-p - find-image insert-image + find-image insert-image image-size vcard-pretty-print image-type-available-p coding-system-get find-coding-system find-coding-systems-for-charsets find-coding-systems-region diff --git a/lisp/nnimap.el b/lisp/nnimap.el index a66d9d3..669e9f3 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -112,10 +112,6 @@ element in each \"rule\" is the name of the IMAP mailbox, and the second is a regexp that nnimap will try to match on the header to find a fit. -The first element can also be a list. In that case, the first element -is the server the second element is the group on that server in which -the matching article will be stored. - The second element can also be a function. In that case, it will be called narrowed to the headers with the first element of the rule as the argument. It should return a non-nil value if it thinks that the @@ -123,7 +119,25 @@ mail belongs in that group. This variable can also have a function as its value, the function will be called with the headers narrowed and should return a group where it -thinks the article should be splitted to.") +thinks the article should be splitted to. See `nnimap-split-fancy'. + +To allow for different split rules on different virtual servers, and +even different split rules in different inboxes on the same server, +the syntax of this variable have been extended along the lines of: + +(setq nnimap-split-rule + '((\"my1server\" (\".*\" ((\"ding\" \"ding@gnus.org\") + (\"junk\" \"From:.*Simon\"))) + (\"my2server\" (\"INBOX\" nnimap-split-fancy)) + (\"my[34]server\" (\".*\" ((\"private\" \"To:.*Simon\") + (\"junk\" my-junk-func))))) + +The virtual server name is in fact a regexp, so that the same rules +may apply to several servers. In the example, the servers +\"my3server\" and \"my4server\" both use the same rules. Similarly, +the inbox string is also a regexp. The actual splitting rules are as +before, either a function, or a list with group/regexp or +group/function elements.") (defvar nnimap-split-predicate "UNSEEN UNDELETED" "The predicate used to find articles to split. @@ -525,15 +539,14 @@ If EXAMINE is non-nil the group is selected read-only." (imap-capability 'IMAP4rev1 nnimap-server-buffer)) (imap-close nnimap-server-buffer) (nnheader-report 'nnimap "Server %s is not IMAP4 compliant" server)) - (let (list alist user passwd) - (and (fboundp 'gnus-parse-netrc) - (setq list (gnus-parse-netrc nnimap-authinfo-file) - alist (or (and (gnus-netrc-get - (gnus-netrc-machine list server) "machine") - (gnus-netrc-machine list server)) - (gnus-netrc-machine list nnimap-address)) - user (gnus-netrc-get alist "login") - passwd (gnus-netrc-get alist "password"))) + (let* ((list (gnus-parse-netrc nnimap-authinfo-file)) + (port (if nnimap-server-port + (int-to-string nnimap-server-port) + "imap")) + (alist (or (gnus-netrc-machine list server port "imap") + (gnus-netrc-machine list nnimap-address port "imap"))) + (user (gnus-netrc-get alist "login")) + (passwd (gnus-netrc-get alist "password"))) (if (imap-authenticate user passwd nnimap-server-buffer) (prog1 (push (list server nnimap-server-buffer) @@ -904,8 +917,19 @@ function is generally only called when Gnus is shutting down." (or nnimap-split-crosspost (throw 'split-done to-groups)))))))))) +(defun nnimap-assoc-match (key alist) + (let (element) + (while (and alist (not element)) + (if (string-match (car (car alist)) key) + (setq element (car alist))) + (setq alist (cdr alist))) + element)) + (defun nnimap-split-find-rule (server inbox) - nnimap-split-rule) + (if (listp (cadar nnimap-split-rule)) ;; extended format? + (cadr (nnimap-assoc-match inbox (cdr (nnimap-assoc-match + server nnimap-split-rule)))) + nnimap-split-rule)) (defun nnimap-split-find-inbox (server) (if (listp nnimap-split-inbox) diff --git a/texi/ChangeLog b/texi/ChangeLog index df8b792..b8ab0ea 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,7 @@ +2000-06-28 Simon Josefsson + + * gnus.texi (Splitting in IMAP): Update. + 2000-05-19 15:18:32 Dmitry Yaitskov * message.texi (Reply): Doc fix. diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index e5ce536..2de4fb3 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -13272,8 +13272,30 @@ Nnmail の利用者は最後の正規表現は全ての記事に合致するように空でなくては 使用可能になっていないかぎり、最初に合致した規則が "勝ち" ます。相互投稿 をしている場合は、全ての合致した規則が "勝ち" ます。 +この変数はその値として関数を持つこともできます。その関数は記事のヘッダの +部分に範囲が狭められた状態で呼ばれ、記事の移動先だと思うグループを返すも +のでなければなりません。@code{nnimap-split-fancy} を参照して下さい。 + 分割コードは必要ならメールボックスを作成します。 +異なる仮想サーバー毎に違う分割の規則を使ったり、それどころか同じサーバー +の異なる inbox 毎に違う分割の規則を使うことができるようにするために、こ +の変数の構文は以下のように拡張されています。 + +@lisp +(setq nnimap-split-rule + '(("my1server" (".*" (("ding" "ding@@gnus.org") + ("junk" "From:.*Simon"))) + ("my2server" ("INBOX" nnimap-split-fancy)) + ("my[34]server" (".*" (("private" "To:.*Simon") + ("junk" my-junk-func))))) +@end lisp + +仮想サーバー名は実際には正規表現なので、同じ規則をいくつかのサーバーに適 +用できるでしょう。この例ではサーバー @code{my3server} と @code{my4server} +が同じ規則を使います。同様に inbox 文字列も正規表現です。上記の分割の規 +則の実例は、関数、またはグループの正規表現かグループの関数、の両方です。 + Nnmail で対応するもの: @code{nnmail-split-methods}. @item nnimap-split-predicate diff --git a/texi/gnus.texi b/texi/gnus.texi index 2514f9a..6b7915a 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -13690,10 +13690,30 @@ crossposting enabled. In that case, all matching rules will "win". This variable can also have a function as its value, the function will be called with the headers narrowed and should return a group where it -thinks the article should be splitted to. +thinks the article should be splitted to. See @code{nnimap-split-fancy}. The splitting code tries to create mailboxes if it need too. +To allow for different split rules on different virtual servers, and +even different split rules in different inboxes on the same server, +the syntax of this variable have been extended along the lines of: + +@lisp +(setq nnimap-split-rule + '(("my1server" (".*" (("ding" "ding@@gnus.org") + ("junk" "From:.*Simon"))) + ("my2server" ("INBOX" nnimap-split-fancy)) + ("my[34]server" (".*" (("private" "To:.*Simon") + ("junk" my-junk-func))))) +@end lisp + +The virtual server name is in fact a regexp, so that the same rules +may apply to several servers. In the example, the servers +@code{my3server} and @code{my4server} both use the same rules. +Similarly, the inbox string is also a regexp. The actual splitting +rules are as before, either a function, or a list with group/regexp or +group/function elements. + Nnmail equivalent: @code{nnmail-split-methods}. @item nnimap-split-predicate