From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.help Subject: Re: ps-print variables interactive setting Date: Thu, 04 Sep 2008 00:32:48 +0200 Organization: FH-Trier Message-ID: <1220481354.252639@arno.fh-trier.de> References: <87ej42m64o.fsf@gmail.com> <87ej412cpw.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1220481647 6442 80.91.229.12 (3 Sep 2008 22:40:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Sep 2008 22:40:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 04 00:41:42 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kb12g-0004fd-TN for geh-help-gnu-emacs@m.gmane.org; Thu, 04 Sep 2008 00:41:39 +0200 Original-Received: from localhost ([127.0.0.1]:55599 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kb11h-0005bJ-Jk for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Sep 2008 18:40:37 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!newsfeed.straub-nv.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-kl.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 61 Original-NNTP-Posting-Host: 143-93-54-11.arno.fh-trier.de Original-X-Trace: news.uni-kl.de 1220481356 3939 143.93.54.11 (3 Sep 2008 22:35:56 GMT) Original-X-Complaints-To: usenet@news.uni-kl.de Original-NNTP-Posting-Date: Wed, 3 Sep 2008 22:35:56 +0000 (UTC) User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) In-Reply-To: <87ej412cpw.fsf@gmail.com> Cache-Post-Path: arno.fh-trier.de!unknown@dslb-084-059-118-114.pools.arcor-ip.net X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) Original-Xref: news.stanford.edu gnu.emacs.help:161904 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:57245 Archived-At: Rodolfo Medina wrote: > Rodolfo Medina wrote: > >>> I wish to define a function that prompts me more than once: let's call it >>> `my-function': when I type `M-x my-function', in the echo area I see (just an >>> example): >>> >>> Hi, how are you today? >>> >>> . Then I type, e.g., `fine RET', and again it prompts me with: >>> >>> I see. And, what did you do yesterday? >>> >>> ... and so on. Then I'm going to put some `if... else' conditions over my >>> possible answers. Can anybody please provide some hints about how to elisp >>> this? > > > > Barry Margolin writes: > >> (defun my-function () >> (interactive) >> (let* ((response (read-from-minibuffer "Hi, how are you today? ")) >> (new-prompt (format "I see, you're %s? And where did you go >> yesterday?" response)) >> (response2 (read-from-minibuffer new-prompt))) >> (message "I hope you enjoyed %s" response2))) > > > Thanks, that works. > I wish to set some ps-print variables in an interactive way, i.e. be prompted > for the value that I want to set. So, following Barry's hint, I put: > > > (defun my-manage-ps-font-size () > (interactive) > (let* ((prompt1 (read-from-minibuffer "Font size? ")) > (prompt2 (format "(quote (7 . %s))" prompt1)) > ) > (setq ps-font-size prompt2) > ) > ) > > > , but it seems that the variable's value is put between "" and so it is not > accepted. I need help in this point. Thanks to anyone still helping. > > Rodolfo Take a look at the documentation of the interactive call, it let's you read any kind of data from the minibuffer. (defun my-manage-ps-font-size(size string) (interactive "nFont size ? \nsErase all memory ? ") (setq ps-font-size (cons 7 size))) This reads a number and a string. -ap