emacs-diffs
[Top][All Lists]
Advanced

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

master f018cff: Use nobreak-space on all non-ASCII whitespace characters


From: Lars Ingebrigtsen
Subject: master f018cff: Use nobreak-space on all non-ASCII whitespace characters
Date: Fri, 30 Oct 2020 08:13:55 -0400 (EDT)

branch: master
commit f018cffca0098ad1b82c51730a6d6cf146e3c488
Author: Neil Roberts <bpeeluk@yahoo.co.uk>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Use nobreak-space on all non-ASCII whitespace characters
    
    * doc/emacs/display.texi (Text Display): Document it.
    
    * src/xdisp.c (get_next_display_element): Use blankp to test whether
    to use the nobreak_space face (bug#44236).
---
 doc/emacs/display.texi | 3 ++-
 etc/NEWS               | 6 ++++++
 src/xdisp.c            | 5 +++--
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index dd2c6e2..02859d5 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1608,7 +1608,8 @@ can cause problems if they are entered into a buffer 
without your
 realization, e.g., by yanking; for instance, source code compilers
 typically do not treat non-@acronym{ASCII} spaces as whitespace
 characters.  To deal with this problem, Emacs displays such characters
-specially: it displays @code{U+00A0} (no-break space) with the
+specially: it displays @code{U+00A0} (no-break space) and other
+characters from the Unicode horizontal space class 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{nobreak-hyphen} face.  To disable this, change
diff --git a/etc/NEWS b/etc/NEWS
index 8504186..11783ef 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -163,6 +163,12 @@ your init file:
     (setq frame-title-format '(multiple-frames "%b"
                               ("" invocation-name "@" system-name)))
 
++++
+** 'nobreak-char-display' now also affects all non-ASCII space characters.
+Previously, this was limited only to NO-BREAK-SPACE and hyphen
+characters.  Now it also covers the rest of the non-ASCII Unicode
+space characters.
+
 
 * Editing Changes in Emacs 28.1
 
diff --git a/src/xdisp.c b/src/xdisp.c
index 5c80e37..0e5dffb 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7555,7 +7555,7 @@ get_next_display_element (struct it *it)
             non-ASCII spaces and hyphens specially.  */
          if (! ASCII_CHAR_P (c) && ! NILP (Vnobreak_char_display))
            {
-             if (c == NO_BREAK_SPACE)
+             if (blankp (c))
                nonascii_space_p = true;
              else if (c == SOFT_HYPHEN || c == HYPHEN
                       || c == NON_BREAKING_HYPHEN)
@@ -34747,7 +34747,8 @@ 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 `nobreak-hyphen' face respectively.
 
-U+00A0 (no-break space), U+00AD (soft hyphen), U+2010 (hyphen), and
+All of the non-ASCII characters in the Unicode horizontal whitespace
+character class, as well as U+00AD (soft hyphen), U+2010 (hyphen), and
 U+2011 (non-breaking hyphen) are affected.
 
 Any other non-nil value means to display these characters as an escape



reply via email to

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