GNU bug report logs -
#67161
30.0.50; [PATCH] Add option `dired-filename-display-length'
Previous Next
Reported by: Liu Hui <liuhui1610 <at> gmail.com>
Date: Tue, 14 Nov 2023 09:55:02 UTC
Severity: normal
Tags: patch
Found in version 30.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 67161 <at> debbugs.gnu.org (full text, mbox):
> From: Liu Hui <liuhui1610 <at> gmail.com>
> Date: Tue, 14 Nov 2023 17:52:58 +0800
>
> The attached patch implements the feature of controlling the display
> length of filename in dired buffers.
>
> When setting this option to `window', the long filename is shortened
> by hiding the middle part to ensure that the whole line needs not to
> be wrapped. The option can also be set to an integer, meaning the
> maximum display length of filename. For users who turn on line
> truncation, this feature can display the end part including the file
> extension, which I think is convenient.
Thanks.
> +(defcustom dired-filename-hiding-ellipsis "…"
We shouldn't use non-ASCII characters by default, without checking
they can be displayed.
> + (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?
This bug report was last modified 1 year and 234 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.