diff --git a/.gitignore b/.gitignore index aa1fd6a..a79fb0c 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -*~ +*~ erc/logs/ elpa/*readme.txt elpa/ elisp-git/ +*elc \ No newline at end of file diff --git a/contrapunctus/cp-lisp.el b/contrapunctus/cp-lisp.el index d006700..afb15c4 100644 --- a/contrapunctus/cp-lisp.el +++ b/contrapunctus/cp-lisp.el @@ -33,3 +33,11 @@ :keymap geiser-mode-map :bindings `((,(kbd "C-."))))) + +(autoload 'byte-recompile-file "bytecomp" "byte-recompile-file" t) +(defun cp-byte-recompile-el-buffer () + "Run byte-recompile-file on current buffer if current buffer is +an Emacs Lisp file." + (if (equal major-mode 'emacs-lisp-mode) + (byte-compile-file (buffer-name)))) +(add-hook 'after-save-hook 'cp-byte-recompile-el-buffer)