From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: non-break-space in tutorial Date: Sun, 29 May 2005 19:08:48 +0300 Organization: JURTA Message-ID: <87ll5yqbya.fsf@jurta.org> References: <87y8a1o9u0.fsf-monnier+emacs@gnu.org> <87acmgubin.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1117383494 9815 80.91.229.2 (29 May 2005 16:18:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 29 May 2005 16:18:14 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 29 18:18:09 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DcQTf-0007aH-MD for ged-emacs-devel@m.gmane.org; Sun, 29 May 2005 18:17:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DcQYN-00022S-99 for ged-emacs-devel@m.gmane.org; Sun, 29 May 2005 12:22:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DcQXm-00020i-Hj for emacs-devel@gnu.org; Sun, 29 May 2005 12:21:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DcQXk-0001zl-Ju for emacs-devel@gnu.org; Sun, 29 May 2005 12:21:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DcQXk-0001zV-D5 for emacs-devel@gnu.org; Sun, 29 May 2005 12:21:40 -0400 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DcQVR-0007ZH-EF; Sun, 29 May 2005 12:19:17 -0400 Original-Received: from mail.neti.ee (80-235-40-159-dsl.mus.estpak.ee [80.235.40.159]) by Relayhost2.neti.ee (Postfix) with ESMTP id 2C87F2F43; Sun, 29 May 2005 19:17:50 +0300 (EEST) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Sat, 28 May 2005 07:53:13 -0400") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:37858 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37858 > A better indication for non-breaking spaces and hyphens is the same > as for whitespace highlighting enabled with show-trailing-whitespace, > i.e. displaying non-breaking spaces and hyphens in a special face > with a non-default background color without adding \. > > Would you like to write a patch do this, so people can try it and see > if they like it better? The patch below eliminates the backslash before non-breaking spaces and hyphens. Without the backslash non-breaking spaces need to be highlighted by background instead of foreground, so foreground colors were changed to background colors with values not standing out too much on the default background. The same face with backgroung color affects also displaying control characters, for good reason, since they share the same goal of highlighting dangerous characters. The user option `show-nonbreak-escape' can be renamed to `show-nonbreak-space' (by analogy with `show-trailing-whitespace') or removed at all. Users who dislike highlighting of control characters and non-breaking space can set the face to the void value. Index: src/xdisp.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/xdisp.c,v retrieving revision 1.1014 diff -u -r1.1014 xdisp.c --- src/xdisp.c 27 May 2005 16:59:55 -0000 1.1014 +++ src/xdisp.c 29 May 2005 15:18:14 -0000 @@ -5165,10 +5165,9 @@ if (it->c == 0x8a0 || it->c == 0x8ad || it->c == 0xf20 || it->c == 0xf2d) { - XSETINT (it->ctl_chars[0], escape_glyph); g = it->c; - XSETINT (it->ctl_chars[1], g); - ctl_len = 2; + XSETINT (it->ctl_chars[0], g); + ctl_len = 1; goto display_control; } Index: lisp/faces.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/faces.el,v retrieving revision 1.309 diff -u -r1.309 faces.el --- lisp/faces.el 23 May 2005 18:30:20 -0000 1.309 +++ lisp/faces.el 29 May 2005 15:18:55 -0000 @@ -2079,11 +2079,11 @@ :group 'whitespace ; like `show-trailing-whitespace' :group 'basic-faces) -(defface escape-glyph '((((background dark)) :foreground "cyan") +(defface escape-glyph '((((background dark)) :background "rosybrown4") ;; See the comment in minibuffer-prompt for ;; the reason not to use blue on MS-DOS. - (((type pc)) :foreground "magenta") - (t :foreground "blue")) + (((type pc)) :background "magenta") + (t :background "rosybrown1")) "Face for characters displayed as ^-sequences or \-sequences." :group 'basic-faces) -- Juri Linkov http://www.jurta.org/emacs/