From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Input from buffer instead of minibuffer Date: Sun, 30 Sep 2012 21:10:43 -0400 Organization: A noiseless patient Spider Message-ID: References: <58f60ac7-2407-411c-92ba-13a4550f682a@googlegroups.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1349054117 20513 80.91.229.3 (1 Oct 2012 01:15:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Oct 2012 01:15:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 01 03:15:23 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TIUbO-00053k-IC for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Oct 2012 03:15:18 +0200 Original-Received: from localhost ([::1]:48213 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIUbI-0006uM-Vn for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Sep 2012 21:15:12 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Injection-Info: barmar.motzarella.org; posting-host="78fb7125a45724f15e21604c94a7d968"; logging-data="23003"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qruxS7tmp4yM2b8C/lMtE" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:3igsKobmE34YARfwNP2d2mm9xZc= Original-Xref: usenet.stanford.edu gnu.emacs.help:194681 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87017 Archived-At: In article <58f60ac7-2407-411c-92ba-13a4550f682a@googlegroups.com>, Michael Haensel wrote: > Hello everyone - > > I'm writing a quiz program in Emacs Lisp. The program creates a new frame and > buffer for the quiz questions. The quiz then runs something like this: > > (insert "Please identify: [quiz item]") > (setq response > (read-from-minibuffer "Please identify: [quiz item]")) > ... do stuff based on response > > This displays the question in the buffer and the minibuffer. The response is > read in from the minibuffer. This isn't deal-breakingly bad, but a better > design would read the response from the buffer and skip the minibuffer > entirely. > > Is there an easy way to read a response from the buffer instead of the > minibuffer? If it matters, a "response" is a string of 1-8 alphabetic > characters terminated by a newline/return key. Nothing built-in, but it should be pretty straightforward to write a command that looks in the buffer to find the response, and bind the Return key to this command. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***