GNU bug report logs - #18548
Emacs whitespace mode

Previous Next

Package: emacs;

Reported by: Kip Coul <kipcoul <at> gmail.com>

Date: Wed, 24 Sep 2014 18:20:02 UTC

Severity: normal

Tags: confirmed

Merged with 18441, 46590

Found in version 27.1.91

Full log


Message #31 received at 18548 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Nathaniel Braun <nathaniel.braun <at> gmail.com>
Cc: 18548 <at> debbugs.gnu.org, Kip Coul <kipcoul <at> gmail.com>,
 Stefan Kangas <stefan <at> marxist.se>, Jack Morrison <JackMorrison1 <at> gmail.com>
Subject: Re: bug#18548: Emacs whitespace mode
Date: Wed, 23 Feb 2022 14:18:46 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> So switching on whitespace-mode messes up the display if there's only
> room for a single character in the TAB?  This seems like such a general
> problem that it's odd that this hasn't been fixed yet.  But I think I
> remember somebody doing work in this area...  does anybody else
> remember?

Ah, right -- I was probably misremembering, and I was just thinking of
this:

    ;; 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

This is used to set up a display table that maps tabs into [?» ?\t]:

	    (aset buffer-display-table (cadr entry) vec)))))))

And that does indeed lead to the messed up display described in this bug
report.

And the reason that this is rarely a problem in practice is that
normally you only have TAB characters at the start of a line (in the
modes where you typically use whitespace-mode), I think?

So I don't know whether anything can or should be done in this case.  I
think that (perhaps) a reasonable default would be to remove that
mapping -- whitespace-mode (by default) marks TAB characters anyway with
a face, so having a » in addition is somewhat superfluous.  On the other
hand, it's been like this forever, so perhaps we should just document
the quirk instead.  Or add a defcustom to allow for easier toggling, and
the defcustom would then also act as documentation for this.

Any opinions?

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




This bug report was last modified 2 years and 361 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.