Variable: password-cache
password-cache is a customizable variable defined in
password-cache.el.gz.
Value
t
Documentation
Whether to cache passwords.
Source Code
;; Defined in /usr/src/emacs/lisp/password-cache.el.gz
;;; password-cache.el --- Read passwords, possibly using a password cache. -*- lexical-binding: t -*-
;; Copyright (C) 1999-2000, 2003-2025 Free Software Foundation, Inc.
;; Author: Simon Josefsson <simon@josefsson.org>
;; Created: 2003-12-21
;; Keywords: extensions
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Greatly influenced by pgg.el written by Daiki Ueno, with timer
;; fixes for XEmacs by Katsumi Yamaoka. In fact, this is mostly just
;; a rip-off.
;;
;; (password-read "Password? " "test")
;; ;; Minibuffer prompt for password.
;; => "foo"
;;
;; (password-cache-add "test" (read-passwd "Password? "))
;; ;; Minibuffer prompt from read-passwd, which returns "foo".
;; => nil
;; (password-read "Password? " "test")
;; ;; No minibuffer prompt
;; => "foo"
;;
;; (password-read "Password? " "test")
;; ;; No minibuffer prompt
;; => "foo"
;;
;; ;; Wait `password-cache-expiry' seconds.
;;
;; (password-read "Password? " "test")
;; ;; Minibuffer prompt for password is back.
;; => "foo"
;;; Code:
;; Options are autoloaded since they are used by eg mml-sec.el.
;;;###autoload
(defcustom password-cache t
"Whether to cache passwords."
:group 'password
:type 'boolean)