启动emacs后,messages中关于autoloads的错误

Error loading autoloads: (file-missing Cannot open load file No such file or directory d:/YU/emacs-29.2_1/.emacs.d/elpa/compat-29.1.4.2/compat-autoloads)
Error loading autoloads: (file-missing Cannot open load file No such file or directory d:/YU/emacs-29.2_1/.emacs.d/elpa/svg-lib-0.2.8/svg-lib-autoloads)
Error loading autoloads: (file-missing Cannot open load file No such file or directory d:/YU/emacs-29.2_1/.emacs.d/elpa/kind-icon-0.2.1/kind-icon-autoloads)
Error loading autoloads: (file-missing Cannot open load file No such file or directory d:/YU/emacs-29.2_1/.emacs.d/elpa/csv-mode-1.22/csv-mode-autoloads)
Loading d:/YU/emacs-29.2_1/.emacs.d/recentf...done
Cleaning up the recentf list...done (0 removed)
Loading d:/YU/emacs-29.2_1/.emacs.d/site-lisp/init-customize.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.

试试用下面的函数重新生成所有的autoloads:

(defun my/make-autoloads-subdirectories (dir)
  "Make autoloads for all subdirectories under DIR."
  (interactive "DPath of parent directory: ")
  (dolist (file (file-name-all-completions "" dir))
    (when (and (directory-name-p file)
               (not (member file '("./" "../" "archives/" "gnupg/"))))
      (let ((output-file
             (concat dir file
                     (replace-regexp-in-string
                      "-[0-9]\\{1,8\\}\\(\\.[0-9]+\\)+/" "" file)
                     "-autoloads.el"))
            )
        (loaddefs-generate (concat dir file) output-file)
        (byte-compile-file output-file)))))

会出现类似的错误 let: Opening output file: No such file or directory, d:/home/.emacs.d/.local/elpa/js2-mode-20231224/js2-mode-20231224/-autoloads.el

这个函数生成autoload文件的命名采用了正则替换,你的包目录名字末尾没有子版本号,所以使用这个正则匹配不上。

"-[0-9]\\{1,8\\}\\(\\.[0-9]+\\)+/"

试试这样改,我不保证没有其它问题

"-[0-9]\\{1,8\\}\\(\\.[0-9]+\\)*/"

如果错误不多,重新安装下这几个包也许更快

你可以试着选择上一级目录