help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Input from buffer instead of minibuffer


From: Stephen Berman
Subject: Re: Input from buffer instead of minibuffer
Date: Wed, 03 Oct 2012 17:45:00 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

On Sun, 30 Sep 2012 21:10:43 -0400 Barry Margolin <address@hidden> wrote:

> In article <address@hidden>,
>  Michael Haensel <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]