Make recompile function interactive

This commit is contained in:
David Morgan 2022-10-11 13:32:34 +01:00
parent 33f9d82235
commit 49d58cd764
Signed by: djm
GPG Key ID: C171251002C200F2
1 changed files with 3 additions and 1 deletions

View File

@ -21,12 +21,14 @@
(eval-defun edebug-it)))
;; Based on prelude-emacs-lisp.el
(defun recompile-init-lisp ()
"Recompile elisp files in `user-emacs-directory/lisp'."
(interactive)
(when (and
(string-prefix-p (expand-file-name "lisp" user-emacs-directory) (file-truename buffer-file-name))
(file-exists-p (byte-compile-dest-file buffer-file-name)))
(emacs-lisp-byte-compile)))
(defun recompile-init-lisp-on-save ()
"Recompile your elc when saving an elisp file. (Adds buffer-local hook)"
"Recompile your elc when saving an elisp file. (Adds buffer-local hook)."
(add-hook 'after-save-hook 'recompile-init-lisp nil t))
;; From prelude-emacs-lisp.el
(defun visit-ielm ()