mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-05 11:45:45 +00:00
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).
This commit is contained in:
parent
02ecbf58e4
commit
f018cffca0
@ -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
|
||||
|
6
etc/NEWS
6
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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user