From: Eli Zaretskii Date: Sat, 7 Sep 2019 09:19:06 +0000 (+0300) Subject: Allow Zs characters to be composed X-Git-Tag: emacs-27.0.90~1553^2~20 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7eaca940ceecc812d6099de64bf7e7a5081fdfb2;p=emacs.git Allow Zs characters to be composed * src/composite.c (char_composable_p): Allow SPC and other Zs characters to be composed. * lisp/composite.el (compose-gstring-for-graphic): Don't reject characters whose general category is Zs. (Bug#14461) --- diff --git a/lisp/composite.el b/lisp/composite.el index d0f20949438..b3661cc2fa0 100644 --- a/lisp/composite.el +++ b/lisp/composite.el @@ -558,9 +558,9 @@ All non-spacing characters have this function in ;; "Improper" base characters are of the following general ;; categories: ;; Mark (nonspacing, combining, enclosing) - ;; Separator (space, line, paragraph) + ;; Separator (line, paragraph) ;; Other (control, format, surrogate) - '(Mn Mc Me Zs Zl Zp Cc Cf Cs)) + '(Mn Mc Me Zl Zp Cc Cf Cs)) nil) ;; A base character and the following non-spacing characters. diff --git a/src/composite.c b/src/composite.c index a6606d5fc45..efbd055cef2 100644 --- a/src/composite.c +++ b/src/composite.c @@ -919,16 +919,17 @@ autocmp_chars (Lisp_Object rule, ptrdiff_t charpos, ptrdiff_t bytepos, } /* 1 iff the character C is composable. Characters of general - category Z? or C? are not composable except for ZWNJ and ZWJ. */ + category Z? or C? are not composable except for ZWNJ and ZWJ, + and characters of category Zs. */ static bool char_composable_p (int c) { Lisp_Object val; - return (c > ' ' + return (c >= ' ' && (c == ZERO_WIDTH_NON_JOINER || c == ZERO_WIDTH_JOINER || (val = CHAR_TABLE_REF (Vunicode_category_table, c), - (FIXNUMP (val) && (XFIXNUM (val) <= UNICODE_CATEGORY_So))))); + (FIXNUMP (val) && (XFIXNUM (val) <= UNICODE_CATEGORY_Zs))))); } /* Update cmp_it->stop_pos to the next position after CHARPOS (and