Compile files to elc

This commit is contained in:
Maciej Szlosarczyk 2017-05-29 11:21:05 +03:00
parent 4e3bdc6352
commit bf729d6ea3
No known key found for this signature in database
GPG key ID: 0D4EEACF63D4262E
5 changed files with 23 additions and 8 deletions

View file

@ -24,4 +24,21 @@
(set-face-attribute 'helm-header nil :font
(format "Hasklig %d"
(+ size 2))))
;;;; Functions related to compilation of files
(defun byte-compile-init-dir ()
"Byte-compile all your dotfiles."
(interactive)
(byte-recompile-directory user-emacs-directory 0))
(defun remove-elc-on-save ()
"If you're saving an elisp file, likely the .elc is no longer valid."
(add-hook 'after-save-hook
(lambda ()
(if (file-exists-p (concat buffer-file-name "c"))
(delete-file (concat buffer-file-name "c"))))
nil
t))
(add-hook 'emacs-lisp-mode-hook 'remove-elc-on-save)
;;; functions.el ends here