help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New line and trailing whitespaces


From: Ergus
Subject: Re: New line and trailing whitespaces
Date: Wed, 24 Apr 2024 04:41:26 +0200

On Tue, Apr 23, 2024 at 07:19:02PM GMT, Eli Zaretskii wrote:
Date: Tue, 23 Apr 2024 17:38:15 +0200
From: Ergus <spacibba@aol.com>
Cc: help-gnu-emacs@gnu.org

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

Ahh this is exactly what I want..

Do you think it worth adding your paragraph as a comment somewhere in
whitespace or reference that in its manual section?

IMO, if we want users to be able to do this, we need a more
user-friendly way of doing that.  Like define a special face, and make
whitespace.el use make-glyph-code with that face, given some user
option setting.

Patches welcome.

Hi Eli:

I tried this.

(with-eval-after-load 'whitespace
  (setq whitespace-style '(faces tab-mark)
        whitespace-display-mappings `((tab-mark ?\t [,(make-glyph-code ?� 
'whitespace-tab) ?\t] ))
        ))
(whitespace-mode 1)

But I only get the error:

wrong-type-argument number-or-marker-p (187 . 235)

Some idea what I am doing wrong?

Best,
Ergus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]