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: Richard Riley
Subject: Re: Writing Emacs-function: how?
Date: Tue, 21 Apr 2009 14:04:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

Ulrich Scholz <d7@thispla.net> writes:

> I try to write an Emacs function and bind it to a key.  My first try
> is given below.  But I get the error
> "Wrong type argument: commandp, my-replace"
>
> I tried several versions but none worked.  Could you give me a correct
> version. Thanks.
>
> BTW, the function should replace all occurences of the string "<DF>"
> by "ß" in the current buffer.
>
> (defun my-replace nil "doc-string"
>   (while (re-search-forward "<DF>" nil t)
>     (replace-match "ß" nil nil)))
>
> (global-set-key [f7] 'my-replace)
>

Look up use of

  (interactive)

r.


reply via email to

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