bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#44236: [PATCH] xdisp: Apply nobreak-char-display also to NARROW NO-B


From: Neil Roberts
Subject: bug#44236: [PATCH] xdisp: Apply nobreak-char-display also to NARROW NO-BREAK SPACE U+202F
Date: Mon, 26 Oct 2020 12:13:48 +0100

U+202F is like the normal non-breaking space character except that it
is slightly narrower. In the French language, this character is
supposed to be used before most punctation marks such as question
marks and quote characters. For people using the BÉPO keyboard layout,
this character is typed with just shift+space, so it’s quite easy to
accidentally type it. For that reason it would be nice if it was
displayed differently like the regular non-breaking space. This patch
makes that change.

* src/charcter.h: Add an enum for the U+202F character.
* src/xdisp.c (get_next_display_element): Use nobreak_space face also
for U+202F.
---
 src/character.h | 1 +
 src/xdisp.c     | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git src/character.h src/character.h
index af5023f77c..90708c8d38 100644
--- src/character.h
+++ src/character.h
@@ -69,6 +69,7 @@ #define EMACS_CHARACTER_H
 enum
 {
   NO_BREAK_SPACE = 0x00A0,
+  NARROW_NO_BREAK_SPACE = 0x202F,
   SOFT_HYPHEN = 0x00AD,
   ZERO_WIDTH_NON_JOINER = 0x200C,
   ZERO_WIDTH_JOINER = 0x200D,
diff --git src/xdisp.c src/xdisp.c
index 5a62cd6eb5..0772066f8a 100644
--- src/xdisp.c
+++ 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 (c == NO_BREAK_SPACE || c == NARROW_NO_BREAK_SPACE)
                nonascii_space_p = true;
              else if (c == SOFT_HYPHEN || c == HYPHEN
                       || c == NON_BREAKING_HYPHEN)
-- 
2.25.4





reply via email to

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