From: Morten Lund
Subject: Getting input from the user!
Date: 
Message-ID: <363F78B7.9BA83478@cs.auc.dk>
Hi,
As you probably can see, I am a newbie to EmacsLisp!
I was wondering how you handle a situation in which you need some input
from the user? I cannot use, interactive "s " because the function
allready got an argument, and as far as I have understood the
"interactive s"-thing binds the input to the argument!

Thanks!
Morten Lund
·········@cs.auc.dk

From: Mike McDonald
Subject: Re: Getting input from the user!
Date: 
Message-ID: <71o6vf$1g7$1@spitting-spider.aracnet.com>
In article <·················@cs.auc.dk>,
	Morten Lund <··@cs.auc.dk> writes:
> Hi,
> As you probably can see, I am a newbie to EmacsLisp!
> I was wondering how you handle a situation in which you need some input
> from the user? I cannot use, interactive "s " because the function
> allready got an argument, and as far as I have understood the
> "interactive s"-thing binds the input to the argument!
> 
> Thanks!
> Morten Lund
> ·········@cs.auc.dk
> 
  
  I use read-string: (read-string "C++ Template name: ")

  Mike McDonald
  ·······@mikemac.com
From: Steve Gonedes
Subject: Re: Getting input from the user!
Date: 
Message-ID: <m2zpa8xotu.fsf@KludgeUnix.com>
Morten Lund <··@cs.auc.dk> writes:

< Hi,
< As you probably can see, I am a newbie to EmacsLisp!

For future reference, there are some newsgroups that deal specifically
with emacs and emacs-lisp. The two that I know of are gnu.emacs.help,
and comp.emacs.

< I was wondering how you handle a situation in which you need some
< input from the user? I cannot use, interactive "s " because the
< function allready got an argument, and as far as I have understood
< the "interactive s"-thing binds the input to the argument!

If the function is not intended to be callable by the user directly
then you shouldn't use the interactive deal. I gather this is the case
as most interactive (top-level, M-x callable) functions do not take
non-interactive arguments (although this is not always the case). Non
interactive methods for reading input depend on what kind of input you
are in need of. For example, if you want the name of a file, it is
best to use `read-file-name' for user convenience and more importantly
to keep emacs consistent (which is very important).

A general purpose solution could be `read-from-minibuffer', but I
think the benefits that can be gained from using a more specific
function are worth looking at.

A better general purpose function is `completing-read' which has built
in support for completion. Also, don't neglect history variables if
they're necessary.

The more specific input-commands are too numerous to list, so I'll
point you to the (elisp)Minibuffers: node in the Emacs lisp reference
manual. There are other places in the manual that discuss input as
well, but this should get you going. You can get the manual from a
prep mirror or view it online at

http://www.eecs.nwu.edu/emacs/emacs.html,

hope this helps...