[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Need help with a simple macro to define a new function
From: |
Lennart Borgman (gmail) |
Subject: |
Need help with a simple macro to define a new function |
Date: |
Thu, 15 Nov 2007 20:47:53 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 |
Can someone please explain how to write this:
(defmacro new-defun (function)
(declare (doc-string 3))
(let* ((name (symbol-name function))
(new-name (concat "new-" name))
(new-sym (make-symbol new-name)))
`(defun ,new-sym ()
(interactive)
(message "new function")(sit-for 2)
(call-interactively ,function))))
(new-defun forward-char)
I expected a new function named new-forward-char, but that did not happen.
- Need help with a simple macro to define a new function,
Lennart Borgman (gmail) <=