From: Katsumi Yamaoka <yamaoka@jpl.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Can you create interactive funtions in a a macro
Date: Thu, 19 Mar 2009 10:18:15 +0900 [thread overview]
Message-ID: <b4mr60umht4.fsf@jpl.org> (raw)
In-Reply-To: dac6970c-7b0e-43c6-91c5-ffb0f4fcbd4f@d19g2000yqb.googlegroups.com
>>>>> Kelly wrote:
> Hi, I am missing something here.
> I am trying to write a macro to create interactive functions to
> automate some stuff.
> What I present below is a simlified case:
> (defmacro deftext (functionname texttoinsert)
> `(defun ,(make-symbol (concatenate 'string "text-" functionname)) ()
> (interactive)
> (insert-string ,texttoinsert)))
A function symbol has to be interned in `obarray'. You seem to
have meant the Emacs Lisp function `concat' with `concatenate'.
`insert-string' is obsolete since Emacs 22.1. This will work:
(defmacro deftext (functionname texttoinsert)
`(defun ,(intern (concat "text-" functionname)) ()
(interactive)
(insert ,texttoinsert)))
next prev parent reply other threads:[~2009-03-19 1:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-18 22:35 Can you create interactive funtions in a a macro Kelly
2009-03-19 1:18 ` Katsumi Yamaoka [this message]
2009-03-19 20:18 ` Kelly
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=b4mr60umht4.fsf@jpl.org \
--to=yamaoka@jpl.org \
--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.