;ELC
;;; Compiled by LTX@Xue-LingTaos-MacBook-Pro.local on Wed Mar 16 23:09:41 2011
;;; from file /Users/LTX/Projects/Emacs/emacs/lisp/password-cache.el
;;; in Emacs version 24.0.50.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


#@29 Whether to cache passwords.
(custom-declare-variable 'password-cache 't '(#$ . 548) :group 'password :type 'boolean)
#@139 How many seconds passwords are cached, or nil to disable expiring.
Whether passwords are cached at all is controlled by `password-cache'.
(custom-declare-variable 'password-cache-expiry '16 '(#$ . 672) :group 'password :type '(choice (const :tag "Never" nil) (integer :tag "Seconds")))
(byte-code "\301B\302\301!\204\303\301\304\305\306\"\"\210\301\207" [current-load-list password-data default-boundp set-default make-vector 7 0] 5)
#@150 Obtain passphrase for KEY from time-limited passphrase cache.
Custom variables `password-cache' and `password-cache-expiry'
regulate cache behavior.
(defalias 'password-read-from-cache #[(key) "\205
	\205
\303	\n\"J\207" [password-cache key password-data intern-soft] 3 (#$ . 1117)])
#@31 Check if KEY is in the cache.
(defalias 'password-in-cache-p #[(key) "\205\f	\205\f\303	\n\"\207" [password-cache key password-data intern-soft] 3 (#$ . 1410)])
#@279 Read password, for use with KEY, from user, or from cache if wanted.
KEY indicate the purpose of the password, so the cache can
separate passwords.  The cache is not used if KEY is nil.  It is
typically a string.
The variable `password-cache' control whether the cache is used.
(defalias 'password-read #[(prompt &optional key) "\302!\206	\303	!\207" [key prompt password-read-from-cache read-passwd] 2 (#$ . 1581)])
#@469 Read password, for use with KEY, from user, or from cache if wanted.
Then store the password in the cache.  Uses `password-read' and
`password-cache-add'.  Custom variables `password-cache' and
`password-cache-expiry' regulate cache behavior.

Warning: the password is cached without checking that it is
correct.  It is better to check the password before caching.  If
you must use this function, take care to check passwords and
remove incorrect ones from the cache.
(defalias 'password-read-and-add #[(prompt &optional key) "\303	\"\211\203	\203\304	\n\"\210\n)\207" [prompt key password password-read password-cache-add] 4 (#$ . 2007)])
(make-obsolete 'password-read-and-add 'password-read "23.1")
#@317 Remove password indexed by KEY from password cache.
This is typically run by a timer setup from `password-cache-add',
but can be invoked at any time to forcefully remove passwords
from the cache.  This may be useful when it has been detected
that a password is invalid, so that `password-read' query the
user again.
(defalias 'password-cache-remove #[(key) "\303	\"J\211\205%\n;\203!\304\305!\203\305\n!\210\202!\306\n\307\"\210\310	\")\207" [key password-data password intern-soft fboundp clear-string fillarray 95 unintern] 4 (#$ . 2721)])
#@98 Add password to cache.
The password is removed by a timer after `password-cache-expiry' seconds.
(defalias 'password-cache-add #[(key password) "\203\304	\n\"\204\305\306\307	$\210\310	\n\"L\210\306\207" [password-cache-expiry key password-data password intern-soft run-at-time nil password-cache-remove intern] 5 (#$ . 3277)])
#@27 Clear the password cache.
(defalias 'password-reset #[nil "\301\302\"\207" [password-data fillarray 0] 3 (#$ . 3618) nil])
(provide 'password-cache)
