Merge from emacs--rel--22
[bpt/emacs.git] / lisp / gnus / sieve-manage.el
index 5cf14f7..0a7c8e9 100644 (file)
@@ -1,7 +1,7 @@
 ;;; sieve-manage.el --- Implementation of the managesive protocol in elisp
 
 ;; Copyright (C) 2001, 2002, 2003, 2004, 2005,
-;;   2006, 2007 Free Software Foundation, Inc.
+;;   2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 
 
 ;;; Code:
 
-(or (require 'password-cache nil t)
-    (require 'password))
+;; For Emacs < 22.2.
+(eval-and-compile
+  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
+
+(if (locate-library "password-cache")
+    (require 'password-cache)
+  (require 'password))
+
 (eval-when-compile
   (require 'sasl)
   (require 'starttls))
@@ -193,6 +199,10 @@ Valid states are `closed', `initial', `nonauth', and `auth'.")
   (when (fboundp 'set-buffer-multibyte)
     (set-buffer-multibyte nil)))
 
+(declare-function password-read         "password-cache" (prompt &optional key))
+(declare-function password-cache-add    "password-cache" (key password))
+(declare-function password-cache-remove "password-cache" (key))
+
 ;; Uses the dynamically bound `reason' variable.
 (defvar reason)
 (defun sieve-manage-interactive-login (buffer loginfunc)