Emacs是否加载了我的文件两次(.el和.elc)?

我知道当有.el文件(.elc)的字节编译版本时,emacs会加载第二个(我目前在同一目录中调整它们).

当我启动emacs并查看我的Message缓冲区时,我看到了:

Loading c:/Documents and Settings.../App.../.emacs.d/themes/color-theme-example.el (source)...done
Loading c:/Documents and Setting.../App.../.emacs.d/themes/color-theme-example.elc...done
Loading c:/Documents and Settings.../App.../.emacs.d/themes/color-theme-library.el (source)...done
Loading c:/Documents and Settings.../App.../.emacs.d/themes/color-theme-library.elc...done

emacs是否加载了同一文件的.el和.elc版本?
我不希望emacs加载我的插件两次.

在我的.emacs中我加载了这样的东西:

;;color theme plugin
(add-to-list 'load-path "~/.emacs.d/")
(require 'color-theme)
(eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)
     (color-theme-charcoal-black)))

最佳答案 您是使用加载文件还是使用require加载颜色主题? require将不会加载已提供其功能的文件,只有在您要显式覆盖它时才使用load-file.另一种可能性是颜色主题示例和颜色主题库不使用提供,所以每次要求它们都需要再次加载 – 但这应该打印错误(“必需的功能”颜色主题 – 示例不是由加载的文件“或类似的东西”提供的.

点赞