From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Landes Newsgroups: gmane.emacs.devel Subject: Re: completing-read enhancement Date: Wed, 12 Aug 2009 01:57:39 +0000 (UTC) Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1250042300 10581 80.91.229.12 (12 Aug 2009 01:58:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Aug 2009 01:58:20 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 12 03:58:13 2009 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 1Mb36S-0000uY-0d for ged-emacs-devel@m.gmane.org; Wed, 12 Aug 2009 03:58:13 +0200 Original-Received: from localhost ([127.0.0.1]:48717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mb36Q-0001Bh-9v for ged-emacs-devel@m.gmane.org; Tue, 11 Aug 2009 21:58:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mb36J-0001BI-E8 for emacs-devel@gnu.org; Tue, 11 Aug 2009 21:58:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mb36F-00019o-5f for emacs-devel@gnu.org; Tue, 11 Aug 2009 21:58:03 -0400 Original-Received: from [199.232.76.173] (port=58927 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mb36E-00019e-Qo for emacs-devel@gnu.org; Tue, 11 Aug 2009 21:57:58 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:50299 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mb36E-0000zz-15 for emacs-devel@gnu.org; Tue, 11 Aug 2009 21:57:58 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Mb369-00034u-3r for emacs-devel@gnu.org; Wed, 12 Aug 2009 01:57:53 +0000 Original-Received: from adsl-69-215-34-30.dsl.chcgil.ameritech.net ([69.215.34.30]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Aug 2009 01:57:53 +0000 Original-Received: from landes by adsl-69-215-34-30.dsl.chcgil.ameritech.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Aug 2009 01:57:53 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 69.215.34.30 (Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.19.2 (KHTML, like Gecko) Version/4.0.2 Safari/530.19) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:114117 Archived-At: Stefan Monnier IRO.UMontreal.CA> writes: > > This isn't a patch to completing-read, instead it is a new function. > > I think of it more as a facade with bells and whistles. In summary, > > it makes prompting for user input easy requiring terse, in the context > > of a function invocation, code for this purpose. > > Could you describe how it relates to completing-read (i.e. how it > differs, mostly; both from the point of view of the user, and from the > point of view of the coder)? The read-completing-choice uses completing-read and doesn't intend to supplant it. To the developer, it offers a quicker way of prompting the user purely based on a list of choices (either symbols or strings) and . It adds the following features: - accepts either symbols or string as input and converts between type automatically - returns user input as either a symbol or string - when the size of the list is one, the initial input is the car of the list - renders default formatting (i.e. "File" -> "File (default subst.el): ") - optionally allows for empty data To the user, it provides a quicker (for most cases) way to select from the list of choices (i.e. by populating the initial data from the choices passed or by adding a default). -- Paul Landes