Subject: bug#78800: 30.1; dired-re-perms is valid only with modes in ls-lisp-verbosity

From: Sam Steingold <[email-masked]>
Date: Sun, 6 Jul 2025 01:58:31 -0400

Given the abundance of systems where ":" is not a valid file name char
(e.g., windows, common lisp logical pathnames),
I think this is indeed a case of "don't do that".
IOW, a colon in a file name is an interoperability problem beyond Emacs.

On Sat, 5 Jul 2025 at 03:30, Eli Zaretskii <[email-masked]> wrote:
>
> Ping!  Sam, could you please respond?
>
> > Cc: [email-masked]
> > Date: Mon, 23 Jun 2025 13:53:58 +0300
> > From: Eli Zaretskii <[email-masked]>
> >
> > > X-Spam-Status: No, score=-0.006 tagged_above=-999 required=6.31
> > >     tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
> > >     DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_REPLYTO=2.095,
> > >     NO_RELAYS=-0.001] autolearn=no autolearn_force=no
> > > From: Johan Claesson <[email-masked]>
> > > Cc: [email-masked],  Sam Steingold <[email-masked]>,
> > >   [email-masked]
> > > Date: Sun, 22 Jun 2025 11:13:53 +0200
> > >
> > >
> > >
> > > On Mon, Jun 16 2025, Eli Zaretskii wrote:
> > > >> From: Johan Claesson <[email-masked]>
> > > >> Date: Sun, 15 Jun 2025 15:34:28 +0200
> > > >>
> > > >> I am writing about a very small corner case problem in dired in Emacs.
> > > >> Since 83e0442 when modes is not a member of ls-lisp-verbosity then
> > > >> ls-lisp will print the permissions in short form like "drwx".  This will
> > > >> not match the dired-re-perms regexp which expect like "drwxrwxrwx". This
> > > >> will cause a problem in dired for filenames that ends with a colon (:).
> > > >> To reproduce from emacs -Q:
> > > >>
> > > >> (require 'ls-lisp)
> > > >> (setq ls-lisp-use-insert-directory-program nil
> > > >>       ls-lisp-verbosity '(links uid))
> > > >>
> > > >> And then visit a directory containing a file ending with a colon.
> > > >> Maybe the dired-re-perms could just be shortened/simplified to cover
> > > >> this case as well?
> > > >
> > > > It is not easy to modify the value of dired-re-perms, because it is
> > > > also used in dired-font-lock-keywords, whose value is set when
> > > > dired.el is first loaded.
> > > >
> > > > I must say that the feature introduced by 83e0442 is problematic, when
> > > > used on Posix systems that could have files with names ending in a
> > > > colon.  For that reason, I don't recommend using it on Posix systems.
> > > > Why are you using it?
> > > >
> > > > Adding Sam to the discussion, who added that feature, in case he could
> > > > have comments or suggestions.
> > >
> > > Ok, i see.  Well, if this is a case of don't-do-that then this report
> > > can be closed as far as i am concerned.
> > >
> > > Why was i using that feature?  I am not interested in that extra
> > > information on my single user home computer and just wanted to reduce
> > > the width of the lines.
> >
> > OK, thanks.
> >
> > Sam, any further comments, or should I close this bug?
> >
> >
> >
> >

-- 
Sam Steingold <http://sds.podval.org> <http://www.childpsy.net>
<http://steingoldpsychology.com>