From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: Input from buffer instead of minibuffer Date: Wed, 03 Oct 2012 17:45:00 +0200 Message-ID: <87lifnmuf7.fsf@rosalinde.fritz.box> References: <58f60ac7-2407-411c-92ba-13a4550f682a@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1349279270 7860 80.91.229.3 (3 Oct 2012 15:47:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Oct 2012 15:47:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 03 17:47:55 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 1TJRAA-00074p-Lh for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Oct 2012 17:47:06 +0200 Original-Received: from localhost ([::1]:59497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJRA5-0000ru-5r for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Oct 2012 11:47:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJR9w-0000pk-S9 for help-gnu-emacs@gnu.org; Wed, 03 Oct 2012 11:46:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJR9s-0001Ms-FQ for help-gnu-emacs@gnu.org; Wed, 03 Oct 2012 11:46:52 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:41077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJR9s-0001Mn-8l for help-gnu-emacs@gnu.org; Wed, 03 Oct 2012 11:46:48 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TJR9P-0002HB-F4 for help-gnu-emacs@gnu.org; Wed, 03 Oct 2012 17:46:19 +0200 Original-Received: from i59f56bdd.versanet.de ([89.245.107.221]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Oct 2012 17:46:19 +0200 Original-Received: from stephen.berman by i59f56bdd.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Oct 2012 17:46:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: i59f56bdd.versanet.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:87043 Archived-At: On Sun, 30 Sep 2012 21:10:43 -0400 Barry Margolin wrote: > 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. How about widgets? See (info "widget") for examples and details. Steve Berman