From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: New line and trailing whitespaces Date: Tue, 23 Apr 2024 11:06:02 +0300 Message-ID: <86le544i6t.fsf@gnu.org> References: <86sezg87oh.fsf@gnu.org> <86o7a486gq.fsf@gnu.org> <86cyqj8f1a.fsf@gnu.org> <86h6fu6jn0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8659"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 23 10:06:47 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rzBAs-0001zr-LO for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 23 Apr 2024 10:06:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzBAI-0007Br-I0; Tue, 23 Apr 2024 04:06:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzBAE-0007BU-O8 for help-gnu-emacs@gnu.org; Tue, 23 Apr 2024 04:06:06 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzBAE-0002oq-GM for help-gnu-emacs@gnu.org; Tue, 23 Apr 2024 04:06:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=aYwDbflo54Hbwm/UzTF0koxPCCDKG41+J5fLFZ6dONU=; b=EY3N26WQO52HNzZ/ZGi6 4lNr0JJve74zUcF4/D627LPYC2VJufVj4ixauyDuIaBVaVuHGOZViuXo8r7YqRXN9fZUP16sahcZF 98eWKxE4A7gGEXVNOAZS5Do2mtx+DJ9WC0wR8yC0O0HIwa7vsYgDsaRpyxiN+1rgw4SmrSeLjjH85 oxppZdA30mvC7RSWAFtbWi2VgRL/jA/KodaKqGYuE82liW3BMuqXfAOTpjf+YGO1ZwvTCtae9ibGO FtpLzCsHtL5TiqQTIITYPsbJPkn3404mEnwsslLn8EmXBPQnLpiv/eSWOtGvK7wXwM7tS8+rsh7GF WZaCAbciCVFdyA==; In-Reply-To: (message from Ergus on Mon, 22 Apr 2024 14:22:43 +0200) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146446 Archived-At: > Date: Mon, 22 Apr 2024 14:22:43 +0200 > From: Ergus > 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.