all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Writing Emacs-function: how?
@ 2009-04-21 11:37 Ulrich Scholz
  2009-04-21 12:04 ` Richard Riley
  2009-04-21 14:00 ` harven
  0 siblings, 2 replies; 6+ messages in thread
From: Ulrich Scholz @ 2009-04-21 11:37 UTC (permalink / raw)
  To: help-gnu-emacs

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)



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-04-21 15:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2009-04-21 14:00 ` harven
2009-04-21 15:17   ` d7

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.