Subject: bug#59236: 29.0.50; [PATCH] bytecomp.el: (byte-recompile-directory): Fix negated ignore

From: lin Sun <[email-masked]>
Date: Sun, 13 Nov 2022 04:26:45 +0000

Hi,

The patch 8638aace3f try to use the variable
`byte-compile-ignore-files`, but the logic is inverse for both file
and directory parts;
and the patch a01024c859 fix the logic for file part;
this patch try to fix the logic for directory part.

Please help review and apply it. Thanks.

Best regards
Lin
From 1e00f1ab7ea8171e99068486d6b93ba62e905777 Mon Sep 17 00:00:00 2001
From: Lin Sun <[email-masked]>
Date: Sun, 13 Nov 2022 00:00:22 +0000
Subject: [PATCH] * bytecomp.el: (byte-recompile-directory): Fix negated ignore
 logic

Should not append the sub-directories when match the
byte-compile-ignore-files regular expression.  (Bug#59115)
---
 lisp/emacs-lisp/bytecomp.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index c685e5087f..f11c4efc6c 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1942,11 +1942,11 @@ byte-recompile-directory
 		      (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)
-                      (setq directories (nconc directories (list source))))
+		      ;; Directory is requested to be ignored
+		      (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)
 			;; The next 2 tests avoid compiling lock files
-- 
2.20.5