From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.help Subject: Re: Can you create interactive funtions in a a macro Date: Thu, 19 Mar 2009 10:18:15 +0900 Organization: Emacsen advocacy group Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1237426904 28725 80.91.229.12 (19 Mar 2009 01:41:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Mar 2009 01:41:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 19 02:43:02 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lk7Hh-0002lx-A7 for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Mar 2009 02:43:01 +0100 Original-Received: from localhost ([127.0.0.1]:58584 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lk7GK-0001pj-V8 for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Mar 2009 21:41:37 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!newshub.sdsu.edu!feeder.erje.net!news2.arglkargh.de!newsfeed.straub-nv.de!nuzba.szn.dk!pnx.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 21 Original-X-Trace: individual.net +TbuTMQ86c0hC6LVU1OWVAxLHN5E1iyxmHNg9/q9Emx9pVxzw= Cancel-Lock: sha1:X8JHcUTfFwwutBEx9BtUnSVP5UY= sha1:YM2zawbT9iUkE9q01tA/3PZOSro= X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.91 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:167774 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63064 Archived-At: >>>>> 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)))