all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ulrich Scholz <d7@thispla.net>
To: help-gnu-emacs@gnu.org
Subject: Writing Emacs-function: how?
Date: Tue, 21 Apr 2009 04:37:52 -0700 (PDT)	[thread overview]
Message-ID: <ff8cc70c-58b8-428f-8687-4c96442e1a37@l1g2000yqk.googlegroups.com> (raw)

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)



             reply	other threads:[~2009-04-21 11:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-21 11:37 Ulrich Scholz [this message]
2009-04-21 12:04 ` Writing Emacs-function: how? Richard Riley
2009-04-21 13:35   ` d7
2009-04-21 13:52     ` Anselm Helbig
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=ff8cc70c-58b8-428f-8687-4c96442e1a37@l1g2000yqk.googlegroups.com \
    --to=d7@thispla.net \
    --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.