From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: how to display a character with a specific glyph and face ? Date: Thu, 23 Oct 2014 18:44:16 +0300 Message-ID: <83y4s67pv3.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1414079092 21145 80.91.229.3 (23 Oct 2014 15:44:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Oct 2014 15:44:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 23 17:44:45 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XhKZ9-0003NC-KP for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Oct 2014 17:44:43 +0200 Original-Received: from localhost ([::1]:40879 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhKZ9-0002nr-3m for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Oct 2014 11:44:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhKYq-0002nD-DS for help-gnu-emacs@gnu.org; Thu, 23 Oct 2014 11:44:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XhKYk-0006SC-CZ for help-gnu-emacs@gnu.org; Thu, 23 Oct 2014 11:44:24 -0400 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:46668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhKYk-0006Rq-57 for help-gnu-emacs@gnu.org; Thu, 23 Oct 2014 11:44:18 -0400 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NDW00800LRIOE00@mtaout27.012.net.il> for help-gnu-emacs@gnu.org; Thu, 23 Oct 2014 18:39:13 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NDW00PL5M5D6A90@mtaout27.012.net.il> for help-gnu-emacs@gnu.org; Thu, 23 Oct 2014 18:39:13 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.183 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100571 Archived-At: > Date: Thu, 23 Oct 2014 14:57:43 +0200 > From: "Boiteux Frederic" >=20 > (make-face 'nbsp-face) > (set-face-background 'nbsp-face "LightBlue") >=20 > (require 'disp-table) > (aset standard-display-table > (make-char 'latin-iso8859-1 (- ?\240 128)) > (vector (+ ?\267 (* 524288 (face-id 'nbsp-face))))) >=20 > It was very helpful when editing text mixing standard and no-break = spaces.=20 > Now, I=A0use Emacs24 and mainly UTF-8 encoded files/buffers, and I= =A0tried to do the same, without success. I tried : >=20 > (aset standard-display-table > #xA0 ;; NO-BREAK SPACE > (vector (+ #xB7 ;; MIDDLE DOT > (* 524288 (face-id 'nbsp-face))))) >=20 > But it doesn't work as expected :=A0I=A0get an Unicode character no= t mapped to a glyph (giving a number written in a square), with a red= background (!). >=20 > Do you know how I=A0could do this display with Emacs24 ? Like this: (aset standard-display-table =09#xA0 ;; NO-BREAK SPACE =09(vector (make-glyph-code #xb7 'nbsp-face))) I'm with Stefan wondering why you'd need that. In addition to what Stefan points out, I can suggest to take a look at whitespace-mode.