bug#81481: 31.0.91; dired-test-filename-with-newline failures on 32-bit Solaris sparc

Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
On Tue, 28 Jul 2026 14:03:51 +0300 Eli Zaretskii <[email protected]> wrote:

>> From: Stephen Berman <[email protected]>
>> Cc: Eli Zaretskii <[email protected]>,  [email protected], john muhl
>>  <[email protected]>
>> Date: Mon, 27 Jul 2026 23:51:29 +0200
>> 
>> > I think this is correct, but I think the fix, both for the test failures
>> > and for deciding whether to display the warning and suggest changing the
>> > the Dired display, is to use `dired-use-ls-dired', as was considered
>> > earlier on in that other bug report
>> > (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=80499#145), instead
>> > testing for ls support of -b.  I'll post a patch later.
>> 
>> The patch is attached.  If I made no mistake, the tests
>> dired-test-filename-with-newline-1 and
>> dired-test-filename-with-newline-2 should now be skipped on platforms
>> using an `ls' that does not support the --dired switch, and on such
>> platforms no warning should be displayed when visiting in Dired a
>> directory listing a file name containing a newline with
>> `dired-auto-toggle-b-switch' set to nil (the default), and setting this
>> user option to t should have no effect on such platforms.  Paul, can you
>> confirm for Solaris, and John Muhl (Cc'd), can you confirm for Alpine,
>> and Eli, can you confirm for MS-Windows?  (On platforms with an `ls'
>> that supports --dired, the behavior with the patch should be unchanged
>> from the behavior with the current code; I've confirmed this for my
>> GNU/Linux system.)
>
> How should I test on Windows, given that my 'ls' is GNU 'ls' and that
> by default 'ls' is not used on Windows?

Hm, I thought, evidently mistakenly, that any `ls' program did not work
on MS-Windows and that's why ls-lisp is used for Dired there.
                                          
>                                          Also, Windows doesn't allow
> file names with embedded newlines.  So what and how should I test?

Now I'm not sure; if your Windows uses GNU `ls' what happens if you try
to visit in Dired a directory listing a file name containing a newline,
both with `dired-auto-toggle-b-switch' set to nil and to t?  And what
happens in Emacs 30 or earlier, before the new handling of file names
with new lines was added?

> The patch LGTM otherwise.

I'm not sure about that either: in the tests I removed `(skip-when (memq
system-type '(windows-nt ms-dos)))' because I thought `(skip-unless
(dired--check-use-ls-dired))' would also skip the tests under Windows,
but if GNU `ls' can be used there, I guess that wouldn't suffice and the
skip-when sexp has to be restored?  And `dired--toggle-b-switch' and the
code in `dired-internal-noselect' for displaying the warning about file
names with newlines would have to explicitly exclude windows-nt and
ms-dos?

Steve Berman
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.