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 recompile-elc-on-save () | |
"If you're saving an elisp file, likely the .elc is no longer valid." | |
(make-local-variable 'after-save-hook) | |
(add-hook 'after-save-hook | |
(lambda () | |
(if (file-exists-p (byte-compile-dest-file buffer-file-name)) | |
(byte-compile-file buffer-file-name))))) | |
(add-hook 'emacs-lisp-mode-hook 'recompile-elc-on-save | |
) |