How to print all the defined variables in emacs?

前端 未结 3 1734
一个人的身影
一个人的身影 2020-12-18 00:30

M-x < TAB > prints all the defined functions.

To check a variable is defined or not evaluating the following expression, (boundp \'variable-name) C-x C-e will pr

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-18 01:22

    It's unclear exactly what you want to do with a full list of symbols, since the way in which M-x displays function names is somewhat specialized.

    Assuming that you want to programmatically obtain a list of all defined symbols, here's how auto-complete.el does it:

    (loop for x being the symbols
        if (boundp x)
        collect (symbol-name x))
    

    Note that you can also enter M-x describe-var RET, and then press TAB to get a sorted completion list of all symbols.

提交回复
热议问题