From d2bf7966293f1f2d1a11e7190b966aa99cc6b31c Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 4 Mar 2003 02:07:51 +0000 Subject: [PATCH] Synch to Oort Gnus. --- lisp/ChangeLog | 37 +++++++++++++++++++++++++++++++++++++ lisp/canlock.el | 20 ++------------------ lisp/gnus-agent.el | 19 +++++++++++++------ lisp/imap.el | 19 +------------------ lisp/mail-source.el | 22 +++------------------- lisp/nntp.el | 17 ++++++----------- lisp/nnwarchive.el | 3 +-- lisp/pop3.el | 17 +++-------------- lisp/sieve-manage.el | 19 +------------------ 9 files changed, 67 insertions(+), 106 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 52ae7a4..dd851c7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,40 @@ +2003-03-04 Jesper Harder + + * mail-source.el (mail-source-read-passwd): Remove. `read-passwd' + exists in all supported Emacs versions, so we don't need this + compatibility function. + (mail-source-fetch-pop, mail-source-check-pop) + (mail-source-fetch-webmail): Use read-passwd. + + * nntp.el (nntp-send-authinfo, nntp-send-nosy-authinfo) + (nntp-open-telnet, nntp-open-via-telnet-and-telnet): Use + read-passwd. + + * nnwarchive.el (nnwarchive-open-server): Use read-passwd. + + * imap.el (imap-read-passwd): Remove. + (imap-interactive-login): Use read-passwd. + + * canlock.el (canlock-read-passwd): Remove. + (canlock-insert-header, canlock-verify): Use read-passwd. + + * sieve-manage.el (sieve-manage-read-passwd): Remove. + (sieve-manage-interactive-login): Use read-passwd. + + * pop3.el (pop3-read-passwd): Remove. + (pop3-movemail, pop3-get-message-count, pop3-apop): Use + read-passwd. + + * pgg.el (pgg-read-passphrase): Simplify. + +2003-03-03 Kevin Greiner + + * gnus-agent.el (gnus-agent-mode): Fixed the mode line reports + 'plugged' when actually 'unplugged' bug. + (gnus-category-read): Ignore nil values when converting an + old-format category so that the new-format category will default + those attributes to the global variables. + 2003-03-03 Reiner Steib * mail-source.el (mail-source-delete-old-incoming-confirm): Fixed diff --git a/lisp/canlock.el b/lisp/canlock.el index 13e7fbc..b52afed 100644 --- a/lisp/canlock.el +++ b/lisp/canlock.el @@ -125,22 +125,6 @@ buffer does not look like a news message." "Make a SHA-1 digest of MESSAGE as a unibyte string of length 20 bytes." (canlock-string-as-unibyte (funcall canlock-sha1-function message))) -(defvar canlock-read-passwd nil) -(defun canlock-read-passwd (prompt &rest args) - "Read a password using PROMPT. -If ARGS, PROMPT is used as an argument to `format'." - (let ((prompt - (if args - (apply 'format prompt args) - prompt))) - (unless canlock-read-passwd - (if (or (fboundp 'read-passwd) (load "passwd" t)) - (setq canlock-read-passwd 'read-passwd) - (unless (fboundp 'ange-ftp-read-passwd) - (autoload 'ange-ftp-read-passwd "ange-ftp")) - (setq canlock-read-passwd 'ange-ftp-read-passwd))) - (funcall canlock-read-passwd prompt))) - (defun canlock-make-cancel-key (message-id password) "Make a Cancel-Key header." (when (> (length password) 20) @@ -231,7 +215,7 @@ message." (message "There are no Message-ID(s)") (unless password (setq password (or canlock-password - (canlock-read-passwd + (read-passwd "Password for Canlock: ")))) (if (or (not (stringp password)) (zerop (length password))) (message "Password for Canlock is bad") @@ -284,7 +268,7 @@ nil instead of to signal an error by setting the option (error "%s" errmsg)) (setq password (or canlock-password-for-verify - (canlock-read-passwd "Password for Canlock: "))) + (read-passwd "Password for Canlock: "))) (if (or (not (stringp password)) (zerop (length password))) (progn (setq errmsg "Password for Canlock is bad") diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index 2a0bf67..8d577c1 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -428,7 +428,12 @@ manipulated as follows: buffer)))) minor-mode-map-alist)) (when (eq major-mode 'gnus-group-mode) - (gnus-agent-toggle-plugged gnus-plugged)) + (let ((init-plugged gnus-plugged)) + ;; g-a-t-p does nothing when gnus-plugged isn't changed. + ;; Therefore, make certain that the current value does not + ;; match the desired initial value. + (setq gnus-plugged :unknown) + (gnus-agent-toggle-plugged init-plugged))) (gnus-run-hooks 'gnus-agent-mode-hook (intern (format "gnus-agent-%s-mode-hook" buffer))))) @@ -2132,11 +2137,13 @@ The following commands are available: (mapcar (lambda (c) (setcdr c - (mapcar* - (lambda (valu symb) - (cons symb valu)) - (cdr c) - '(agent-predicate agent-score-file agent-groups))) + (delq nil + (mapcar* + (lambda (valu symb) + (if valu + (cons symb valu))) + (cdr c) + '(agent-predicate agent-score-file agent-groups)))) c) old-list))))) (list (gnus-agent-cat-make 'default))))) diff --git a/lisp/imap.el b/lisp/imap.el index 1f4c63f..6e00ff9 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -408,22 +408,6 @@ sure of changing the value of `foo'." (setcdr alist (imap-remassoc key (cdr alist))) alist))) -(defun imap-read-passwd (prompt &rest args) - "Read a password using PROMPT. -If ARGS, PROMPT is used as an argument to `format'." - (let ((prompt (if args - (apply 'format prompt args) - prompt))) - (funcall (if (or (fboundp 'read-passwd) - (and (load "subr" t) - (fboundp 'read-passwd)) - (and (load "passwd" t) - (fboundp 'read-passwd))) - 'read-passwd - (autoload 'ange-ftp-read-passwd "ange-ftp") - 'ange-ftp-read-passwd) - prompt))) - (defsubst imap-utf7-encode (string) (if imap-use-utf7 (and string @@ -750,7 +734,7 @@ Returns t if login was successful, nil otherwise." "'): ") (or user imap-default-user)))) (setq passwd (or imap-password - (imap-read-passwd + (read-passwd (concat "IMAP password for " user "@" imap-server " (using authenticator `" (symbol-name imap-auth) "'): ")))) @@ -2622,7 +2606,6 @@ Return nil if no complete line has arrived." (buffer-disable-undo (get-buffer-create imap-debug-buffer)) (mapcar (lambda (f) (trace-function-background f imap-debug-buffer)) '( - imap-read-passwd imap-utf7-encode imap-utf7-decode imap-error-text diff --git a/lisp/mail-source.el b/lisp/mail-source.el index 4896add..d0e7afa 100644 --- a/lisp/mail-source.el +++ b/lisp/mail-source.el @@ -656,22 +656,6 @@ Pass INFO on to CALLBACK." (not (zerop (nth 7 (file-attributes from)))) (delete-file from))) -(defvar mail-source-read-passwd nil) -(defun mail-source-read-passwd (prompt &rest args) - "Read a password using PROMPT. -If ARGS, PROMPT is used as an argument to `format'." - (let ((prompt - (if args - (apply 'format prompt args) - prompt))) - (unless mail-source-read-passwd - (if (or (fboundp 'read-passwd) (load "passwd" t)) - (setq mail-source-read-passwd 'read-passwd) - (unless (fboundp 'ange-ftp-read-passwd) - (autoload 'ange-ftp-read-passwd "ange-ftp")) - (setq mail-source-read-passwd 'ange-ftp-read-passwd))) - (funcall mail-source-read-passwd prompt))) - (defun mail-source-fetch-with-program (program) (zerop (call-process shell-file-name nil nil nil shell-command-switch program))) @@ -744,7 +728,7 @@ If ARGS, PROMPT is used as an argument to `format'." (setq password (or password (cdr (assoc from mail-source-password-cache)) - (mail-source-read-passwd + (read-passwd (format "Password for %s at %s: " user server))))) (when server (setenv "MAILHOST" server)) @@ -813,7 +797,7 @@ If ARGS, PROMPT is used as an argument to `format'." (setq password (or password (cdr (assoc from mail-source-password-cache)) - (mail-source-read-passwd + (read-passwd (format "Password for %s at %s: " user server)))) (unless (assoc from mail-source-password-cache) (push (cons from password) mail-source-password-cache))) @@ -1076,7 +1060,7 @@ This only works when `display-time' is enabled." (or password (cdr (assoc (format "webmail:%s:%s" subtype user) mail-source-password-cache)) - (mail-source-read-passwd + (read-passwd (format "Password for %s at %s: " user subtype)))) (when (and password (not (assoc (format "webmail:%s:%s" subtype user) diff --git a/lisp/nntp.el b/lisp/nntp.el index bad9fa1..9d55a15 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -291,9 +291,6 @@ Within a string, %s is replaced with the server address and %p with port number on server. The program should accept IMAP commands on stdin and return responses to stdout.") -(eval-and-compile - (autoload 'mail-source-read-passwd "mail-source")) - ;;; Internal functions. @@ -1115,9 +1112,8 @@ If SEND-IF-FORCE, only send authinfo to the server if the (or passwd nntp-authinfo-password (setq nntp-authinfo-password - (mail-source-read-passwd - (format "NNTP (%s@%s) password: " - user nntp-address)))))))))) + (read-passwd (format "NNTP (%s@%s) password: " + user nntp-address)))))))))) (defun nntp-send-nosy-authinfo () "Send the AUTHINFO to the nntp server." @@ -1126,8 +1122,8 @@ If SEND-IF-FORCE, only send authinfo to the server if the (nntp-send-command "^3.*\r?\n" "AUTHINFO USER" user) (when t ;???Should check if AUTHINFO succeeded (nntp-send-command "^2.*\r?\n" "AUTHINFO PASS" - (mail-source-read-passwd "NNTP (%s@%s) password: " - user nntp-address)))))) + (read-passwd (format "NNTP (%s@%s) password: " + user nntp-address))))))) (defun nntp-send-authinfo-from-file () "Send the AUTHINFO to the nntp server. @@ -1752,7 +1748,7 @@ via telnet.") proc (concat (or nntp-telnet-passwd (setq nntp-telnet-passwd - (mail-source-read-passwd "Password: "))) + (read-passwd "Password: "))) "\n")) (nntp-wait-for-string nntp-telnet-shell-prompt) (process-send-string @@ -1909,8 +1905,7 @@ Please refer to the following variables to customize the connection: (concat (or nntp-via-user-password (setq nntp-via-user-password - (mail-source-read-passwd - "Password: "))) + (read-passwd "Password: "))) "\n")) (nntp-wait-for-string nntp-via-shell-prompt) (let ((real-telnet-command `("exec" diff --git a/lisp/nnwarchive.el b/lisp/nnwarchive.el index e780aa9..ed02567 100644 --- a/lisp/nnwarchive.el +++ b/lisp/nnwarchive.el @@ -41,7 +41,6 @@ (require 'gnus-bcklg) (require 'nnmail) (require 'mm-util) -(require 'mail-source) (require 'mm-url) (nnoo-declare nnwarchive) @@ -286,7 +285,7 @@ user-mail-address))) (setq nnwarchive-passwd (or nnwarchive-passwd - (mail-source-read-passwd + (read-passwd (format "Password for %s at %s: " nnwarchive-login server))))) (unless nnwarchive-groups diff --git a/lisp/pop3.el b/lisp/pop3.el index b09c6a0..1e17432 100644 --- a/lisp/pop3.el +++ b/lisp/pop3.el @@ -133,7 +133,7 @@ Nil means no, t means yes, not-nil-or-t means yet to be determined.") ;; query for password (if (and pop3-password-required (not pop3-password)) (setq pop3-password - (pop3-read-passwd (format "Password for %s: " pop3-maildrop)))) + (read-passwd (format "Password for %s: " pop3-maildrop)))) (cond ((equal 'apop pop3-authentication-scheme) (pop3-apop process pop3-maildrop)) ((equal 'pass pop3-authentication-scheme) @@ -185,7 +185,7 @@ Nil means no, t means yes, not-nil-or-t means yet to be determined.") ;; query for password (if (and pop3-password-required (not pop3-password)) (setq pop3-password - (pop3-read-passwd (format "Password for %s: " pop3-maildrop)))) + (read-passwd (format "Password for %s: " pop3-maildrop)))) (cond ((equal 'apop pop3-authentication-scheme) (pop3-apop process pop3-maildrop)) ((equal 'pass pop3-authentication-scheme) @@ -305,17 +305,6 @@ Return the response string if optional second argument RETURN is non-nil." t) ))))) -(defvar pop3-read-passwd nil) -(defun pop3-read-passwd (prompt) - (if (not pop3-read-passwd) - (if (fboundp 'read-passwd) - (setq pop3-read-passwd 'read-passwd) - (if (load "passwd" t) - (setq pop3-read-passwd 'read-passwd) - (autoload 'ange-ftp-read-passwd "ange-ftp") - (setq pop3-read-passwd 'ange-ftp-read-passwd)))) - (funcall pop3-read-passwd prompt)) - (defun pop3-clean-region (start end) (setq end (set-marker (make-marker) end)) (save-excursion @@ -558,7 +547,7 @@ Check whether the 4th argument CODING-SYSTEM is allowed" (let ((pass pop3-password)) (if (and pop3-password-required (not pass)) (setq pass - (pop3-read-passwd (format "Password for %s: " pop3-maildrop)))) + (read-passwd (format "Password for %s: " pop3-maildrop)))) (if pass (let ((hash (pop3-md5 (concat pop3-timestamp pass)))) (pop3-send-command process (format "APOP %s %s" user hash)) diff --git a/lisp/sieve-manage.el b/lisp/sieve-manage.el index 9193577..b3015ab 100644 --- a/lisp/sieve-manage.el +++ b/lisp/sieve-manage.el @@ -166,23 +166,6 @@ Valid states are `closed', `initial', `nonauth', and `auth'.") (when (fboundp 'set-buffer-multibyte) (set-buffer-multibyte nil))) -(defun sieve-manage-read-passwd (prompt &rest args) - "Read a password using PROMPT. -If ARGS, PROMPT is used as an argument to `format'." - (let ((prompt (if args - (apply 'format prompt args) - prompt))) - (funcall (if (or (fboundp 'read-passwd) - (and (load "subr" t) - (fboundp 'read-passwd)) - (and (load "passwd" t) - (fboundp 'read-passwd))) - 'read-passwd - (autoload 'ange-ftp-read-passwd "ange-ftp") - 'ange-ftp-read-passwd) - prompt))) - - ;; Uses the dynamically bound `reason' variable. (defvar reason) (defun sieve-manage-interactive-login (buffer loginfunc) @@ -202,7 +185,7 @@ Returns t if login was successful, nil otherwise." sieve-manage-server ": ") (or user sieve-manage-default-user)))) (setq passwd (or sieve-manage-password - (sieve-manage-read-passwd + (read-passwd (concat "Managesieve password for " user "@" sieve-manage-server ": ")))) (when (and user passwd) -- 1.7.10.4