Skip to content

Commit

Permalink
Merge pull request #19 from emacs-jp/only-elc
Browse files Browse the repository at this point in the history
Don't load file if there is only '.elc' file
  • Loading branch information
syohex committed May 26, 2016
2 parents 1f28a0b + 06f7431 commit c630a05
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions init-loader.el
Expand Up @@ -205,6 +205,8 @@ example, 00_foo.el, 01_bar.el ... 99_keybinds.el."
(when init-loader-byte-compile
(let* ((path (file-name-sans-extension (locate-library file)))
(el (concat path ".el")) (elc (concat path ".elc")))
(when (and (not (file-exists-p el)) (file-exists-p elc))
(error "There is only byte-compiled file."))
(when (or (not (file-exists-p elc))
(file-newer-than-file-p el elc))
(when (file-exists-p elc) (delete-file elc))
Expand Down

0 comments on commit c630a05

Please sign in to comment.