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

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

Re: emacs 23 whitespace-mode, change newline display glyph


From: Kevin Rodgers
Subject: Re: emacs 23 whitespace-mode, change newline display glyph
Date: Tue, 18 Aug 2009 06:55:27 -0600
User-agent: Thunderbird 2.0.0.22 (Macintosh/20090605)

Xah Lee wrote:
On Aug 12, 5:44 am, CHENG Gao <cheng...@gmail.com> wrote:
in my emacs 23 both on Windows and Mac, the white space shows as $,
not ¶, when in whitespace-mode or whitespace-newline-mode.
How to make it show line breaks using ¶ ?
i tried to read the doc... which took me too See also `whitespace-
style', `whitespace-newline' and `whitespace-display-mappings', and
customize... but its rather confusing.

Through reading whitespace-mode source, I found this works:
 (setq whitespace-display-mappings '(
  (newline-mark 10
                          [182 10])))

it turns out, you have to set the whole list, not just one. The above
will basically make it not display any glyphs to tabs and spaces.

I spent several hours looking into this, here's the solution:

(setq whitespace-display-mappings
 '(
   (space-mark 32 [183] [46]) ; normal space
   (space-mark 160 [164] [95])
   (space-mark 2208 [2212] [95])
   (space-mark 2336 [2340] [95])
   (space-mark 3616 [3620] [95])
   (space-mark 3872 [3876] [95])
   (newline-mark 10 [182 10]) ; newlne
   (tab-mark 9 [9655 9] [92 9]) ; tab
))

Why not just:

(require 'whitespace-mode)
(setq whitespace-display-mappings
      (cons '(newline-mark 10 [182 10]) whitespace-display-mappings))

more detail here:

• How to use and setup Emacs's whitespace-mode
  http://xahlee.org/emacs/whitespace-mode.html

  Xah
∑ http://xahlee.org/


--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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