列出emacs中的所有顶级全局变量 [英] Listing all top level global variables in emacs

查看:216
本文介绍了列出emacs中的所有顶级全局变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

主要是为了我自己的修改,我试图列出当前Emacs会话中加载的所有全局变量。我正在想的是生成一个包含所有列出的功能的HTML文件。当然,还有一些有用的功能是定义函数var的文件。



有没有什么已经内置到emacs中?



L -

解决方案

这些行应该做些什么:

 (let((result'()))
(mapatoms(lambda(x)
(when(boundp x)
(文件(忽略错误
(find-lisp-object-file-name x'defvar))))
(当文件
(push(cons x文件))))))
结果

警告:它需要很长时间时间到了。


Mostly for my own edification I'm trying to list all of the global variables loaded in the current Emacs session. What I was thinking about doing is producing an HTML file with all of the functions listed. Of course, what would also be useful is the file where the function, var, etc was defined.

Is there anything already built into emacs to help?

L-

解决方案

Something along these lines should do:

(let ((result '()))
  (mapatoms (lambda (x)
              (when (boundp x)
                (let ((file (ignore-errors
                              (find-lisp-object-file-name x 'defvar))))
                  (when file
                    (push (cons x file) result))))))
  result)

Warning: it takes a long time to finish.

这篇关于列出emacs中的所有顶级全局变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆