From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.devel Subject: Re: Moving files from lisp/gnus/ to lisp/net/? Date: Sun, 11 Nov 2007 09:04:19 +0900 Message-ID: <87hcjtfy0s.fsf@broken.deisui.org> References: <87y7dd2e0f.fsf@mocca.josefsson.org> <54a15d860711060601s2d85f32o5942939270a7e59e@mail.gmail.com> <54a15d860711071646u2c200961y69e7d684c7418a7a@mail.gmail.com> <54a15d860711081633k364caf30r3b75464be8a060fa@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1194739478 23332 80.91.229.12 (11 Nov 2007 00:04:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 Nov 2007 00:04:38 +0000 (UTC) Cc: simon@josefsson.org, rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 11 01:04:41 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ir0Jd-00069R-Dp for ged-emacs-devel@m.gmane.org; Sun, 11 Nov 2007 01:04:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ir0JR-0004Qb-Qf for ged-emacs-devel@m.gmane.org; Sat, 10 Nov 2007 19:04:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ir0JO-0004QH-M5 for emacs-devel@gnu.org; Sat, 10 Nov 2007 19:04:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ir0JN-0004P6-1m for emacs-devel@gnu.org; Sat, 10 Nov 2007 19:04:26 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ir0JM-0004Of-PW for emacs-devel@gnu.org; Sat, 10 Nov 2007 19:04:24 -0500 Original-Received: from g187018.scn-net.ne.jp ([202.83.187.18] helo=localhost) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ir0JJ-0007C2-MI; Sat, 10 Nov 2007 19:04:22 -0500 Original-Received: from localhost ([127.0.0.1] helo=broken.deisui.org) by localhost with esmtp (Exim 4.68) (envelope-from ) id 1Ir0JH-0002ut-QK; Sun, 11 Nov 2007 09:04:19 +0900 In-Reply-To: (Stefan Monnier's message of "Sat, 10 Nov 2007 15:03:20 -0500") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 1) 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: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:82924 Archived-At: Stefan Monnier writes: >>> password.el itself is in lisp/gnus/. But we need a new function which >>> does password caching, whose arglist is similar to read-passwd's, and >>> whose name is longer than `read-passwd'. > >>> What about this patch? > >> Sorry for consecutive post but this might be better regarding argument >> order. > > I think the docstring should make it very clear that the caller should > be careful to remove the password from the cache in case it turns out > not to be right. > Or even make it more clear that this is not the thing to use because the > password should only be added to the cache after checking its validity. Agreed. I perhaps misunderstood Simon's arguments in the first post correctly. In that case, I think the most part of the existing API of password.el is sufficient enough: - password-read-from-cache KEY Obtain passphrase for KEY from time-limited passphrase cache. - password-cache-add KEY PASSWORD Add password to cache. - password-cache-remove KEY Remove password indexed by KEY from password cache. However, `password-read-and-add' and `password-read' look awkward as interface function. Because `password-read-and-add' is not capable of checking the validity of the password as you say, and `password-read' has somewhat misleading name to use. In addition, they does not provide a way to pass CONFIRM and DEFAULT args to `read-passwd' while they call `read-passwd' internally. - password-read-and-add PROMPT &optional KEY 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'. - password-read PROMPT &optional KEY Read password, for use with KEY, from user, or from cache if wanted. How about just making these two functions obsolete? Regards, -- Daiki Ueno