如何获取可在 Emacs Lisp 中使用的非交互式函数的完整列表?
交互式功能很容易在帮助系统中找到,但我想要我可以使用的所有其他功能的完整列表。例如concat
, car
, cdr
等等(最好有文档)。
Thanks
Ed
编辑:感谢 Jouni 的回答。我稍微研究了一下他的答案,并让它对结果进行排序(使用他的代码结果来帮助我找到正确的排序函数!)
(flet ((first-line (text)
(if text
(substring text 0 (string-match "\n" text))
"")))
(let ((funclist (list)))
(mapatoms
(lambda (x)
(and (fboundp x) ; does x name a function?
(not (commandp (symbol-function x))) ; is it non-interactive?
(subrp (symbol-function x)) ; is it built-in?
(add-to-list 'funclist
(concat (symbol-name x) " - " (first-line (documentation x))
"\n")))))
(dolist (item (sort funclist 'string<))
(insert item))))
这是基本想法 - 请参阅Emacs Lisp 手册 http://www.gnu.org/software/emacs/manual/elisp.html对于任何不清楚的概念。
(flet ((first-line (text)
(if text
(substring text 0 (string-match "\n" text))
"")))
(mapatoms
(lambda (x)
(and (fboundp x) ; does x name a function?
(not (commandp (symbol-function x))) ; is it non-interactive?
(subrp (symbol-function x)) ; is it built-in?
(insert (symbol-name x) " - " (first-line (documentation x)) "\n")))))
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)