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

From: Eli Zaretskii <[email-masked]>
Date: Sun, 17 May 2020 18:17:05 +0300

> From: Arthur Miller <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Sun, 17 May 2020 05:01:53 +0200
> 
> I have introduced dired-mode-line-hook, which is a usual thing in Emacs,
> which is ment as a list of hooks that user can set. Each hook should
> return a string that will be concatenated to the lighter. So users can
> print whatever they want to that string (number of files, dirs etc).
> 
> I have introduced also another function that will just iterate through
> hooks concat stuff and update the modeline and refactored some code to
> call this function instead of old dired-sort-set-modeline. Also
> dired-sort-set-modeline is changed to work as a mentioned hook and is
> used as default value for dired-mode-line-hook.
> 
> If user does not prefer to see any aditional info on modeline then it is
> just to set dired-mode-line-hook to nil. Obs, that can probably be coded
> more elegantly, me & elisp are maybe not best friends (yet :-)). I have
> built and tested emacs with the patch, but I might have missed
> something.

Once again, I think users should have simple means to request simple
variations in behavior.  A hook is not a simple means, it requires
non-trivial knowledge of Lisp.  So it should not be the only or main
solution to such problems.

> While I was looking through the code to set myself into dired, I have
> also noticed lots of '^L' chars, I took the freedom to clean it up where
> I saw them, there are probably more.

You shouldn't remove them, they divide large files into sections, and
make it easy to move by "pages".