From: Qiantan Hong <qhong@mit.edu>
To: EMACS development team <emacs-devel@gnu.org>
Subject: Behavior of input method -- crdt.el
Date: Sun, 18 Oct 2020 03:47:44 +0000 [thread overview]
Message-ID: <EDBC4D89-1CE6-48A7-A96E-C1D0010BB4FD@mit.edu> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1446 bytes --]
Hi,
I’m now working on the compatibility between
https://code.librehq.com/qhong/crdt.el <https://code.librehq.com/qhong/crdt.el> and Emacs input methods.
There might be the case that one peer is in the halfway of input
some characters using input method (it seems that at this state,
there are some temporary text inserted in the buffer without calling
*-change-functions), and some changes from other peer arrives.
After resolving the position of the changes, crdt.el move point
to the resolved position and use INSERT to insert the characters
from remote peer.
In the case that these other changes happen to at exactly the same
position that current user is inserting using input method, seems that
the input method get confused and consider those inserted character
as part of its halfway input. It doesn’t affect character selection, but
when user finally select a character, it erase both the halfway input
and the inserted remote characters. Now the peers are inconsistent.
Anyone have any idea on how to workaround this?
To be more clear, a concrete example:
User1 is typing using chinese-py.
User1’s buffer: ce
User2’s buffer:
User2 type a “t” at the begining
User1’s buffer: tce
User2’s buffer: t
User1 finish selection
User1’s buffer: 测
User2’s buffer: t测
Notice that the input method also erase t.
Now both user’s buffers are inconsistent.
Best,
Qiantan
[-- Attachment #1.2: Type: text/html, Size: 3317 bytes --]
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 1858 bytes --]
next reply other threads:[~2020-10-18 3:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-18 3:47 Qiantan Hong [this message]
2020-10-18 4:46 ` Behavior of input method -- crdt.el Eli Zaretskii
2020-10-18 13:26 ` Stefan Monnier
2020-10-18 20:34 ` Qiantan Hong
2020-10-18 20:52 ` Stefan Monnier
2020-10-19 2:28 ` Eli Zaretskii
2020-10-19 2:48 ` Qiantan Hong
2020-10-19 3:07 ` Stefan Monnier
2020-10-19 14:29 ` Eli Zaretskii
2020-10-19 14:55 ` Qiantan Hong
2020-10-19 15:06 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=EDBC4D89-1CE6-48A7-A96E-C1D0010BB4FD@mit.edu \
--to=qhong@mit.edu \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).