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

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

Re: Making a non-ASCII space character visible


From: Nick Helm
Subject: Re: Making a non-ASCII space character visible
Date: Tue, 19 Jun 2018 14:30:44 +1200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin)

On Tue, 19 Jun 2018 at 12:12:29 +1200, Will Parsons wrote:

> OK - I have now modified my .emacs file to have the following lines:
>
> -------
> (setq whitespace-display-mappings '((space-mark     32 [183] [46])
>                                     (space-mark    160 [164] [95])
>                                     (space-mark   8199 [164] [95])
>                                     (newline-mark   10 [36 10])
>                                     (tab-mark        9 [187 9] [92 9])))
> (global-whitespace-mode 1)
> (setq-default whitespace-style '(face lines-tail tabs trailing))
> -------
>
> I have removed the setting of whitespace-display-mappings that I had
> previously manually introduced to custom.el, and the only other
> setting that appears to reference whitespace is the setting
>
>   (whitespace-tab ((t (:background "#081820" :foreground "darkgray")))
>
> in my custom.el file, which I have now removed.
>
> Unfortunately, after making these changes, and having restarted Emacs,
> there is still no change to the display of u+2007.

This looks good, just a couple more things to tweak. You need to turn on
visualising of space characters by adding "space-mark" to
whitespace-style:

  (setq-default whitespace-style '(face lines-tail space-mark tabs trailing))

This variable tells whitespace-mode and global-whitespace-mode which
classes of chars you want to visualise when one of the modes is active.
The space-mark entry tells Emacs to visualise the various space-mark
chars you set up with whitespace-display-mappings, in partiuclar your
new entry for FIGURE SPACEs.

The only other thing is don't forget to put the expressions that set the
configuration variables (the setqs) before you active the mode,
something like this:

  (setq whitespace-display-mappings '((space-mark     32 [183] [46])
                                      (space-mark    160 [164] [95])
                                      (space-mark   8199 [164] [95])
                                      (newline-mark   10 [36 10])
                                      (tab-mark        9 [187 9] [92 9])))
  (setq-default whitespace-style '(face lines-tail space-mark tabs trailing))
  (global-whitespace-mode 1)

Try this in your ~/.emacs, cross fingers and restart Emacs.





reply via email to

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