我将显式文件设置为通过UI创建的自定义.它被命名了custom.el.目前,我使用以下代码段创建此文件(如果不存在).
(defconst custom-file (expand-file-name "custom.el" user-emacs-directory))
(unless (file-exists-p custom-file)
(shell-command (concat "touch " custom-file)))
Run Code Online (Sandbox Code Playgroud)
有一个丑陋的shell命令touch,任何其他elisp函数都可以做到这一点?
mat*_*thk 15
您可以使用(write-region "" nil custom-file)不确定这是理想的解决方案.