GNU bug report logs - #16177
24.3.50; Display glyphs for hard spaces in color

Previous Next

Package: emacs;

Reported by: "Sebastien Vauban" <sva-news <at> mygooglest.com>

Date: Tue, 17 Dec 2013 14:04:01 UTC

Severity: wishlist

Found in version 24.3.50

To reply to this bug, email your comments to 16177 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16177; Package emacs. (Tue, 17 Dec 2013 14:04:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Sebastien Vauban" <sva-news <at> mygooglest.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 17 Dec 2013 14:04:02 GMT) Full text and rfc822 format available.

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

From: "Sebastien Vauban" <sva-news <at> mygooglest.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Display glyphs for hard spaces in color
Date: Tue, 17 Dec 2013 15:01:50 +0100
Hello,

In French, you have a narrow nobreak space (202F) in front of the colon : « as
well between quotes »...

Before "high punctuation symbols" (such as ! and ?), it is a "common" nbsp
(00A0): Hello ! How are you ?

Problem #1:

To get hard spaces (aka nbsp) highlighted, you need to add `spaces' to
`whitespace-style':

#+begin_src emacs-lisp
  ;; which kind of blank is visualized
  (setq whitespace-style
        '(face trailing tabs spaces
          indentation::space space-mark tab-mark))
#+end_src

Doing so, all the normal spaces are highlighted as well...

And setting the background of `whitespace-space' to `white' is not a solution,
as Org headings would become weird (when they use a background color).

Problem #2:

Narrow nbsp aren't highlighted.

See http://screencast.com/t/3qtxb3vTxcS for visualizing both problems.

Best regards,
  Seb




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16177; Package emacs. (Tue, 17 Dec 2013 15:32:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Sebastien Vauban <sva-news <at> mygooglest.com>, 16177 <at> debbugs.gnu.org
Subject: RE: bug#16177: 24.3.50; Display glyphs for hard spaces in color
Date: Tue, 17 Dec 2013 07:31:01 -0800 (PST)
FWIW -

http://www.emacswiki.org/emacs-en/download/highlight-chars.el

http://www.emacswiki.org/emacs/ShowWhiteSpace#toc2

From the Commentary, this description of what vanilla Emacs offers:

;; Vanilla Emacs can itself highlight hard spaces and hard hyphens,
;; and it does so whenever `nobreak-char-display' is non-nil, which it
;; is by default.  By "hard" space and hyphen I mean "no-break" or
;; non-breaking.  These are the non-ASCII Unicode characters with code
;; points 160 (#xa0) and 8209 (#x2011), respectively.
;;
;; This low-level vanilla Emacs highlighting does not use Font Lock
;; mode, and it cannot highlight only one of these characters and not
;; the other.
;;
;; See standard library `whitespace.el' for other ways to highlight
;; whitespace characters.  It does some things similar to what
;; `highlight-chars.el' does, plus other, unrelated things.  As its
;; name suggests, its effects are limited to whitespace characters.
;; It is also somewhat complicated to use (10 faces, 24 options!)...
;;
;; Besides being simpler, I think that `highlight-chars.el' has an
;; advantage of letting you easily highlight ONLY particular
;; whitespace characters.  `whitespace.el' apparently makes you pick
;; whether to highlight spaces and hard spaces together, or not, for
;; instance.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16177; Package emacs. (Sun, 30 May 2021 05:40:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Sebastien Vauban" <sva-news <at> mygooglest.com>
Cc: 16177 <at> debbugs.gnu.org
Subject: Re: bug#16177: 24.3.50; Display glyphs for hard spaces in color
Date: Sun, 30 May 2021 07:39:19 +0200
"Sebastien Vauban" <sva-news <at> mygooglest.com> writes:

> well between quotes »...
>
> Before "high punctuation symbols" (such as ! and ?), it is a "common" nbsp
> (00A0): Hello ! How are you ?
>
> Problem #1:
>
> To get hard spaces (aka nbsp) highlighted, you need to add `spaces' to
> `whitespace-style':

[...]

> Narrow nbsp aren't highlighted.

(I'm going through old bug reports that unfortunately got little response at
the time.)

I guess this is a feature request to have whitespace-mode being able to
emphasise the space characters that aren't the normal ASCII space
separately.  That (surprisingly enough) doesn't seem to be an option?
And, indeed, whitespace-mode only knows about SPACE and NO-BREAK SPACE,
and none of the other space characters.

So I think a new whitespace-style should be added -- like `other-space',
for all the spaces that aren't SPACE.

However, the original impetus for doing this may be somewhat lessened by
Emacs now defaulting to highlighting other spaces in a different way by
default -- even without whitespace-mode.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16177; Package emacs. (Sun, 30 May 2021 15:01:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Sebastien Vauban
 <sva-news <at> mygooglest.com>
Cc: "16177 <at> debbugs.gnu.org" <16177 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#16177: 24.3.50; Display glyphs for hard spaces
 in color
Date: Sun, 30 May 2021 15:00:32 +0000
> > To get hard spaces (aka nbsp) highlighted, you need to add `spaces' to
> > `whitespace-style': [...]  Narrow nbsp aren't highlighted.
> 
> I guess this is a feature request to have whitespace-mode being able to
> emphasise the space characters that aren't the normal ASCII space
> separately.  That (surprisingly enough) doesn't seem to be an option?
> And, indeed, whitespace-mode only knows about SPACE and NO-BREAK SPACE,
> and none of the other space characters.
> 
> So I think a new whitespace-style should be added -- like `other-space',
> for all the spaces that aren't SPACE.
> 
> However, the original impetus for doing this may be somewhat lessened by
> Emacs now defaulting to highlighting other spaces in a different way by
> default -- even without whitespace-mode.

The problem/question has been raised several times.

From bug #9790 (10 years ago):

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=9790#21

  Various posts in this thread essentially propose different
  blanket approaches, i.e., paint something with a broad brush.
  Some want such brushwork in some contexts; others don't.

  What's needed, I think, are (1) a fine-grained mechanism to
  control which chars get highlighted and how and where/when,
  (2) default applications of that mechanism to specific contexts,
  and (3) user ability to control things.

  No broad brushwork will be satisfactory, I think.  I think
  some form of #1 is the starting point - without that, I
  don't see a good solution.

  I mentioned my library `highlight-chars.el', which provides
  support for #1: ways to highlight any set of chars, and
  control where/when/whether that's done.  Maybe take a look
  at what it offers, as food for thought or even perhaps reuse?

That bug, reported by Chong Yidong, follows from an
emacs-devel discussion of the problem/question.  And
that bug and similar/~duplicate ones are still open.

The overall approach/strategy should be discussed again,
perhaps, and a plan decided on wrt fixing the problem. 

See also:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=14481#8

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16177#8

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44236#11

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44236#75

This bug report was last modified 4 years and 14 days ago.

Previous Next


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