* mail-source.el (mail-source-read-passwd): Remove. `read-passwd'
authorJesper Harder <harder@ifa.au.dk>
Tue, 4 Mar 2003 01:59:15 +0000 (01:59 +0000)
committerJesper Harder <harder@ifa.au.dk>
Tue, 4 Mar 2003 01:59:15 +0000 (01:59 +0000)
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.

lisp/ChangeLog
lisp/canlock.el
lisp/imap.el
lisp/mail-source.el
lisp/nntp.el
lisp/nnwarchive.el
lisp/pgg.el
lisp/pop3.el
lisp/sieve-manage.el

index 860f327..dd851c7 100644 (file)
@@ -1,3 +1,32 @@
+2003-03-04  Jesper Harder  <harder@ifa.au.dk>
+
+       * 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  <kgreiner@xpediantsolutions.com>
 
        * gnus-agent.el (gnus-agent-mode): Fixed the mode line reports
index 13e7fbc..b52afed 100644 (file)
@@ -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")
index b926c25..ae2a5fd 100644 (file)
@@ -416,22 +416,6 @@ sure of changing the value of `foo'."
   (when (fboundp 'set-buffer-multibyte)
     (set-buffer-multibyte nil)))
 
-(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
@@ -771,7 +755,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) "'): "))))
@@ -2644,7 +2628,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
index c19648c..6d7644a 100644 (file)
@@ -654,22 +654,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)))
@@ -742,7 +726,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))
@@ -806,7 +790,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)))
@@ -1064,7 +1048,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)
index 740cd43..2927dc6 100644 (file)
@@ -261,9 +261,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"))
-
 \f
 
 ;;; Internal functions.
@@ -1048,9 +1045,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."
@@ -1059,8 +1055,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.
@@ -1685,7 +1681,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
@@ -1837,8 +1833,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"
index e05ae78..8802594 100644 (file)
@@ -41,7 +41,6 @@
 (require 'gnus-bcklg)
 (require 'nnmail)
 (require 'mm-util)
-(require 'mail-source)
 (require 'mm-url)
 
 (nnoo-declare nnwarchive)
                 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
index 0f686d6..407e5c1 100644 (file)
 
 (defvar pgg-passphrase-cache (make-vector 7 0))
 
-(defvar pgg-read-passphrase nil)
 (defun pgg-read-passphrase (prompt &optional key)
-  (if (not pgg-read-passphrase)
-      (if (functionp 'read-passwd)
-         (setq pgg-read-passphrase 'read-passwd)
-       (if (load "passwd" t)
-           (setq pgg-read-passphrase 'read-passwd)
-         (autoload 'ange-ftp-read-passwd "ange-ftp")
-         (setq pgg-read-passphrase 'ange-ftp-read-passwd))))
   (or (and pgg-cache-passphrase
           key (setq key (pgg-truncate-key-identifier key))
           (symbol-value (intern-soft key pgg-passphrase-cache)))
-      (funcall pgg-read-passphrase prompt)))
+      (read-passwd prompt)))
 
 (defun pgg-add-passphrase-cache (key passphrase)
   (setq key (pgg-truncate-key-identifier key))
index 43cf916..0c2f73c 100644 (file)
@@ -75,7 +75,7 @@ Used for APOP authentication.")
     ;; 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)
@@ -117,7 +117,7 @@ Used for APOP authentication.")
     ;; 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)
@@ -188,17 +188,6 @@ Return the response string if optional second argument 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
@@ -312,7 +301,7 @@ If NOW, use that time instead."
   (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))
index 9193577..b3015ab 100644 (file)
@@ -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)