all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Anselm Helbig <anselm.helbig+news2009@googlemail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Writing Emacs-function: how?
Date: Tue, 21 Apr 2009 15:52:41 +0200	[thread overview]
Message-ID: <87ws9em7va.wl%anselm.helbig+news2009@googlemail.com> (raw)
In-Reply-To: <c42b0685-f0ba-45d4-ad77-e15c1678cee4@c12g2000yqc.googlegroups.com>

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	other threads:[~2009-04-21 13:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-21 11:37 Writing Emacs-function: how? Ulrich Scholz
2009-04-21 12:04 ` Richard Riley
2009-04-21 13:35   ` d7
2009-04-21 13:52     ` Anselm Helbig [this message]
2009-04-21 14:00 ` harven
2009-04-21 15:17   ` d7

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ws9em7va.wl%anselm.helbig+news2009@googlemail.com \
    --to=anselm.helbig+news2009@googlemail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.