Merge pull request #420 from ranmocy/prelude-recompile-elisp

recompile elc instead of removing it when saving elisp file
This commit is contained in:
Bozhidar Batsov 2013-10-21 22:56:20 -07:00
commit 2a843a6d05

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