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

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 30 Sep 2020 21:30:56 +0200

Juri Linkov <[email-masked]> writes:

>> And I'm not sure about this:
>>
>> +                                   (concat " " xs (and (< l2  l1) "…")))))
>>
>> Perhaps that should be conditional upon the terminal being able to
>> display that character?
>
> Like everywhere else (if (char-displayable-p ?…) "…" "...")

Yes.  But this is surely a general problem, and:
`truncate-string-to-width'.

----
If ELLIPSIS is non-nil, it should be a string which will replace the
end of STR (including any padding) if it extends beyond END-COLUMN,
unless the display width of STR is equal to or less than the display
width of ELLIPSIS.  If it is non-nil and not a string, then ELLIPSIS
defaults to ‘truncate-string-ellipsis’.
----

*sigh*

Would anybody mind very much if I added a `string-truncate-right' that
does all this automatically, and amend `string-truncate-left' in the
same way?  I.e., use (if (char-displayable-p ?…) "…" "...").

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no