@item nobreak-space
The face for displaying no-break space characters (@pxref{Text
Display}).
+@item nobreak-hyphen
+The face for displaying no-break hyphen characters (@pxref{Text
+Display}).
@end table
The following faces control the appearance of parts of the Emacs
specially: it displays @code{U+00A0} (no-break space) with the
@code{nobreak-space} face, and it displays @code{U+00AD} (soft
hyphen), @code{U+2010} (hyphen), and @code{U+2011} (non-breaking
-hyphen) with the @code{escape-glyph} face. To disable this, change
+hyphen) with the @code{nobreak-hyphen} face. To disable this, change
the variable @code{nobreak-char-display} to @code{nil}. If you give
this variable a non-@code{nil} and non-@code{t} value, Emacs instead
displays such characters as a highlighted backslash followed by a
:version "22.1")
(defface nobreak-space
- '((((class color) (min-colors 88)) :inherit escape-glyph :underline t)
- (((class color) (min-colors 8)) :background "magenta")
- (t :inverse-video t))
+ '((((background dark)) :foreground "cyan")
+ (((type pc)) :foreground "magenta")
+ (t :foreground "brown"))
"Face for displaying nobreak space."
:group 'basic-faces
:version "22.1")
+(defface nobreak-hyphen
+ '((((background dark)) :foreground "cyan")
+ (((type pc)) :foreground "magenta")
+ (t :foreground "brown"))
+ "Face for displaying nobreak hyphens."
+ :group 'basic-faces
+ :version "25.2")
+
(defgroup mode-line-faces nil
"Faces used in the mode line."
:group 'mode-line
goto display_control;
}
+ /* Handle non-ascii hyphens in the mode where it only
+ gets highlighting. */
+
+ if (nonascii_hyphen_p && EQ (Vnobreak_char_display, Qt))
+ {
+ /* Merge `nobreak-space' into the current face. */
+ face_id = merge_faces (it->f, Qnobreak_hyphen, 0,
+ it->face_id);
+ XSETINT (it->ctl_chars[0], '-');
+ ctl_len = 1;
+ goto display_control;
+ }
+
/* Handle sequences that start with the "escape glyph". */
/* the default escape glyph is \. */
? merge_faces (it->f, Qt, lface_id, it->face_id)
: merge_escape_glyph_face (it));
- /* Draw non-ASCII hyphen with just highlighting: */
-
- if (nonascii_hyphen_p && EQ (Vnobreak_char_display, Qt))
- {
- XSETINT (it->ctl_chars[0], '-');
- ctl_len = 1;
- goto display_control;
- }
-
/* Draw non-ASCII space/hyphen with escape glyph: */
if (nonascii_space_p || nonascii_hyphen_p)
/* Name and number of the face used to highlight escape glyphs. */
DEFSYM (Qescape_glyph, "escape-glyph");
- /* Name and number of the face used to highlight non-breaking spaces. */
+ /* Name and number of the face used to highlight non-breaking
+ spaces/hyphens. */
DEFSYM (Qnobreak_space, "nobreak-space");
+ DEFSYM (Qnobreak_hyphen, "nobreak-hyphen");
/* The symbol 'image' which is the car of the lists used to represent
images in Lisp. Also a tool bar style. */
doc: /* Control highlighting of non-ASCII space and hyphen chars.
If the value is t, Emacs highlights non-ASCII chars which have the
same appearance as an ASCII space or hyphen, using the `nobreak-space'
-or `escape-glyph' face respectively.
+or `nobreak-hyphen' face respectively.
U+00A0 (no-break space), U+00AD (soft hyphen), U+2010 (hyphen), and
U+2011 (non-breaking hyphen) are affected.