Subject: Re: bug#78474: 31.0.50; Wrong char insertion in rxvt

From: Eli Zaretskii <[email-masked]>
Date: Tue, 22 Jul 2025 15:03:52 +0300

> From: Robert Pluim <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  Seb Hinderer
>  <[email-masked]>,  [email-masked],  [email-masked]
> Date: Mon, 21 Jul 2025 18:19:24 +0200
> 
>     Samuel> It's actually even slower on my box.
> 
> You benchmarked moving by one character. Moving by tabs can move in
> multiples of 8 characters, so I doubt itʼs that cut and dried.
> 
> My testing shows that itʼs slower to have tabs disabled, in that visiting
> src/xdisp.c and pressing C-v repeatedly makes redisplay freeze earlier
> than when theyʼre enabled (Emacs eventually catches up).

I have no doubt that the use of TABs speeds up display on average,
because its "cost" notion is based on counting bytes written to the
screen.  It chooses the method that writes the smallest number of
bytes, and that must be faster in general.

Of course, specially-tailored cases could be concocted which show the
contrary, but that's not what this code is about.  The request in this
bug report, AFAIU, was to disable the use of TABs _in_all_cases_, not
just in the particular case shown by the recipe at the beginning of
the discussion.

For users who use screen-reading software the speed gains are
outweighed by the correctness of the spoken text, so disabling TABs in
those cases makes sense.  But if we want to do that automatically, we
should find some reasonably-accurate indication of such uses, like we
do with w32-use-visible-system-caret on MS-Windows.  If the number of
false positives is low, we could risk disabling TABs for a small
fraction of users who don't actually use screen readers.