加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

emacs – elisp:有没有办法获取当前.el模块的名称(如C中的__FIL

发布时间:2020-12-16 05:32:46 所属栏目:百科 来源:网络整理
导读:在我的elisp模块的顶部,我想做一些简单的事情: (message (concat "Loading " (expand-file-name (current-elisp-module) "."))) 解决方法 您可以使用由功能 load 设置的变量 load-file-name ,记录如下: Full name of file being loaded by `load’. 正如手
在我的elisp模块的顶部,我想做一些简单的事情:
(message (concat "Loading " (expand-file-name (current-elisp-module) ".")))

解决方法

您可以使用由功能 load设置的变量 load-file-name,记录如下:

Full name of file being loaded by `load’.

正如手册中所阐述的:

When Emacs is in the process of loading a file,this variable’s value is the name of that file,as Emacs found it during the search described earlier in this section.

注意:buffer-file-name作为一个例程不能像你所期望的那样工作.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读