[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New line and trailing whitespaces
From: |
Eli Zaretskii |
Subject: |
Re: New line and trailing whitespaces |
Date: |
Tue, 23 Apr 2024 11:06:02 +0300 |
> Date: Mon, 22 Apr 2024 14:22:43 +0200
> From: Ergus <spacibba@aol.com>
> Cc: help-gnu-emacs@gnu.org
>
> >> That face seems apply only to the tab whitespace when whitespace-style
> >> has `tabs`, but not to when `tab-mark` applies.
> >
> >You lost me here. But if all you want is to know what face is used on
> >some text, simply use "M-x describe-text-properties RET" with point on
> >that text.
> >
> Whitespace mode "shows" the tabs in two (independent) ways:
>
> 1. "Colorizing" the tab whitespace with some color (face tabs)
> 2. Add a mark in the whitespace space like | or � (tab-mark)
>
> The whitespace-tab face applies only to 1, but I don't find how to make
> it apply to 2
>
>
> Define the whitespace-tab face foreground and background
> (setq-default whitespace-style '(faces tab-mark))
> (whitespace-mode 1)
> TAB
>
> I see: the �, but it is always white, independently of whitespace-tab face.
You need to customize whitespace-display-mappings. Specifically, the
tab-mark element of the value is by default the vector '[?» ?\t], and
you need to replace each of these two characters with a glyph that has
the face you want, using make-glyph-code. Caveat: a comment in
whitespace.el explains why only newlines are given a face:
;; Only insert face bits on NEWLINE char mapping to avoid
;; obstruction of other faces like TABs and (HARD) SPACEs
;; faces, font-lock faces, etc.
- New line and trailing whitespaces, Ergus, 2024/04/20
- Re: New line and trailing whitespaces, Eli Zaretskii, 2024/04/20
- Re: New line and trailing whitespaces, Eli Zaretskii, 2024/04/20
- Re: New line and trailing whitespaces, Ergus, 2024/04/20
- Re: New line and trailing whitespaces, Eli Zaretskii, 2024/04/21
- Re: New line and trailing whitespaces, Ergus, 2024/04/21
- Re: New line and trailing whitespaces, Eli Zaretskii, 2024/04/22
- Re: New line and trailing whitespaces, Ergus, 2024/04/22
- Re: New line and trailing whitespaces,
Eli Zaretskii <=
- Re: New line and trailing whitespaces, Ergus, 2024/04/23
- Re: New line and trailing whitespaces, Eli Zaretskii, 2024/04/23
- Re: New line and trailing whitespaces, Ergus, 2024/04/23
- Re: New line and trailing whitespaces, Eli Zaretskii, 2024/04/24
- Re: New line and trailing whitespaces, Ergus, 2024/04/24
- Re: New line and trailing whitespaces, Eli Zaretskii, 2024/04/24
- Re: New line and trailing whitespaces, Ergus, 2024/04/22