[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A way to get a list of available functions / variables?
From: |
Taylor Venable |
Subject: |
Re: A way to get a list of available functions / variables? |
Date: |
Sun, 24 Feb 2008 20:42:57 -0500 |
User-agent: |
Gnus 5.13 / Emacs 23.0.60.2 |
Johannes Weiner <address@hidden> writes:
>> Is there a way to programmatically get the list of available functions?
>> I'm thinking there must be a table somewhere which relates symbol names
>> to actual function definitions, but can you get all the names in the
>> table from Lisp code? If so, my second question would then be if I
>> could do the same for variables.
>
> mapatoms might help:
>
> (let (cmds vars)
> (mapatoms (lambda (atom)
> (cond
> ((commandp atom)
> (setq cmds (cons atom cmds)))
> ((custom-variable-p atom)
> (setq vars (cons atom vars)))))))
That is very cool, thanks much!
>> The reason I ask is I've got this thing going on at my college where
>> I'll write up an Emacs "function of the day" on the whiteboard in the
>> computer science lounge. It'd be cool if I could automate this process
>> to automatically choose a random function or variable and build like an
>> RSS feed of the results or something. Because I don't know how many
>> times I've been just randomly browsing around the documentation or
>> source and found something like c-subword-mode that I otherwise would
>> not have known even existed!
>
> Sounds like a good idea.
Thanks; I'll post to emacs-help when I get it finished and working suitably.
--
Taylor Venable http://real.metasyntax.net:2357/
foldr = lambda f, i, l: (len(l) == 1 and [f(l[0], i)] or
[f(l[0], foldr(f, i, l[1:]))])[0]