From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anselm Helbig Newsgroups: gmane.emacs.help Subject: Re: Writing Emacs-function: how? Date: Tue, 21 Apr 2009 15:52:41 +0200 Organization: Freie Universitaet Berlin Message-ID: <87ws9em7va.wl%anselm.helbig+news2009@googlemail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1240328338 22851 80.91.229.12 (21 Apr 2009 15:38:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Apr 2009 15:38:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 21 17:40:17 2009 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 1LwI53-00045m-2F for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Apr 2009 17:40:17 +0200 Original-Received: from localhost ([127.0.0.1]:49175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwI3e-0004pm-3H for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Apr 2009 11:38:50 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!newshub.sdsu.edu!feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 34 Original-X-Trace: news.uni-berlin.de cWsXVPG0gPvtvPsn6XvzUAASXkN0Sq0dSiPBQtwysy0jNTKQk2e+VpQEnJ Cancel-Lock: sha1:X8OL5c8Su/vTvwgiaxLRyVBLvOY= In-Reply-To: Mail-Followup-To: anselm.helbig+news2009@googlemail.com User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/22.3 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) Original-Xref: news.stanford.edu gnu.emacs.help:168653 X-Mailman-Approved-At: Tue, 21 Apr 2009 11:36:45 -0400 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:63923 Archived-At: At Tue, 21 Apr 2009 06:35:34 -0700 (PDT), d7@thispla.net wrote: >=20 > > Look up use of > > > > =A0 (interactive) >=20 > Thanks. But for me, there are still too many open issues. I would > appreciate a small example. Well, then, look up the examples in the documentation: (info "(elisp)Interactive Examples") For your function it is really simple: (defun my-replace nil "doc-string" (interactive) (while (re-search-forward "" nil t) (replace-match "=DF" nil nil))) The more complex uses of "interactive" allow you to specify how your commands gets its arguments, i.e. prompting the user for a file, buffer or just some text, giving it a (numeric) prefix argument etc. HTH,=20 Anselm --=20 Anselm Helbig=20 mailto:anselm.helbig+news2009@googlemail.com