【发布时间】:2023-03-03 12:07:01
【问题描述】:
我有一个名为“myloaddefs.el”的文件函数。它下面有神奇的注释和形式。
;;;###autoload
(defun an-awesome-function '()
(interactive)
"A descriptive comment." t)
;;; other descriptive comments and forms...
它的完整路径是~/.emacs.d/core/myloaddefs.el。
我还有一个完整路径为~/.emacs.d/.local/autoloads.el 的自动加载文件。我将它的路径存储在变量my-autoload-file中。
在调用update-file-autoloads之前,my-autoload-file只有一个空注释;;(确保它不为空,以免出错)。像我在下面那样调用update-file-autoloads 会返回零。当我检查my-autoload-file 时,它确实是用自动加载更新的。加载 'my-autoload-filereturnst` 似乎也很成功。
(update-file-autoloads (concat my-core-dir "myloaddefs.el") t my-autoload-file) ; => nil
(load-file my-autoload-file) ; => t
但是,在使用 M-x an-awesome-function 调用自动加载的交互函数后,我得到了 "Cannot open load file: no such file or directory" "../core/myautoloads"。这让我很困惑,因为目录和文件确实存在。这里有什么问题?
【问题讨论】: