From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: aartist Newsgroups: gmane.emacs.help Subject: Re: Programmatically creating functions Date: Tue, 21 Oct 2008 11:22:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: <69e01833-5362-47b3-beca-ef0e4684c42b@u28g2000hsc.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1224649730 3215 80.91.229.12 (22 Oct 2008 04:28:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Oct 2008 04:28:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 22 06:29:49 2008 connect(): Connection refused 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 1KsVLw-0006LW-Iu for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Oct 2008 06:29:48 +0200 Original-Received: from localhost ([127.0.0.1]:55945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KsVKr-0002vq-3N for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Oct 2008 00:28:41 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!u28g2000hsc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: 68.197.26.151 Original-X-Trace: posting.google.com 1224613338 24441 127.0.0.1 (21 Oct 2008 18:22:18 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 21 Oct 2008 18:22:18 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u28g2000hsc.googlegroups.com; posting-host=68.197.26.151; posting-account=WwaeAgoAAADmWT5YXN5d6o6-Vgorvs1L User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:163654 X-Mailman-Approved-At: Wed, 22 Oct 2008 00:28:11 -0400 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:59018 Archived-At: Do you think that skeleton or macro can help? On Oct 21, 1:26=A0pm, Ian Eure wrote: > So, I have a list of symbols: > > '(foo bar baz) > > I want to iterate over the list and create a function from each which =A0 > does something like this: > > (defun call-foo () > =A0 =A0(interactive) > =A0 =A0(invoke-stuff 'foo) > > How can I accomplish this? I can't figure out how to create the =A0 > function. I've tried a number of approaches, but have not met with =A0 > success. > > =A0 - eval'ing the defun. Returns a function symbol, but I can't call =A0 > it. Maybe it's only created within the scope of the (eval) and not =A0 > callable from outside? > > =A0 - Creating a symbol and using fset to assign a lambda to it's =A0 > function cell. It sort of works, but I'm unclear on how to pass a =A0 > variable function name to defun, nor am I clear on how I can make sure = =A0 > it calls invoke-stuff with the right symbol. > > Help? > > =A0 - Ian