Newer
Older
* COMMENT -*- mode: org -*-
#+Date: 2019-10-08
#+STARTUP: content
* notes :entry:
** 2019-04-01 zero-el a Chinese IM framework in emacs; FSM :doc:
title was: how to write a modern im for emacs.
cd ~/lisp/elisp/zero/
- DONE can I implement it as a minor mode? yes.
- DONE can I use panel to show candidates? yes.
- zero minor mode FSM
| Imp | state | action | next state | trigger action |
|-----+------------------+-----------------------------------------------------+------------------+---------------------------------------------------------------------------------------------------------|
| Y | IM_OFF | M-x zero-input-on or zero-input-toggle | IM_WAITING_INPUT | turn on minor mode |
| Y | IM_WAITING_INPUT | type M-x zero-input-off or zero-input-toggle | IM_OFF | turn off minor mode |
| Y | IM_WAITING_INPUT | type character that can start a sequence | IM_PREEDITING | update preedit str, show candidate list |
| Y | IM_WAITING_INPUT | type character that can not start a sequence | IM_WAITING_INPUT | insert character (full-width aware) |
| Y | IM_WAITING_INPUT | type [,.?!\] | IM_WAITING_INPUT | insert Chinese punctuation character (full-width aware) |
| Y | IM_PREEDITING | type character (that is not SPC, digit keys) | IM_PREEDITING | update preedit str, update and show candidate list |
| Y | IM_PREEDITING | type RET | IM_WAITING_INPUT | commit preedit str (full-width aware), hide candidate list, reset preedit str |
| Y | IM_PREEDITING | type SPC | IM_WAITING_INPUT | commit first candidate or preedit str (full-width aware), reset preedit str |
| Y | IM_PREEDITING | type digit keys | IM_WAITING_INPUT | commit nth candidate if it exists, otherwise, append to preedit str |
| | IM_PREEDITING | type C-g | IM_WAITING_INPUT | reset IM (reset preedit str, hide candidate list) |
| Y | IM_PREEDITING | type M-x zero-input-off or zero-input-toggle | IM_OFF | reset IM, turn off minor mode |
| Y | IM_PREEDITING | type <backspace>, when preedit str is longer than 1 | IM_PREEDITING | update preedit str, update and show candidate list |
| Y | IM_PREEDITING | type <backspace>, when preedit str is length 1 | IM_WAITING_INPUT | reset IM |
| Y | IM_PREEDITING | focus in | IM_PREEDITING | show candidat list |
| Y | IM_PREEDITING | focus out | IM_PREEDITING | hide panel |
| Y | IM_PREEDITING | type [,.?!\] | IM_WAITING_INPUT | commit first candidate or preedit str (full-width aware), insert Chinese punctuation (full-width aware) |
| Y | IM_PREEDITING | type -/= | IM_PREEDITING | candiate page up/down |
| | | | | |
in IM_OFF state, zero should not do any preedit try nor do punctuation
translate.
- DONE make zero-input-quickdial IM work in emacs.
see ~/lisp/elisp/zero/zero-input-quickdial.el
- DONE make zero-input-table IM work in emacs. with zero-input-panel.
see ~/lisp/elisp/zero/zero-input-table.el
- during development, press F8 to byte-compile and load the current el file.
this will also look for errors in the file.
press F9 to run ert tests.
- TODOs
- whenever a command moves point, IM should probably reset()
I can't remap every possible key/function.
- I need hook for buffer/window focus in/out.
currently, when user switch to another buffer, the panel will still show.
user can click mouse in another emacs window.
whenever focus is moved outside current buffer, I need a hook to run
how to reproduce the problem
=============================
open emacs, split, top window show buffer with file t3, bottom window show
buffer with file t4.
in t3 buffer, press F1 to toggle zero on. type "a", candidate list will
show. now press C-x o to switch to t4 buffer. candidate list didn't go
away. because I can't find a hook for it.
the mouse case:
=================
open emacs, split, top window show buffer with file t3, bottom window show
buffer with file t4.
in t3 buffer, press F1 to toggle zero on. type "a", candidate list will
show. now click mouse on t4 buffer. candidate list didn't go away. because
I can't find a hook for it.
- how to check whether string contains character?
without converting char to string.
(zero-input-table-can-start-sequence) can use this.
** 2020-02-04 how to make a release? :doc:
- update version number in zero-input-framework.el
- run tests
make check
- build a release .el file
make dist
- check & fix styling issues
open zero-input.el file
M-x checkdoc
M-x package-lint-current-buffer
- test zero-input.el in a fresh emacs -Q window.
(load-file "~/.emacs.d/elpa/s-1.11.0/s.elc")
(byte-compile-file "~/lisp/elisp/zero/zero-input.el" t)
(global-set-key (kbd "<f1>") 'zero-input-mode)
(zero-input-set-default-im "pinyin")
now in some buffer,
press F1 and start typing.
- make a git commit in master branch.
- copy zero-input.el over to pkg branch.
make a git commit in pkg branch.
tag it if it is a stable release.
- push commits.
push tags if it is a stable release.
** 2019-10-10 documents
- Using of D-Bus
https://www.gnu.org/software/emacs/manual/html_mono/dbus.html
- Travis CI
The Ubuntu 18.04 Build Environment - Travis CI
https://docs.travis-ci.com/user/reference/bionic/
Installing Dependencies - Travis CI
https://docs.travis-ci.com/user/installing-dependencies
Customizing the Build - Travis CI
https://docs.travis-ci.com/user/customizing-the-build#build-matrix
Testing Your Project on Multiple Operating Systems - Travis CI
https://docs.travis-ci.com/user/multi-os/
* later :entry:
* current :entry:
**
** 2020-02-21 zero-pinyin-service and zero-panel should recommend or suggest dbus pkg.
I don't know it should recommend or suggest.
** 2019-10-23 checkdoc and package-lint can't ignore some non-issues.
I can't run them in git pre-commit hook.
* done :entry:
** 2020-02-21 org-mode, click badge should link to the pkg. not the image file.
need to drop ?branch=master
it works.
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
** 2020-02-20 integrate travis CI support.
just run "make dist-check".
- problems
- how to run on both debian 9, 10 and ubuntu 18.04?
The Ubuntu 18.04 Build Environment - Travis CI
https://docs.travis-ci.com/user/reference/bionic/
There is no debian image on Travis CI.
- how to install s pkg when run on travis CI?
if ~/.emacs.d/elpa/s-1.11.0/s.el doesn't exist, install s and load it first.
how to use package-install with package-desc?
(package-install "s")
(package-install "s-1.12.0")
search: (error "Package `s-' is unavailable")
Package 's-' is unavailable · Issue #373 · cask/cask
https://github.com/cask/cask/issues/373
elisp - Emacs's package-install inserts an extra dash at the end of the package - Stack Overflow
https://stackoverflow.com/questions/36338528/emacss-package-install-inserts-an-extra-dash-at-the-end-of-the-package
wat?
I don't think this is the problem. In my setup, melpa is not the first element.
I will cheat. Just download the file from github when run on travis CI.
https://github.com/magnars/s.el
- how to run it on emacs24, emacs25, emacs26?
emacs24-nox is on xenial 16.04
emacs25-nox is on bionic 18.04
emacs26 is not in ubuntu yet.
How to Install GNU Emacs 26.1 in Ubuntu 18.04, 16.04, 18.10 | UbuntuHandbook
http://ubuntuhandbook.org/index.php/2019/02/install-gnu-emacs-26-1-ubuntu-18-04-16-04-18-10/
https://launchpad.net/~kelleyk/+archive/ubuntu/emacs
sudo add-apt-repository ppa:kelleyk/emacs
sudo apt update
sudo apt install emacs26
I will ignore emacs26 for now.
- travis forces venv, doesn't allow install to user site-packages.
https://docs.travis-ci.com/user/languages/python/
to use --user you just need to not use "language: python".
I will use language: python and fix the command.
- DONE elisp tests need access to GetCandidatesV2 dbus method.
zero-input-pinyin-service-get-candidates
why?
this is good. I can install the deb in travis container.
- DONE emacs run ert test doesn't exit with non-zero code when there are errors.
it needs a wrapper function.
ert-run-tests-batch
Returns the stats object.
ert-run-tests-batch-and-exit
nice.
- travis: no access to session bus.
how to start dbus session bus when x is not running?
search: travis start dbus session bus
Loading full blame...