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

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

how to display a character with a specific glyph and face ?


From: Boiteux Frederic
Subject: how to display a character with a specific glyph and face ?
Date: Thu, 23 Oct 2014 14:57:43 +0200

        Hello,


When I was using Emacs23, I had a piece of config to display « no-break space » 
character with another glyph (centered dot) an a specific face (with a blue 
background) :

(make-face 'nbsp-face)
(set-face-background 'nbsp-face "LightBlue")

(require 'disp-table)
(aset standard-display-table
      (make-char 'latin-iso8859-1  (- ?\240 128))
      (vector (+ ?\267 (* 524288 (face-id 'nbsp-face)))))

It was very helpful when editing text mixing standard and no-break spaces. 
Now, I use Emacs24 and mainly UTF-8 encoded files/buffers, and I tried to do 
the same, without success. I tried :

(aset standard-display-table
      #xA0 ;; NO-BREAK SPACE
      (vector (+ #xB7 ;; MIDDLE DOT
                 (* 524288 (face-id 'nbsp-face)))))

But it doesn't work as expected : I get an Unicode character not mapped to a 
glyph (giving a number written in a square), with a red background (!).

Do you know how I could do this display with Emacs24 ?

    With regards,
               Fred.





reply via email to

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