unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: non-break-space in tutorial
Date: Sun, 29 May 2005 19:08:48 +0300	[thread overview]
Message-ID: <87ll5yqbya.fsf@jurta.org> (raw)
In-Reply-To: <E1DbzsP-0004xB-Hd@fencepost.gnu.org> (Richard Stallman's message of "Sat, 28 May 2005 07:53:13 -0400")

>     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)
 \f

-- 
Juri Linkov
http://www.jurta.org/emacs/

  reply	other threads:[~2005-05-29 16:08 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-26 23:19 non-break-space in tutorial Stefan Monnier
2005-05-27 11:57 ` Juri Linkov
2005-05-27 13:07   ` Paul Pogonyshev
2005-05-28 11:53   ` Richard Stallman
2005-05-29 16:08     ` Juri Linkov [this message]
2005-05-29 17:40       ` Eli Zaretskii
2005-05-30  8:48         ` Juri Linkov
2005-05-30 16:08           ` Eli Zaretskii
2005-05-31  4:18       ` Richard Stallman
2005-05-31  5:17         ` Miles Bader
2005-05-31  8:56         ` Kim F. Storm
2005-05-31 17:47           ` Richard Stallman
2005-06-06 12:52         ` Juri Linkov
2005-06-06 14:07           ` Stefan Monnier
2005-06-07  0:17           ` Miles Bader
2005-06-07 15:33             ` Juri Linkov
2005-06-07 17:12               ` Daniel Brockman
2005-06-08  0:59                 ` Juri Linkov
2005-06-08  2:22                   ` Henrik Enberg
2005-06-07 22:31               ` Miles Bader
2005-06-07 23:12                 ` Gaëtan LEURENT
2005-06-07 23:53                   ` Miles Bader
2005-06-08  0:01                     ` Luc Teirlinck
2005-06-08  0:17                       ` Miles Bader
2005-06-08 23:29                   ` Gaëtan LEURENT
2005-06-08 23:57                     ` Juri Linkov
2005-06-07 23:52                 ` Juri Linkov
2005-06-08  0:17                   ` Miles Bader
2005-06-08  0:57                     ` Juri Linkov
2005-06-08  2:37                       ` Miles Bader
2005-06-08  8:35                         ` Kim F. Storm
2005-06-08  8:53                           ` Miles Bader
2005-06-08 16:05                           ` Stefan Monnier
2005-06-08 20:47                             ` Juri Linkov
2005-06-08 21:25                             ` Kim F. Storm
2005-06-08 22:53                               ` Stefan Monnier
2005-06-09 14:40                             ` Richard Stallman
2005-06-09 15:29                               ` David Kastrup
2005-06-09 16:44                                 ` Juanma Barranquero
2005-05-28 11:53 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ll5yqbya.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).