Skip to content
operational 47.2 KiB
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.
- 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.

  - 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.

* wontfix                                                             :entry:
** 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.

** 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.