help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can you create interactive funtions in a a macro


From: Kelly
Subject: Re: Can you create interactive funtions in a a macro
Date: Thu, 19 Mar 2009 13:18:10 -0700 (PDT)
User-agent: G2/1.0

On Mar 18, 9:18 pm, Katsumi Yamaoka <yama...@jpl.org> wrote:
> >>>>> 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)))

Yes, it was the intern that I was lacking.
conatenate is actually included with cl-extra, so it was working, I
have done more CL than emacs lisp.
Wasn't aware that insert-string was obsolete (it still worked) -

Thanks for the reply, I've got what I wanted working!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]