Subject: Re: bug#77898: 31.0.50; arc-mode: Split PKZIP archive signature not recognized

From: Jens Schmidt <[email-masked]>
Date: Thu, 24 Apr 2025 23:41:39 +0200

On 2025-04-24  15:09, Eli Zaretskii wrote:

> LGTM, and the tests succeeded on my system, so I've now installed this
> on master, and I'm closing the bug.

Thanks.  Two follow-up nits, not sure whether and how you'd like to
handle them:

- Your windows-nt-specific follow-up commit e38401e7 isn't at all
  windows-nt-specific, as I learned after I noticed it.  On Debian
  GNU/Linux I have both executables "7z" and "7za" available with
  7z(1) saying:

    7z uses plugins to handle archives, so it might be slightly slower than
    7za(1) but can handle more archive formats.

  So using executable "7z" for all ports seems to be TRT.

  (And yes, I have tested using

    (define-arc-mode-test-on-type "7z" '("7z" "a") "7z" '7z)

  on GNU/Linux successfully.)

- And that part of my doc string of macro `define-arc-mode-test-on-type'
  is incorrect:

    "Define and execute a test that tests function `archive-find-type'.
            ^^ wrong ^^

  Since the macro, strictly speaking, only *defines* a test, IIUC.
  Execution happens when command `ert' (or one of its derivatives)
  runs.

Attached is a patch that fixes both of these.  Please let me know what
you think.  Thanks again.
From 6ae69ad8f28dfb341e937110a40b5fb1a8e83258 Mon Sep 17 00:00:00 2001
From: Jens Schmidt <[email-masked]>
Date: Thu, 24 Apr 2025 23:32:45 +0200
Subject: [PATCH] ; Fix previous arc-mode-test commit

* test/lisp/arc-mode-tests.el (define-arc-mode-test-on-type): Doc fix.
("7z"): Use archiver executable "7z" on all ports.
---
 test/lisp/arc-mode-tests.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/test/lisp/arc-mode-tests.el b/test/lisp/arc-mode-tests.el
index 51e8a5eba3f..dd8fdf9e0bc 100644
--- a/test/lisp/arc-mode-tests.el
+++ b/test/lisp/arc-mode-tests.el
@@ -79,7 +79,7 @@ arc-mode-test-make-archive
   (cons arc (funcall (archive--act-files command files) arc)))
 
 (defmacro define-arc-mode-test-on-type (name command extension type)
-  "Define and execute a test that tests function `archive-find-type'.
+  "Define a test that tests function `archive-find-type'.
 Name the test based on NAME.  The generated test first calls
 
   (call-process (car COMMAND) nil nil nil
@@ -133,10 +133,9 @@ "rar"
 
 (define-arc-mode-test-on-type "ar" '("ar" "q") "a" 'ar)
 
-(define-arc-mode-test-on-type "7z" (list (if (eq system-type 'windows-nt)
-                                             "7z" "7za")
-                                         "a")
-                              "7z" '7z)
+;; prefer executable "7z" to "7za", since the former seems be supported
+;; on a broader range of ports
+(define-arc-mode-test-on-type "7z" '("7z" "a") "7z" '7z)
 
 (ert-deftest arc-mode-test-zip-ensure-ext ()
   "Regression test for bug#61326."
-- 
2.39.5