Subject: Re: bug#71235: Failing test on macOS: tramp-test17-dired-with-wildcards

From: Michael Albinus <[email-masked]>
Date: Fri, 31 May 2024 11:22:48 +0200

Michael Albinus <[email-masked]> writes:

Hi Stefan,

> So I guess 'insert-directory-program' is "gls" in your case, but Tramp
> doesn't find it. Where is it installed? What does '(executable-find "gls")'
> return on your machine?

Could you pls check, whether the appended patch fixes the problem?

Best regards, Michael.

diff --git a/lisp/dired.el b/lisp/dired.el
index f2a75df6ef1..c51e5e42c29 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1710,9 +1710,10 @@ dired-insert-directory
       (cond ((and dir-wildcard (files--use-insert-directory-program-p))
              (setq switches (concat "-d " switches))
              (let* ((default-directory (car dir-wildcard))
+                    (ls (or (and remotep "ls")
+                            insert-directory-program))
                     (script (format "%s %s %s"
-                                    insert-directory-program
-                                    switches (cdr dir-wildcard)))
+                                    ls switches (cdr dir-wildcard)))
                     (sh (or (and remotep "/bin/sh")
                             (executable-find shell-file-name)
                             (executable-find "sh")))