From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: RE: How to prompt for string? Date: Fri, 17 Feb 2006 18:18:12 +0200 Message-ID: <9B93788BE439E94FBB6369B1B8A8DD3643D7D1@esebe107.NOE.Nokia.com> References: <87u0ayjzze.fsf@thalassa.informatimago.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1140244797 17829 80.91.229.2 (18 Feb 2006 06:39:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 18 Feb 2006 06:39:57 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 18 07:39:56 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FALky-0005Xk-Og for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Feb 2006 07:39:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FALkx-00078U-Sk for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Feb 2006 01:39:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FABsb-0002Qr-7P for help-gnu-emacs@gnu.org; Fri, 17 Feb 2006 15:07:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FABL4-0004HA-Uc for help-gnu-emacs@gnu.org; Fri, 17 Feb 2006 14:32:52 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FA8Jb-0008Vq-68 for help-gnu-emacs@gnu.org; Fri, 17 Feb 2006 11:18:39 -0500 Original-Received: from [131.228.20.96] (helo=mgw-ext04.nokia.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1FA8Oy-0007jg-WA for help-gnu-emacs@gnu.org; Fri, 17 Feb 2006 11:24:13 -0500 Original-Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-ext04.nokia.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id k1HGHrfT029371 for ; Fri, 17 Feb 2006 18:17:53 +0200 Original-Received: from esebh103.NOE.Nokia.com ([172.21.143.33]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 17 Feb 2006 18:18:12 +0200 Original-Received: from esebe107.NOE.Nokia.com ([172.21.143.89]) by esebh103.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 17 Feb 2006 18:18:12 +0200 x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message In-Reply-To: <87u0ayjzze.fsf@thalassa.informatimago.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How to prompt for string? Thread-Index: AcYz3KOnNWEKEzn6Tl6LKt9dhe2bFAAAF3gw Original-To: X-OriginalArrivalTime: 17 Feb 2006 16:18:12.0957 (UTC) FILETIME=[C00E00D0:01C633DD] 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:33271 Archived-At: You can use 'interactive', which uses to some 'magic' chars to specify what to prompt for. (interactive "r\nsSummary:") The 'r' will get you the region (begin and and), and 's' will get you a string. The function with the interactive when then be called as if it were called with these parameters. My Example: ;; remove parts of old email, and replace with [snip: ... ] (defun snip-mail (r-begin r-end summary) (interactive "r\nsSummary:") (let ((line-num (count-lines r-begin r-end))) (delete-region r-begin r-end) (insert (format "[snip%s (%d line%s)]\n"=20 (if (=3D 0 (length summary)) "" (concat ": " summary)) line-num=20 (if (=3D line-num 1) "" "s"))))) Best wishes, Dirk.