From: yamaoka Date: Thu, 14 Oct 2004 22:27:44 +0000 (+0000) Subject: Synch to No Gnus 200410141758. X-Git-Tag: t-gnus-6_17_4-quimby-~713 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=ca20dcfbe645984941fde803c51a8b98fff87c0e;p=elisp%2Fgnus.git- Synch to No Gnus 200410141758. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f3a7ee4..8f61ae1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,16 @@ +2004-10-14 Teodor Zlatanov + + * spam.el (spam-register-routine): move comment + (spam-verify-bogofilter): we use 'unknown for the initial + spam-bogofilter-valid state, not 'never + + * netrc.el (netrc-machine-user-or-password): convenience wrapper + for netrc-machine + + * nnimap.el (nnimap-open-connection): use + netrc-machine-user-or-password + + 2004-10-13 Katsumi Yamaoka * message.el (message-tokenize-header): Fix 2004-09-06 change diff --git a/lisp/netrc.el b/lisp/netrc.el index c3be996..a4ca0f0 100644 --- a/lisp/netrc.el +++ b/lisp/netrc.el @@ -131,6 +131,26 @@ Entries without port tokens default to DEFAULTPORT." (pop result)) (car result)))) +(defun netrc-machine-user-or-password (mode authinfo-file-or-list machines ports defaults) + "Get the user name or password according to MODE from AUTHINFO-FILE-OR-LIST. +Matches a machine from MACHINES and a port from PORTS, giving +default ports DEFAULTS to `netrc-machine'. + +MODE can be \"login\" or \"password\", suitable for passing to +`netrc-get'." + (let ((authinfo-list (if (stringp authinfo-file-or-list) + (netrc-parse authinfo-file-or-list) + authinfo-file-or-list)) + (ports (or ports '(nil))) + (defaults (or defaults '(nil))) + info) + (dolist (machine machines) + (dolist (default defaults) + (dolist (port ports) + (let ((alist (netrc-machine authinfo-list machine port default))) + (setq info (or (netrc-get alist mode) info)))))) + info)) + (defun netrc-get (alist type) "Return the value of token TYPE from ALIST." (cdr (assoc type alist))) diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 524da6c..bb322b3 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -761,21 +761,25 @@ If EXAMINE is non-nil the group is selected read-only." (imap-close nnimap-server-buffer) (nnheader-report 'nnimap "Server %s is not IMAP4 compliant" server)) (let* ((list (netrc-parse nnimap-authinfo-file)) - (port (if nnimap-server-port - (int-to-string nnimap-server-port) - "imap")) - (alist (or (netrc-machine list server port "imap") - (netrc-machine list - (or nnimap-server-address - nnimap-address) - port "imap") - (netrc-machine list server port "imaps") - (netrc-machine list - (or nnimap-server-address - nnimap-address) - port "imaps"))) - (user (netrc-get alist "login")) - (passwd (netrc-get alist "password"))) + (port (if nnimap-server-port + (int-to-string nnimap-server-port) + "imap")) + (user (netrc-machine-user-or-password + "login" + list + (list server + (or nnimap-server-address + nnimap-address)) + (list port) + (list "imap" "imaps"))) + (passwd (netrc-machine-user-or-password + "password" + list + (list server + (or nnimap-server-address + nnimap-address)) + (list port) + (list "imap" "imaps")))) (if (imap-authenticate user passwd nnimap-server-buffer) (prog1 (push (list server nnimap-server-buffer) diff --git a/lisp/spam.el b/lisp/spam.el index 6c2efa9..6e0d9a4 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -1703,7 +1703,8 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." classification backend gnus-newsgroup-name)))) - (length articles)))) ;return the number of articles processed + ;; return the number of articles processed + (length articles)))) ;;; log a ham- or spam-processor invocation to the registry (defun spam-log-processing-to-registry (id type classification backend group) @@ -2357,7 +2358,7 @@ REMOVE not nil, remove the ADDRESSES." (defun spam-verify-bogofilter () "Verify the Bogofilter version is sufficient." - (when (eq spam-bogofilter-valid 'never) + (when (eq spam-bogofilter-valid 'unknown) (setq spam-bogofilter-valid (not (string-match "^bogofilter version 0\\.\\([0-9]\\|1[01]\\)\\." (shell-command-to-string