Is Emacs loading the files twice (both .el and .elc)

emacsfileload

I aware that when there's a byte compiled version of a .el file (.elc), emacs loads this second one (I currently pacing them in the same directory).

When I start emacs and I look into my Message buffer I see this:

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

Is emacs loading both the .el and .elc version of the same file?
I don't want emacs to load my plugins twice.

In my .emacs I loaded something like this:

;;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)))

Best Answer

Are you loading color-theme using load-file or using require? require will not load a file whose feature has already been provided, only use load-file when you want to explicitly override that. Another possibility is that color-theme-example and color-theme-library are not using provide, so every time they are asked for with require they are being loaded again - but that should print an error ("required feature 'color-theme-example not provided by loaded file" or something similar).

Related Topic