2015-06-15 09:05:52 +02:00
|
|
|
;;; defuns-compile.el
|
|
|
|
|
2015-06-20 22:23:58 +02:00
|
|
|
;; (eval-when-compile (require 'core))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
2015-06-19 16:09:18 +02:00
|
|
|
;;;###autoload
|
2015-06-24 15:47:25 +02:00
|
|
|
(defun narf/is-recompilable-p ()
|
|
|
|
"Does an .elc file exist and is this file in the .emacs.d folder?"
|
2015-06-19 16:09:18 +02:00
|
|
|
(let ((file-name (buffer-file-name)))
|
2015-06-20 22:23:58 +02:00
|
|
|
;; TODO Detect init.el and init-load-path.el
|
2015-06-24 15:47:25 +02:00
|
|
|
(and (f-exists? (f-expand (concat (f-base file-name) ".elc") (f-dirname file-name)))
|
|
|
|
(--any? (f-child-of? file-name it)
|
|
|
|
(append (list narf-core-dir narf-contrib-dir)
|
|
|
|
(list (concat narf-modules-dir "lib/")
|
|
|
|
(concat narf-core-dir "lib/"))
|
|
|
|
(list narf-modules-dir narf-private-dir))))))
|
2015-06-19 16:09:18 +02:00
|
|
|
|
2015-06-15 09:05:52 +02:00
|
|
|
;;;###autoload (autoload 'narf:compile-el "defuns-compile" nil t)
|
|
|
|
(evil-define-command narf:compile-el (&optional bang)
|
|
|
|
:repeat nil
|
|
|
|
(interactive "<!>")
|
2015-06-20 22:23:58 +02:00
|
|
|
(byte-recompile-file (f-expand "init.el" narf-emacs-dir) nil 0)
|
|
|
|
(byte-recompile-file (f-expand "init-load-path.el" narf-emacs-dir) nil 0)
|
|
|
|
(byte-recompile-file (f-expand "core.el" narf-core-dir) t 0)
|
|
|
|
(if (and (eq major-mode 'emacs-lisp-mode) (not bang))
|
|
|
|
(byte-recompile-file (buffer-file-name) t 0)
|
|
|
|
(load (concat narf-script-dir "byte-compile.el"))))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
|
|
|
;;;###autoload (autoload 'narf:compile-autoloads "defuns-compile" nil t)
|
|
|
|
(evil-define-command narf:compile-autoloads (&optional bang)
|
|
|
|
:repeat nil
|
|
|
|
(interactive "<!>")
|
2015-06-20 22:23:58 +02:00
|
|
|
(load (concat narf-script-dir "generate-autoloads.el")))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
|
|
|
(provide 'defuns-compile)
|
|
|
|
;;; defuns-compile.el ends here
|