From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Rodolfo Medina" Newsgroups: gmane.emacs.help Subject: Re: An interactive command definiftion Date: Wed, 11 Aug 2004 17:35:52 +0200 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1092238541 5491 80.91.224.253 (11 Aug 2004 15:35:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 Aug 2004 15:35:41 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 11 17:35:06 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Buv85-0004HT-00 for ; Wed, 11 Aug 2004 17:35:05 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BuvBw-0001KZ-Mv for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Aug 2004 11:39:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BuvBP-000157-8F for help-gnu-emacs@gnu.org; Wed, 11 Aug 2004 11:38:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BuvBM-00013s-R4 for help-gnu-emacs@gnu.org; Wed, 11 Aug 2004 11:38:30 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BuvBM-00013b-Kx for help-gnu-emacs@gnu.org; Wed, 11 Aug 2004 11:38:28 -0400 Original-Received: from [193.70.192.127] (helo=smtp3.libero.it) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Buv7K-000104-2d for help-gnu-emacs@gnu.org; Wed, 11 Aug 2004 11:34:18 -0400 Original-Received: from localhost (172.16.1.80) by smtp3.libero.it (7.0.027-DD01) id 40D05D0F00CB15CD for help-gnu-emacs@gnu.org; Wed, 11 Aug 2004 17:34:17 +0200 Original-Received: from a3i3g5 (151.26.63.1) by smtp20.libero.it (7.0.027-DD01) id 40E3F8E201D3B4DF for help-gnu-emacs@gnu.org; Wed, 11 Aug 2004 17:34:17 +0200 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: X-Virus-Scanned: by amavisd-new at libero.it 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: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20081 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20081 >This provides >the freedom necessary to achieve what you want: > >(defun manage-my-weather (input-char) > (interactive > (let ((prompt (format "my-weather is now: %s. Press `c' to change." > my-weather))) > (list (read-char prompt)))) > (when (eq input-char ?c) > (setq my-weather > (intern (read-from-minibuffer "New weather: "))))) > > > > Oliver I tried it, and it seems to work perfectly! Thanks indeed. Rodolfo