From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Riley Newsgroups: gmane.emacs.help Subject: Re: Writing Emacs-function: how? Date: Tue, 21 Apr 2009 14:04:21 +0200 Organization: aich tea tea pea dicky riley dot net Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1240318408 17465 80.91.229.12 (21 Apr 2009 12:53:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Apr 2009 12:53:28 +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 14:54:48 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 1LwFUp-0005BH-4b for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Apr 2009 14:54:43 +0200 Original-Received: from localhost ([127.0.0.1]:60947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwFTQ-0007mu-8Z for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Apr 2009 08:53:16 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!newshub.sdsu.edu!feeder.erje.net!feeder.motzarella.org!news.motzarella.org!motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-X-Trace: news.eternal-september.org U2FsdGVkX18Nd8Y3dRc3PD9mr1YBnI0CrRR7mY5eRYLQIdMKeGOv1SmLuyq7oMjaY/9FnWT1L1Umo9mg5v/dK1bnGhDYv5KltCy45URv3gSdkkix3lOHejBeK6KQz1ylu5n4Q1aP4B97Kqft9m/JQQ== Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Tue, 21 Apr 2009 12:04:22 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1/T8HQJmwKEbRmQnEbp2M0wkmWeAcF0t+96uDGsVOqf+A== Cancel-Lock: sha1:m/vPR1r+MZh/116w0TVq31hqzro= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:168649 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:63919 Archived-At: Ulrich Scholz 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 "" > by "ß" in the current buffer. > > (defun my-replace nil "doc-string" > (while (re-search-forward "" nil t) > (replace-match "ß" nil nil))) > > (global-set-key [f7] 'my-replace) > Look up use of (interactive) r.