Created
July 3, 2011 01:47
-
-
Save anonymous/1061884 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun auto-byte-recompile () | |
"If the current buffer is in emacs-lisp-mode and there already exists an `.elc' | |
file corresponding to the current buffer file, then recompile the file." | |
(interactive) | |
(when (and (eq major-mode 'emacs-lisp-mode) | |
(file-exists-p (byte-compile-dest-file buffer-file-name))) | |
(byte-compile-file buffer-file-name))) | |
(add-hook 'after-save-hook 'auto-byte-recompile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment