在我的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
作为一个例程不能像你所期望的那样工作.