recompile elc instead of removing it when saving elisp file

This commit is contained in:
Ranmocy Sheng 2013-10-21 14:56:30 -07:00
parent 8113c2598b
commit 1c9935ff97

View file

@ -35,12 +35,12 @@
(require 'prelude-lisp) (require 'prelude-lisp)
(defun prelude-remove-elc-on-save () (defun prelude-recompile-elc-on-save ()
"If you're saving an elisp file, likely the .elc is no longer valid." "Recompile your elc when saving an elisp file."
(add-hook 'after-save-hook (add-hook 'after-save-hook
(lambda () (lambda ()
(if (file-exists-p (concat buffer-file-name "c")) (when (file-exists-p (byte-compile-dest-file buffer-file-name))
(delete-file (concat buffer-file-name "c")))) (emacs-lisp-byte-compile)))
nil nil
t)) t))
@ -62,7 +62,7 @@ Start `ielm' if it's not already running."
"Sensible defaults for `emacs-lisp-mode'." "Sensible defaults for `emacs-lisp-mode'."
(run-hooks 'prelude-lisp-coding-hook) (run-hooks 'prelude-lisp-coding-hook)
(turn-on-eldoc-mode) (turn-on-eldoc-mode)
(prelude-remove-elc-on-save) (prelude-recompile-elc-on-save)
(rainbow-mode +1) (rainbow-mode +1)
(setq mode-name "EL") (setq mode-name "EL")
(prelude-conditional-emacs-lisp-checker)) (prelude-conditional-emacs-lisp-checker))