diff options
author | Philip Kaludercic <philipk@posteo.net> | 2022-11-04 18:57:45 +0100 |
---|---|---|
committer | Philip Kaludercic <philipk@posteo.net> | 2022-11-04 18:57:45 +0100 |
commit | 5fa2f116799b8a7c17ff6eedd6e1b1af077c116b (patch) | |
tree | b42de964147653e6b0e6e5f2082618bf3634acc2 /lisp/emacs-lisp/bytecomp.el | |
parent | 616aa23d8a130a664a2ce3bb05f3518ce0f5a018 (diff) | |
parent | f762c5bb2c96ec9608807bf3c1e3655fb59fc4d6 (diff) | |
download | emacs-5fa2f116799b8a7c17ff6eedd6e1b1af077c116b.tar.gz emacs-5fa2f116799b8a7c17ff6eedd6e1b1af077c116b.tar.bz2 emacs-5fa2f116799b8a7c17ff6eedd6e1b1af077c116b.zip |
Merge branch 'feature/package+vc'
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 9f29ffbb8eb..4d258dab96e 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1882,6 +1882,9 @@ Files in subdirectories of DIRECTORY are processed also." (interactive "DByte force recompile (directory): ") (byte-recompile-directory directory nil t)) +(defvar byte-compile-ignore-files nil + "List of regexps for files to ignore during byte compilation.") + ;;;###autoload (defun byte-recompile-directory (directory &optional arg force follow-symlinks) "Recompile every `.el' file in DIRECTORY that needs recompilation. @@ -1938,14 +1941,23 @@ also be compiled." ;; This file is a subdirectory. Handle them differently. (or (null arg) (eq 0 arg) (y-or-n-p (concat "Check " source "? "))) - (setq directories (nconc directories (list source)))) + (setq directories (nconc directories (list source))) + ;; Directory is requested to be ignored + (string-match-p + (regexp-opt byte-compile-ignore-files) + source) + (setq directories (nconc directories (list source)))) ;; It is an ordinary file. Decide whether to compile it. (if (and (string-match emacs-lisp-file-regexp source) ;; The next 2 tests avoid compiling lock files (file-readable-p source) (not (string-match "\\`\\.#" file)) (not (auto-save-file-name-p source)) - (not (member source (dir-locals--all-files directory)))) + (not (member source (dir-locals--all-files directory))) + ;; File is requested to be ignored + (string-match-p + (regexp-opt byte-compile-ignore-files) + source)) (progn (cl-incf (pcase (byte-recompile-file source force arg) ('no-byte-compile skip-count) |