【问题标题】:How to get a comprehensive listing of all defined variables (and their values)?如何获得所有已定义变量(及其值)的全面列表?
【发布时间】:2015-11-10 23:39:03
【问题描述】:

如何列出当前 Emacs 会话的所有全局定义的变量(最好是它们的全局范围值)?

【问题讨论】:

    标签: elisp


    【解决方案1】:

    查看describe-variableobarray的源代码,看来下面的应该给你想要的了。

    (defun global-bindings ()
      (let (res)
        (mapatoms (lambda (vv)
                    (when (and (boundp vv)
                               (not (keywordp vv))
                               (get vv 'variable-documentation))
                      (push (cons vv (symbol-value vv)) res))))
        res))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-19
      • 1970-01-01
      • 1970-01-01
      • 2013-02-28
      • 2012-12-07
      相关资源
      最近更新 更多