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: Sat, 10 Nov 2007 13:53:23 +0900 Message-ID: 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 1194670429 4306 80.91.229.12 (10 Nov 2007 04:53:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Nov 2007 04:53:49 +0000 (UTC) Cc: simon@josefsson.org, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 10 05:53:52 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 1IqiLu-0003MR-F9 for ged-emacs-devel@m.gmane.org; Sat, 10 Nov 2007 05:53:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IqiLi-0001bE-Km for ged-emacs-devel@m.gmane.org; Fri, 09 Nov 2007 23:53:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IqiLe-0001X9-Lo for emacs-devel@gnu.org; Fri, 09 Nov 2007 23:53:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IqiLd-0001Tf-0g for emacs-devel@gnu.org; Fri, 09 Nov 2007 23:53:34 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IqiLc-0001TV-U4 for emacs-devel@gnu.org; Fri, 09 Nov 2007 23:53:32 -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 1IqiLa-00009h-BI; Fri, 09 Nov 2007 23:53:30 -0500 Original-Received: from localhost ([127.0.0.1] helo=broken.deisui.org) by localhost with esmtp (Exim 4.68) (envelope-from ) id 1IqiLU-0000ws-9p; Sat, 10 Nov 2007 13:53:24 +0900 In-Reply-To: (Richard Stallman's message of "Fri, 09 Nov 2007 16:59:56 -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:82903 Archived-At: >>>>> In >>>>> Richard Stallman wrote: > So you're saying he would turn on caching without realizing it? Yes. > That says "give shorter names to frequently used functions, longer > names to rarely used functions". My suggestion is based on the fact > that I hope that password caching in elisp will not be used frequently > Ok, you have convinced me. Let's make it a separate function. > With that decision made, is the code ready to install? 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? Index: lisp/gnus/password.el =================================================================== RCS file: /sources/emacs/emacs/lisp/gnus/password.el,v retrieving revision 1.1 diff -c -r1.1 password.el *** lisp/gnus/password.el 28 Oct 2007 09:18:25 -0000 1.1 --- lisp/gnus/password.el 10 Nov 2007 04:47:16 -0000 *************** *** 134,139 **** --- 134,152 ---- (interactive) (fillarray password-data 0)) + ;;;###autoload + (defun read-passwd-through-cache (prompt key &optional confirm default) + "Read password associated with KEY in password cache. + This first looks up the cache by KEY. If it doesn't hit, this asks + user to input, and then adds it to the cache. The rest of arguments + PROMPT, CONFIRM, and DEFAULT are passed to `read-passwd'. + + The variable `password-cache' control whether the cache is used." + (or (password-read-from-cache key) + (let ((password (read-passwd prompt confirm default))) + (password-cache-add key password) + password))) + (provide 'password) ;;; arch-tag: ab160494-16c8-4c68-a4a1-73eebf6686e5 Regards, -- Daiki Ueno