Subject: Re: bug#67161: 30.0.50; [PATCH] Add option `dired-filename-display-length'

From: Liu Hui <[email-masked]>
Date: Wed, 15 Nov 2023 18:04:13 +0800

Eli Zaretskii <[email-masked]> 于2023年11月14日周二 21:26写道：

> > +(defcustom dired-filename-hiding-ellipsis "…"
>
> We shouldn't use non-ASCII characters by default, without checking
> they can be displayed.

Thanks for pointing this out. I think it can be changed to "...".

> > +    (let ((ell-len (string-width dired-filename-hiding-ellipsis))
> > +          maxlen filename-col)
> > +      (while (< (point) end)
> > +        (ignore-errors
> > +       (if (not (dired-move-to-filename))
>
> Did you consider using truncate-string-to-width here?

I'm not sure what you mean. Using truncate-string-to-width to shorten
string or using truncate-string-ellipsis to obtain the ellipsis? The
problem of truncate-string-to-width is that it produces a new string.
I want to avoid modifying the buffer text since it would break other
dired functionalities. Therefore this patch only changes the display
instead of the underlying text.