help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing Emacs-function: how?


From: Anselm Helbig
Subject: Re: Writing Emacs-function: how?
Date: Tue, 21 Apr 2009 15:52:41 +0200
User-agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.7 Emacs/22.3 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

At Tue, 21 Apr 2009 06:35:34 -0700 (PDT),
d7@thispla.net wrote:
> 
> > Look up use of
> >
> >   (interactive)
> 
> 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 "<DF>" nil t)
      (replace-match "ß" 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, 

Anselm



-- 
Anselm Helbig 
mailto:anselm.helbig+news2009@googlemail.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]