unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16177: 24.3.50; Display glyphs for hard spaces in color
@ 2013-12-17 14:01 Sebastien Vauban
  2013-12-17 15:31 ` Drew Adams
  2021-05-30  5:39 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 4+ messages in thread
From: Sebastien Vauban @ 2013-12-17 14:01 UTC (permalink / raw)
  To: 16177-ubl+/3LiMTaZdePnXv/OxA

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#16177: 24.3.50; Display glyphs for hard spaces in color
  2013-12-17 14:01 bug#16177: 24.3.50; Display glyphs for hard spaces in color Sebastien Vauban
@ 2013-12-17 15:31 ` Drew Adams
  2021-05-30  5:39 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 4+ messages in thread
From: Drew Adams @ 2013-12-17 15:31 UTC (permalink / raw)
  To: Sebastien Vauban, 16177

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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#16177: 24.3.50; Display glyphs for hard spaces in color
  2013-12-17 14:01 bug#16177: 24.3.50; Display glyphs for hard spaces in color Sebastien Vauban
  2013-12-17 15:31 ` Drew Adams
@ 2021-05-30  5:39 ` Lars Ingebrigtsen
  2021-05-30 15:00   ` bug#16177: [External] : " Drew Adams
  1 sibling, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-05-30  5:39 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: 16177

"Sebastien Vauban" <sva-news@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#16177: [External] : bug#16177: 24.3.50; Display glyphs for hard spaces in color
  2021-05-30  5:39 ` Lars Ingebrigtsen
@ 2021-05-30 15:00   ` Drew Adams
  0 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2021-05-30 15:00 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Sebastien Vauban; +Cc: 16177@debbugs.gnu.org

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-30 15:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-17 14:01 bug#16177: 24.3.50; Display glyphs for hard spaces in color Sebastien Vauban
2013-12-17 15:31 ` Drew Adams
2021-05-30  5:39 ` Lars Ingebrigtsen
2021-05-30 15:00   ` bug#16177: [External] : " Drew Adams

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).