[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Writing Emacs-function: how?
From: |
Ulrich Scholz |
Subject: |
Writing Emacs-function: how? |
Date: |
Tue, 21 Apr 2009 04:37:52 -0700 (PDT) |
User-agent: |
G2/1.0 |
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)
- Writing Emacs-function: how?,
Ulrich Scholz <=