如何获得可以在Emacs Lisp中使用的非交互功能的完整列表?
交互式的很容易在帮助系统中找到,但我想要一个完整的列表,列出我可以使用的所有其他功能.例如concat
,car
,cdr
等.(并优选用文档).
谢谢
埃德
编辑:回答感谢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))))
Jouni K. Sep.. 15
这是基本的想法 - 有关任何不清楚的概念,请参阅Emacs Lisp手册.
(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")))))
Ryan C. Thom.. 5
尝试apropos
代替apropos-command
。这将为您提供所有功能,而不仅仅是交互功能。C-h a
默认情况下绑定到后者,但是如果您要进行大量的elisp hacking,我建议将其绑定到前者。
这是基本的想法 - 有关任何不清楚的概念,请参阅Emacs Lisp手册.
(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")))))
尝试apropos
代替apropos-command
。这将为您提供所有功能,而不仅仅是交互功能。C-h a
默认情况下绑定到后者,但是如果您要进行大量的elisp hacking,我建议将其绑定到前者。