Subject: Re: bug#64897: 29.0.91; Bug (and patch) in find-dired-with-command

From: Michael Albinus <[email-masked]>
Date: Sun, 06 Aug 2023 13:02:35 +0200

Michael Heerdegen <[email-masked]> writes:

> Hello Michael and Warren,

Hi Michael,

> I am using this setting:
>
> #+begin_src emacs-lisp
> (setq find-ls-option
>       (setq find-ls-option-default-exec
>             '("-exec ls -adhl {} +" . "-adhl")))
> #+end_src
>
> and the *Find* buffer now contains lots of lines like
>
> './Zacher/Mauricio Kagel - Fantasia for Organ.mp4'
>
> or
>
> "./Gideon Klein/Gideon Klein's 'Praeludium,' Played by Arturo Fernandez.mp4"
>
> i.e. lines with file names quoted inside '...' or "...".  These lines
> are not functional - dired can't handle them.  I can reproduce this
> problem with emacs -Q.  The above setting worked ok before.
>
> Is this expected and my fault or a regression?

I don't know what's expected. But w/o your setting of find-ls-option,
Emacs sends the command

--8<---------------cut here---------------start------------->8---
find . \( -name \*\ \* \) -ls
--8<---------------cut here---------------end--------------->8---

which works also fine in a shell outside Emacs. With your setting, Emacs
sends

--8<---------------cut here---------------start------------->8---
find . \( -name \*\ \* \) -exec ls -adhl \{\} +
--8<---------------cut here---------------end--------------->8---

which returns indeed quoted file names as you have shown. What if you
set instead

(setq find-ls-option
      (setq find-ls-option-default-exec
            '("-exec ls -abdhl {} +" . "-abdhl")))

> TIA,
> Michael.

Best regards, Michael.