On Tue, Jan 14, 2025 at 11:07 AM Chet Ramey wrote:

> Is this all that emacs needs, or should we add a call to printable_part()
> as with other uses of print_filename()?

I don't think so.  The completion region that bash uses is the entire
file path, and printable_part() trims off everything before the last
slash.  This would lead to e.g. my_folder/my_fi being replaced with
my_file.txt instead of my_folder/my_file.txt.  In my quick testing,
adding printable_part() just breaks Emacs' completions completely and
it doesn't suggest anything.

> print_filename() is the workhorse that implements support for a number of
> other readline variables, including colored-stats and visible-stats.
> Passing a zero value for prefix_bytes will inhibit the effects of
> completion-prefix-display-length and colored-completion-prefix, which may
> or may not matter to your users.

That's correct.  Those kinds of visual decisions are going to be made by
Emacs.

Reply via email to