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

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 13 Nov 2022 07:23:03 +0000

Your bug report

#59236: 29.0.50; batch-byte-recompile-directory doesn't recompile file as expected

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
59236: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59236
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#59236: 29.0.50; [PATCH] bytecomp.el: (byte-recompile-directory): Fix negated ignore
From: Philip Kaludercic <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], lin Sun <[email-masked]>
Date: Sun, 13 Nov 2022 07:22:36 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Eli Zaretskii <[email-masked]> writes:

> merge 59236 59139
> thanks
>
>> Date: Sun, 13 Nov 2022 04:26:45 +0000
>> From:  lin Sun via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <[email-masked]>
>> 
>> 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.
>
> This is a duplicate of bug#59139.
>
> Philip, can you please take care of this?

I had applied the patch that was identical to the one proposed here, but
it appears my message confirming that wasn't sent out.  I'll update both
bug reports.

Subject: 29.0.50; batch-byte-recompile-directory doesn't recompile file as expected
From: David Ponce <[email-masked]>
To: [email-masked]
Date: Wed, 9 Nov 2022 02:19:22 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

I recently observed that batch-byte-recompile-directory no more
recompile .el files newer than their .elc file.

Here is the shell command I use:

emacs -batch --no-init-file --no-site-file --eval "(setq load-path [my
load path])" -f batch-byte-recompile-directory .

After some investigation, I found that commit
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=8638aace3fbe01529f33870f469fa60bf5e43ee7
could be the culprit.

The attached patch fixed the above commit and solved the issue for me.

Thanks

In GNU Emacs 29.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version
  3.24.34, cairo version 1.17.6) of 2022-11-07 built on kilauea
Repository revision: d04433b96215d7d3387573f19cc315de86f2341a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 36 (KDE Plasma)

Configured using:
  'configure --prefix=/home/dponce --with-x-toolkit=gtk3
  PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
   value of $LC_TIME: fr_FR.utf8
   value of $LANG: fr_FR.UTF-8
   locale-coding-system: utf-8-unix
index 4d258da..c81c42e 100644
--- a/emacs/lisp/emacs-lisp/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)
@@ -1955,9 +1954,9 @@ also be compiled."
                         (not (auto-save-file-name-p source))
                         (not (member source (dir-locals--all-files directory)))
                         ;; File 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)))
                    (progn (cl-incf
                            (pcase (byte-recompile-file source force arg)
                              ('no-byte-compile skip-count)