Subject: Re: bug#18441: whitespace-mode sometimes adds column to tab character

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 04 Sep 2021 09:57:33 +0200

Marcin Borkowski <[email-masked]> writes:

>> well it appears to be a known problem, as commented in the source of
>> whitespace-mode.

I can confirm that this bug is still present in Emacs 28.

> To be more precise, the comment Mario meant is probably this part of
> definition of `whitespace-display-mappings':
>
>     ;; WARNING: the mapping below has a problem.
>     ;; When a TAB occupies exactly one column, it will display the
>     ;; character ?\xBB at that column followed by a TAB which goes to
>     ;; the next TAB column.
>     ;; If this is a problem for you, please, comment the line below.
>     (tab-mark     ?\t    [?» ?\t] [?\\ ?\t])	; tab - right guillemet
>
> Does anyone know why the workaround given there is not turned on by
> default?  Or maybe it should be made a user option?

If that mark is removed, then tabs won't be marked specially at all --
only with a background colour, which is presumably not what people want
here...

Looking at the whitespace code, I don't really see any easy way to fix
this -- the buffer display table and tab actions don't match?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no