unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Programmatically creating functions
@ 2008-10-21 17:26 Ian Eure
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Eure @ 2008-10-21 17:26 UTC (permalink / raw
  To: help-gnu-emacs

So, I have a list of symbols:

'(foo bar baz)

I want to iterate over the list and create a function from each which  
does something like this:

(defun call-foo ()
   (interactive)
   (invoke-stuff 'foo)

How can I accomplish this? I can't figure out how to create the  
function. I've tried a number of approaches, but have not met with  
success.

  - eval'ing the defun. Returns a function symbol, but I can't call  
it. Maybe it's only created within the scope of the (eval) and not  
callable from outside?

  - Creating a symbol and using fset to assign a lambda to it's  
function cell. It sort of works, but I'm unclear on how to pass a  
variable function name to defun, nor am I clear on how I can make sure  
it calls invoke-stuff with the right symbol.

Help?

  - Ian




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-10-28 20:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1730.1224610023.25473.help-gnu-emacs@gnu.org>
2008-10-21 18:22 ` Programmatically creating functions aartist
2008-10-21 18:34 ` Joost Diepenmaat
2008-10-21 18:57   ` Andreas Politz
2008-10-25 18:28     ` Ian Eure
     [not found]     ` <mailman.2073.1224959342.25473.help-gnu-emacs@gnu.org>
2008-10-28 20:29       ` Emil
2008-10-21 17:26 Ian Eure

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).