bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Liu Hui
Subject: bug#67161: 30.0.50; [PATCH] Add option `dired-filename-display-length'
Date: Thu, 16 Nov 2023 18:07:04 +0800

Eli Zaretskii <eliz@gnu.org> 于2023年11月15日周三 20:32写道:

> I actually wonder why we need it as a defcustom.  If you use
> truncate-string-ellipsis, you will get both a customizable setting and
> the correct string for the terminal at hand.  Why do we need an extra
> option?

As Stefan promptly pointed out, the ellipsis defcustom is actually
useless because the display of ellipsis is determined by the display
table. So I have deleted it in the attached patch.

> So you consider using the 'invisible' property a good feature?  I
> actually don't like using it for such purposes, as it gets in the way.

I don't know the drawback of the 'invisible' property. This patch is
inspired by dired-hide-details-mode, which uses the property to hide
file information.

> Btw, using string-width might not be the best possibility here.  I
> would recommend string-pixel-width instead (with subsequent division
> by what default-char-width returns), as that will produce a better
> approximation, especially on GUI frames.

I agree using pixel width is more accurate, though the approximation
based on character width is good enough in most cases. In fact, in
addition to string-width, move-to-column also needs to be replaced by
a function that moves the point to the character at a specific pixel
position. It seems there isn't such a built-in function.

Attachment: 0001-Add-option-dired-filename-display-length.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]