diff options
| author | Eli Zaretskii | 2023-08-05 17:55:56 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2023-08-05 17:55:56 +0300 |
| commit | a06a2950e168dddcbf1c3cd14697875d93a4f9ff (patch) | |
| tree | af9e6fc2c54a97ce6996eb731f5abae810e93770 /lisp/language | |
| parent | 60e5f212182ca2f41f89a4315075e38433bc8ac0 (diff) | |
| download | emacs-a06a2950e168dddcbf1c3cd14697875d93a4f9ff.tar.gz emacs-a06a2950e168dddcbf1c3cd14697875d93a4f9ff.zip | |
Allow user control on char-width of "ambiguous" characters
* src/character.c (syms_of_character) <ambiguous-width-chars>: New
char-table.
* lisp/international/characters.el (ambiguous-width-chars): Fill
the table.
(update-cjk-ambiguous-char-widths): New function.
(cjk-ambiguous-chars-are-wide): New defcustom, uses
'update-cjk-ambiguous-char-widths' as its :set function.
(use-cjk-char-width-table): Obey 'cjk-ambiguous-chars-are-wide' by
adding another child char-table for ambiguous-width characters,
where the width is set according to the option.
* lisp/language/chinese.el ("Chinese-GB", "Chinese-BIG5")
("Chinese-CNS", "Chinese-EUC-TW", "Chinese-GBK"):
* lisp/language/japanese.el ("Japanese"):
* lisp/language/korean.el ("Korean"): Add new language-info slot
'cjk-locale-symbol'.
Bug#64420
Diffstat (limited to 'lisp/language')
| -rw-r--r-- | lisp/language/chinese.el | 5 | ||||
| -rw-r--r-- | lisp/language/japanese.el | 1 | ||||
| -rw-r--r-- | lisp/language/korean.el | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/lisp/language/chinese.el b/lisp/language/chinese.el index 26f1194aa4c..e35f3f179ad 100644 --- a/lisp/language/chinese.el +++ b/lisp/language/chinese.el | |||
| @@ -111,6 +111,7 @@ | |||
| 111 | (set-language-info-alist | 111 | (set-language-info-alist |
| 112 | "Chinese-GB" '((charset chinese-gb2312 chinese-sisheng) | 112 | "Chinese-GB" '((charset chinese-gb2312 chinese-sisheng) |
| 113 | (iso639-language . zh) | 113 | (iso639-language . zh) |
| 114 | (cjk-locale-symbol . zh_CN) | ||
| 114 | (setup-function . (lambda () | 115 | (setup-function . (lambda () |
| 115 | (use-cjk-char-width-table 'zh_CN))) | 116 | (use-cjk-char-width-table 'zh_CN))) |
| 116 | (exit-function . use-default-char-width-table) | 117 | (exit-function . use-default-char-width-table) |
| @@ -142,6 +143,7 @@ | |||
| 142 | (set-language-info-alist | 143 | (set-language-info-alist |
| 143 | "Chinese-BIG5" '((charset chinese-big5-1 chinese-big5-2) | 144 | "Chinese-BIG5" '((charset chinese-big5-1 chinese-big5-2) |
| 144 | (iso639-language . zh) | 145 | (iso639-language . zh) |
| 146 | (cjk-locale-symbol . zh_HK) | ||
| 145 | (setup-function . (lambda () | 147 | (setup-function . (lambda () |
| 146 | (use-cjk-char-width-table 'zh_HK))) | 148 | (use-cjk-char-width-table 'zh_HK))) |
| 147 | (exit-function . use-default-char-width-table) | 149 | (exit-function . use-default-char-width-table) |
| @@ -198,6 +200,7 @@ | |||
| 198 | chinese-cns11643-5 chinese-cns11643-6 | 200 | chinese-cns11643-5 chinese-cns11643-6 |
| 199 | chinese-cns11643-7) | 201 | chinese-cns11643-7) |
| 200 | (iso639-language . zh) | 202 | (iso639-language . zh) |
| 203 | (cjk-locale-symbol . zh_TW) | ||
| 201 | (setup-function . (lambda () | 204 | (setup-function . (lambda () |
| 202 | (use-cjk-char-width-table 'zh_TW))) | 205 | (use-cjk-char-width-table 'zh_TW))) |
| 203 | (exit-function . use-default-char-width-table) | 206 | (exit-function . use-default-char-width-table) |
| @@ -218,6 +221,7 @@ accepts Big5 for input also (which is then converted to CNS).")) | |||
| 218 | chinese-cns11643-5 chinese-cns11643-6 | 221 | chinese-cns11643-5 chinese-cns11643-6 |
| 219 | chinese-cns11643-7 chinese-big5-1 chinese-big5-2) | 222 | chinese-cns11643-7 chinese-big5-1 chinese-big5-2) |
| 220 | (iso639-language . zh) | 223 | (iso639-language . zh) |
| 224 | (cjk-locale-symbol . zh_TW) | ||
| 221 | (setup-function . (lambda () | 225 | (setup-function . (lambda () |
| 222 | (use-cjk-char-width-table 'zh_TW))) | 226 | (use-cjk-char-width-table 'zh_TW))) |
| 223 | (exit-function . use-default-char-width-table) | 227 | (exit-function . use-default-char-width-table) |
| @@ -248,6 +252,7 @@ converted to CNS).")) | |||
| 248 | (set-language-info-alist | 252 | (set-language-info-alist |
| 249 | "Chinese-GBK" '((charset chinese-gbk) | 253 | "Chinese-GBK" '((charset chinese-gbk) |
| 250 | (iso639-language . zh) | 254 | (iso639-language . zh) |
| 255 | (cjk-locale-symbol . zh_CN) | ||
| 251 | (setup-function . (lambda () | 256 | (setup-function . (lambda () |
| 252 | (use-cjk-char-width-table 'zh_CN))) | 257 | (use-cjk-char-width-table 'zh_CN))) |
| 253 | (exit-function . use-default-char-width-table) | 258 | (exit-function . use-default-char-width-table) |
diff --git a/lisp/language/japanese.el b/lisp/language/japanese.el index 681dc9d7b92..6042ebf4511 100644 --- a/lisp/language/japanese.el +++ b/lisp/language/japanese.el | |||
| @@ -208,6 +208,7 @@ eucJP-ms is defined in <http://www.opengroup.or.jp/jvc/cde/appendix.html>." | |||
| 208 | "Japanese" '((setup-function . setup-japanese-environment-internal) | 208 | "Japanese" '((setup-function . setup-japanese-environment-internal) |
| 209 | (exit-function . use-default-char-width-table) | 209 | (exit-function . use-default-char-width-table) |
| 210 | (iso639-language . ja) | 210 | (iso639-language . ja) |
| 211 | (cjk-locale-symbol . ja_JP) | ||
| 211 | (tutorial . "TUTORIAL.ja") | 212 | (tutorial . "TUTORIAL.ja") |
| 212 | (charset japanese-jisx0208 | 213 | (charset japanese-jisx0208 |
| 213 | japanese-jisx0212 latin-jisx0201 katakana-jisx0201 | 214 | japanese-jisx0212 latin-jisx0201 katakana-jisx0201 |
diff --git a/lisp/language/korean.el b/lisp/language/korean.el index fef5796bc4b..ede37d5d07c 100644 --- a/lisp/language/korean.el +++ b/lisp/language/korean.el | |||
| @@ -68,6 +68,7 @@ | |||
| 68 | (set-language-info-alist | 68 | (set-language-info-alist |
| 69 | "Korean" '((setup-function . setup-korean-environment-internal) | 69 | "Korean" '((setup-function . setup-korean-environment-internal) |
| 70 | (exit-function . exit-korean-environment) | 70 | (exit-function . exit-korean-environment) |
| 71 | (cjk-locale-symbol . ko_KR) | ||
| 71 | (iso639-language . ko) | 72 | (iso639-language . ko) |
| 72 | (tutorial . "TUTORIAL.ko") | 73 | (tutorial . "TUTORIAL.ko") |
| 73 | (charset korean-ksc5601 cp949) | 74 | (charset korean-ksc5601 cp949) |