From b5552eed3934b6b1ee1387f13a7c0c7fe99ed0fa Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 6 Dec 2018 15:56:36 -0500 Subject: [PATCH] Improve predicate fn for byte-compile targets Will now avoid dotfiles and unit test files. --- core/cli/byte-compile.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/cli/byte-compile.el b/core/cli/byte-compile.el index a08602908..be1a509eb 100644 --- a/core/cli/byte-compile.el +++ b/core/cli/byte-compile.el @@ -21,6 +21,12 @@ respectively.") ;; ;; Helpers +(defun doom--byte-compile-ignore-file-p (path) + (let ((filename (file-name-nondirectory path))) + (or (string-prefix-p "." filename) + (string-prefix-p "test-" filename) + (not (equal (file-name-extension path) "el"))))) + (defun doom-byte-compile (&optional modules recompile-p) "Byte compiles your emacs configuration. @@ -98,7 +104,7 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files." ;; Assemble el files we want to compile; taking into account that ;; MODULES may be a list of MODULE/SUBMODULE strings from the command ;; line. - (let ((target-files (doom-files-in targets :depth 1 :match "\\.el$")) + (let ((target-files (doom-files-in targets :filter #'doom--byte-compile-ignore-file-p)) (load-path load-path) kill-emacs-hook kill-buffer-query-functions) (unless target-files