Newer
Older
add a zero-full-width-mode variable
add default binding shift+space, M-x zero-toggle-full-width-mode
use modeline LIGHTER to show full/half width mode.
when in full-width mode, show ZeroF.
FSM table:
move from gtk-im-module-zero operational file.
- updated FSM.
so it's only a few changes.
- when insert character that can't start a sequence, insert char should be
full-width aware.
zero-self-insert-command
DONE zero-commit-preedit-str
DONE zero-convert-punctuation
- when commit preedit str, insert should be full-width aware.
- when insert Chinese punctuation character, insert should be full-width aware.
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
- problems
- where is the GB standard file?
- docs
GB/T 15834―2011 标点符号用法 电子版
http://people.ubuntu.com/~happyaron/l10n/GB(T)15834-2011.html
doesn't have much about full width vs half width.
- indeed double quotation mark is different from fullwidth quotation mark.
LEFT DOUBLE QUOTATION MARK “”
FULLWIDTH QUOTATION MARK ""
- search U+FF02
U+FF02 FULLWIDTH QUOTATION MARK – Codepoints
https://codepoints.net/U+FF02
Block Halfwidth and Fullwidth Forms – Codepoints
https://codepoints.net/halfwidth_and_fullwidth_forms
- why bind S-SPC key in zero-mode-map didn't work.
global-set-key does work.
shift-space is always translated to space in minor mode?
shift is not registered as key prefix.
I will just use another key binding for this command.
try M-space. nope.
https://www.gnu.org/software/emacs/manual/html_node/elisp/Keymaps-and-Minor-Modes.html#Keymaps-and-Minor-Modes
Minor modes may bind commands to key sequences consisting of C-c followed
by a punctuation character. However, sequences consisting of C-c followed
by one of {}<>:;, or a control character or digit, are reserved for major
modes. Also, C-c letter is reserved for users. See Key Binding
Conventions.
try use C-c , , and C-c , .
how to add C-c , as prefix key and add binding for those two commands?
it works.
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
- elisp how to convert unicode hex to char?
1. Non-ASCII Characters
https://ftp.gnu.org/old-gnu/Manuals/elisp-manual-21-2.8/html_chapter/elisp_33.html#SEC541
FF01 to FF65 only 65 chars. I will just type it.
"\uff01" !
char to code point:
(split-char ?\)(unicode 0 255 1)
# FF01
(split-char ?\!)(unicode 0 255 1)
(insert (make-char 'unicode 0 255 1))
(split-char ?\!)(ascii 33)
# FF5A
(split-char ?\z)(unicode 0 255 90)
(insert (make-char 'unicode 0 255 90))
(split-char ?\z)(ascii 122)
# FF65
(split-char ?\・)(unicode 0 255 101)
(insert (make-char 'unicode 0 255 101))
ascii [33, 122]
map to
unicode 0 255 [1, 101].
then pick a few others if they are of importance.
- commit preedit str in full-width mode didn't work.
it still commit half-width str.
is zero-commit-preedit-str called at all? there is no debug message.
that is for commit preedit-str when there is no candidate.
when I press RET, the code is in zero-return.
- type = will insert both full-width char and half-width char.
fixed.
** 2020-02-20 gitlab doesn't render README as org-mode file.
github does render it.
should I name it README.org?
- does gitlab newer version support parsing mode line?
search: gitlab parse mode line from README file
search: gitlab render README file without suffix
gitlab only support markdown, ascii doc and rst. org-mode is not supported.
add .org suffix won't help gitlab.
Either keep it or rewrite it as markdown or rst.
I will keep it.
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
** 2020-02-04 zero-input-pinyin-pending-preedit-str="erduo" not correct?
- zero-input-pinyin-pending-preedit-str="erduo"
zero-input-pinyin-pending-preedit-str
this variable may not be cleared at proper place.
#+BEGIN_SRC sh
synchronously
candidates: 摩尔, 莫尔, 末儿, 模, 默, 麽, 莫, 摸, 末, 磨
user typed: d
still preediting
appended d, preedit str is: moerd
zero-input-pinyin building candidate list synchronously
candidates: 摸耳朵, 莫尔德, 摩尔, 莫尔, 末儿, 模, 默, 麽, 莫, 摸
user typed: u
still preediting
appended u, preedit str is: moerdu
zero-input-pinyin building candidate list synchronously
candidates: 摩尔, 莫尔, 末儿, 模, 默, 麽, 莫, 摸, 末, 磨
user typed: o
still preediting
appended o, preedit str is: moerduo
zero-input-pinyin building candidate list synchronously
candidates: 摸耳朵, 摩尔, 莫尔, 末儿, 模, 默, 麽, 莫, 摸, 末
user typed:
still preediting
zero-input-pinyin-commit-nth-candidate
n=0 candidate=摸耳朵 used-len=7 zero-input-pinyin-pending-preedit-str="erduo"
commit in full
set state to IM-WAITING-INPUT
zero-input-disable-preediting-map
commit text: 摸耳朵
hide candidate list
user typed: d
can start sequence, state=IM_PREEDITING
set state to IM-PREEDITING
zero-input-enable-preediting-map
appended d, preedit str is: d
zero-input-pinyin building candidate list synchronously
candidates: 的, 都, 到, 等, 第, 带, 大, 对, 当, 低
user typed: u
still preediting
appended u, preedit str is: du
zero-input-pinyin building candidate list synchronously
candidates: 度, 赌, 读, 独, 毒, 都, 肚, 督, 渡, 杜
user typed: i
still preediting
appended i, preedit str is: dui
zero-input-pinyin building candidate list synchronously
candidates: 对, 队, 堆, 對, 兑, 隊, 怼, 碓, 桘, 憝
user typed: b
still preediting
appended b, preedit str is: duib
zero-input-pinyin building candidate list synchronously
candidates: 对比, 对白, 对本, 对不, 对吧, 对被, 对表, 对半, 对把, 对边
user typed: u
still preediting
appended u, preedit str is: duibu
zero-input-pinyin building candidate list synchronously
candidates: 对不, 队部, 对, 队, 堆, 對, 兑, 隊, 怼, 碓
user typed: q
still preediting
appended q, preedit str is: duibuq
zero-input-pinyin building candidate list synchronously
candidates: 对不起, 对不, 队部, 对, 队, 堆, 對, 兑, 隊, 怼
user typed: i
still preediting
appended i, preedit str is: duibuqi
zero-input-pinyin building candidate list synchronously
candidates: 对不起, 对不, 队部, 对, 队, 堆, 對, 兑, 隊, 怼
user typed:
still preediting
zero-input-pinyin-commit-nth-candidate
n=0 candidate=对不起 used-len=7 zero-input-pinyin-pending-preedit-str="erduo"
commit in full
set state to IM-WAITING-INPUT
zero-input-disable-preediting-map
commit text: 对不起
hide candidate list
#+END_SRC
I can redproduce it.
just delete the user phrase, then type it again.
#+BEGIN_SRC sh
user typed: o
still preediting
appended o, preedit str is: moerduo
zero-input-pinyin building candidate list synchronously
candidates: 摸耳朵, 摩尔, 莫尔, 末儿, 模, 默, 麽, 莫, 摸, 末
zero-input-pinyin building candidate list synchronously
candidates: 摩尔, 莫尔, 末儿, 模, 默, 麽, 莫, 摸, 末, 磨
user typed: 8
still preediting
zero-input-pinyin-commit-nth-candidate
n=7 candidate=摸 used-len=2 zero-input-pinyin-pending-preedit-str=""
partial commit, in partial commit mode now.
zero-input-pinyin building candidate list synchronously
candidates: 耳朵, 尔多, 而多, 尔, 耳, 而, 儿, 二, 兒, 爾
user typed:
still preediting
zero-input-pinyin-commit-nth-candidate
n=0 candidate=耳朵 used-len=5 zero-input-pinyin-pending-preedit-str="erduo"
finishes partial commit
set state to IM-WAITING-INPUT
zero-input-disable-preediting-map
commit text: 摸耳朵
hide candidate list
#+END_SRC
This is not a bug. zero-input-pinyin-pending-preedit-str is not used
when IM has not go to partial commit mode. it will always be set to
correct value when it does go to partial commit mode.