From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: limit input allowed by read-from-minibuffer? Date: Fri, 24 Feb 2006 14:28:17 -0800 Message-ID: References: <1140730737.029372.218440@z34g2000cwc.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1140853658 5534 80.91.229.2 (25 Feb 2006 07:47:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 25 Feb 2006 07:47:38 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 25 08:47:37 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FCu9L-0004B2-EN for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Feb 2006 08:47:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FCu9M-0002V1-O2 for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Feb 2006 02:47:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FClQQ-0003zU-BU for help-gnu-emacs@gnu.org; Fri, 24 Feb 2006 17:28:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FClQO-0003yd-LS for help-gnu-emacs@gnu.org; Fri, 24 Feb 2006 17:28:34 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FClQO-0003yX-GN for help-gnu-emacs@gnu.org; Fri, 24 Feb 2006 17:28:32 -0500 Original-Received: from [148.87.113.118] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1FClQa-0002ec-V7 for help-gnu-emacs@gnu.org; Fri, 24 Feb 2006 17:28:45 -0500 Original-Received: from rgmsgw301.us.oracle.com (rgmsgw301.us.oracle.com [138.1.186.50]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id k1OMSTjI020355 for ; Fri, 24 Feb 2006 15:28:29 -0700 Original-Received: from rgmsgw301.us.oracle.com (localhost [127.0.0.1]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id k1OMSTfh024861 for ; Fri, 24 Feb 2006 15:28:29 -0700 Original-Received: from dradamslap (dradams-lap.us.oracle.com [130.35.177.126]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id k1OMSSsU024853 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 24 Feb 2006 15:28:28 -0700 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Importance: Normal In-Reply-To: <1140730737.029372.218440@z34g2000cwc.googlegroups.com> X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:33406 Archived-At: I want to prompt for a value in the minibuffer and only accept the input if it matches one of the choices presented in my prompt string. How do I do this? (defun example() (interactive) (setq read_method(read-from-minibuffer "Read Method? [<,>,>>,+<,+>,+>>] " nil nil nil nil "<"))) You want `completing-read', not `read-from-minibuffer'. That will: 1) let users complete their input to any of the possible values, and 2) require that their input be one of those values. Use non-nil for the REQUIRE-MATCH argument.