From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.devel Subject: Re: Moving files from lisp/gnus/ to lisp/net/? Date: Mon, 25 Oct 2004 16:13:56 +0200 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <2366.81.51.30.174.1098020712.squirrel@yxa.extundo.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1098713715 26731 80.91.229.6 (25 Oct 2004 14:15:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Oct 2004 14:15:15 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 25 16:15:02 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CM5cj-0000HK-00 for ; Mon, 25 Oct 2004 16:15:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CM5kN-0005ks-FY for ged-emacs-devel@m.gmane.org; Mon, 25 Oct 2004 10:22:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CM5kB-0005ik-4S for emacs-devel@gnu.org; Mon, 25 Oct 2004 10:22:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CM5kA-0005iK-7A for emacs-devel@gnu.org; Mon, 25 Oct 2004 10:22:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CM5kA-0005iH-35 for emacs-devel@gnu.org; Mon, 25 Oct 2004 10:22:42 -0400 Original-Received: from [80.91.229.2] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CM5c7-0001yK-BF for emacs-devel@gnu.org; Mon, 25 Oct 2004 10:14:23 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CM5c6-0007QL-00 for ; Mon, 25 Oct 2004 16:14:22 +0200 Original-Received: from c494102a.s-bi.bostream.se ([217.215.27.65]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 25 Oct 2004 16:14:22 +0200 Original-Received: from jas by c494102a.s-bi.bostream.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 25 Oct 2004 16:14:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-To: emacs-devel@gnu.org Original-Lines: 83 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: c494102a.s-bi.bostream.se Mail-Copies-To: nobody User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:jZtvAkIB7a56XmkrPTsQ7BvCkFs= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:28916 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28916 Richard Stallman writes: > I would think that the current definition of read-passwd fits the > first criterion but not the second. The new definition, depending on > password.el, I think doesn't fit either one; it may as well be > autoloaded from the new file. I agree, thanks for explaining. I have installed an updated node on the password cache interface, in lispref/minibuf.texi. Complete text below. I'm not a native speaker, so please review and improve it. 20.9 Reading a Password ======================= To read a password to pass to another program, you can use the function `read-passwd'. Passwords are sometimes needed several times throughout an Emacs session. Then it can be useful to avoid having to ask for a password more than once. Passwords are entered into the password cache using the function `password-cache-add'. To read a password, possibly retrieving the password from the cache without querying the user, you can use the function `password-read'. The two calls can be combined into the function `password-read-and-add' that read a password and store it in the cache. Typically users do not use the same password for all services. The password cache mechanism use a `key' string to differentiate among the passwords. The `key' string is typically a fixed string chosen to be related to what the password is used for. For example, a password used when connecting to a IMAP mail server called `mail.example.org', could use a `key' string of `imap:mail.example.org'. You can use any string, as long as it is reasonably unique. Passwords in the cache typically expire after a while (controlled by the variable `password-cache-expiry'), but you can force removal of a password using the function `password-cache-remove'. This is useful when there is a problem with the password, to avoid using the same incorrect password from the cache in the future. -- Function: read-passwd prompt &optional confirm default This function reads a password, prompting with PROMPT. It does not echo the password as the user types it; instead, it echoes `.' for each character in the password. The optional argument CONFIRM, if non-`nil', says to read the password twice and insist it must be the same both times. If it isn't the same, the user has to type it over and over until the last two times match. The optional argument DEFAULT specifies the default password to return if the user enters empty input. If DEFAULT is `nil', then `read-passwd' returns the null string in that case. -- Function: password-read prompt key Read a password from the user, using `read-passwd', prompting with PROMPT. If a password has been stored in the password cache, using `password-cache-add' on the same KEY, it is returned directly, without querying the user. -- Function: password-cache-add key password Add a password to the password cache, indexed under the given KEY. The password is later retrieved using `password-read' called with the same KEY. -- Function: password-cache-remove key Remove a password from the cache, indexed under the given KEY. -- Function: password-read-and-add prompt &optional key Read a password, prompting with PROMPT, and possibly add it to the cache, indexed using the KEY string. This is one-call interface to `password-read' and `password-cache-add'. -- Variable: password-cache-expiry This variable specify for how many seconds passwords are retained in the password cache before they are expired. For high security, use a low value (below a minute). For more lax security, use a setting of `14400' corresponding to half a work day (4 hours). -- Variable: password-cache This variable toggle whether or not the password cache is used at all. The default is non-`nil', i.e., to use the cache.