Subject: bug#59139: 29.0.50; batch-byte-recompile-directory doesn't recompile file as expected

From: David Ponce <[email-masked]>
Date: Sat, 12 Nov 2022 17:01:52 +0100

Hello,

If I correctly understood the code, a fix similar to the one applied for Bug#59115
is also needed for directories.  Please find below another patch.
Please also feel free to close this Bug#59139.

diff --git a/bytecomp.el b/bytecomp.el
index c685e50..c81c42e 100644
--- a/bytecomp.el
+++ b/bytecomp.el
@@ -1941,11 +1941,10 @@ 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)))
                        ;; Directory is requested to be ignored
-                      (string-match-p
-                       (regexp-opt byte-compile-ignore-files)
-                       source)
+                      (not (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)

Thanks!