Subject: Re: bug#41250: 28.0.50; Dired displays unconditionally ls-switches on modeline

From: Arthur Miller <[email-masked]>
Date: Fri, 15 May 2020 23:08:46 +0200

Eli Zaretskii <[email-masked]> writes:

>> Date: Fri, 15 May 2020 11:55:46 -0700 (PDT)
>> From: Drew Adams <[email-masked]>
>> Cc: [email-masked], Juri Linkov <[email-masked]>
>> 
>> an integer - show first N chars of switches
>
> I don't think this is a useful value: the user will rarely know how
> much space is available on the mode line.  Also, truncating without
> showing ellipsis or some other sign of truncation is IMO a sub-optimal
> UI.
>
> Thanks.

After I saw Drews mail and patch, and answered, I was thinking
additionally, and I am actually now wondering, why is it assumed that
Dired will show sorting order on modeline by default? I mean other modes
does not do similar. Say, cc-mode does not show which current identation
scheme I use, or something similar. Why is it assumed for Dired? I don't
have historical insight so I don't know why original author(s) decided
to make it so?

If Dired show just, word "Dired" as it's lighter only, as other modes do,
then maybe Drews idea to have a format string is maybe the most flexible
one? For example we could have a format string, by default nil or just
"", which user could set to whatever. Or there could be a hook, say

(defun dired-display-mode-line-info (info-message)
    (setq mode-name (concat mode-name " " info-message)
    (force-mode-line-update)))

with some checks for empty stirng and so on. I ment just as a quick
illustration.

Then users could put for themselves the info they wishes to be
displayed on modeline: sorting order, or number of fles, or current moon
phase? Or they will be like and would prefer to show nothing.

Maybe you have already discussed this when dired was written? In that
case I am just curious why it was decided that Dired should show extra
info on modeline? If anybody remembers, or even know, of course.