diff options
| author | Eli Zaretskii | 2019-09-07 12:19:06 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2019-09-07 12:19:06 +0300 |
| commit | 7eaca940ceecc812d6099de64bf7e7a5081fdfb2 (patch) | |
| tree | 80104bc7e43a24f7f855a5cfb1ca8d038f6dced0 | |
| parent | f42509955901bbc81284b5141cf272a1f6c6ad4c (diff) | |
| download | emacs-7eaca940ceecc812d6099de64bf7e7a5081fdfb2.tar.gz emacs-7eaca940ceecc812d6099de64bf7e7a5081fdfb2.zip | |
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)
| -rw-r--r-- | lisp/composite.el | 4 | ||||
| -rw-r--r-- | src/composite.c | 7 |
2 files changed, 6 insertions, 5 deletions
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 | |||
| 558 | ;; "Improper" base characters are of the following general | 558 | ;; "Improper" base characters are of the following general |
| 559 | ;; categories: | 559 | ;; categories: |
| 560 | ;; Mark (nonspacing, combining, enclosing) | 560 | ;; Mark (nonspacing, combining, enclosing) |
| 561 | ;; Separator (space, line, paragraph) | 561 | ;; Separator (line, paragraph) |
| 562 | ;; Other (control, format, surrogate) | 562 | ;; Other (control, format, surrogate) |
| 563 | '(Mn Mc Me Zs Zl Zp Cc Cf Cs)) | 563 | '(Mn Mc Me Zl Zp Cc Cf Cs)) |
| 564 | nil) | 564 | nil) |
| 565 | 565 | ||
| 566 | ;; A base character and the following non-spacing characters. | 566 | ;; 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, | |||
| 919 | } | 919 | } |
| 920 | 920 | ||
| 921 | /* 1 iff the character C is composable. Characters of general | 921 | /* 1 iff the character C is composable. Characters of general |
| 922 | category Z? or C? are not composable except for ZWNJ and ZWJ. */ | 922 | category Z? or C? are not composable except for ZWNJ and ZWJ, |
| 923 | and characters of category Zs. */ | ||
| 923 | 924 | ||
| 924 | static bool | 925 | static bool |
| 925 | char_composable_p (int c) | 926 | char_composable_p (int c) |
| 926 | { | 927 | { |
| 927 | Lisp_Object val; | 928 | Lisp_Object val; |
| 928 | return (c > ' ' | 929 | return (c >= ' ' |
| 929 | && (c == ZERO_WIDTH_NON_JOINER || c == ZERO_WIDTH_JOINER | 930 | && (c == ZERO_WIDTH_NON_JOINER || c == ZERO_WIDTH_JOINER |
| 930 | || (val = CHAR_TABLE_REF (Vunicode_category_table, c), | 931 | || (val = CHAR_TABLE_REF (Vunicode_category_table, c), |
| 931 | (FIXNUMP (val) && (XFIXNUM (val) <= UNICODE_CATEGORY_So))))); | 932 | (FIXNUMP (val) && (XFIXNUM (val) <= UNICODE_CATEGORY_Zs))))); |
| 932 | } | 933 | } |
| 933 | 934 | ||
| 934 | /* Update cmp_it->stop_pos to the next position after CHARPOS (and | 935 | /* Update cmp_it->stop_pos to the next position after CHARPOS (and |