Bug 1135759 - The rusle is broken with "Normal commit mode"
Summary: The rusle is broken with "Normal commit mode"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ibus-table
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mike FABIAN
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-31 09:37 UTC by Stas Sergeev
Modified: 2014-09-30 01:55 UTC (History)
10 users (show)

Fixed In Version: ibus-table-1.9.0-1.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of: 1133127
Environment:
Last Closed: 2014-09-30 01:53:10 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
what-is-commit-to-preedit-shown-using-wubi-jidian86-as-an-example.png (444.46 KB, image/png)
2014-08-31 17:23 UTC, Mike FABIAN
no flags Details
right arrow pressed (117.45 KB, application/octet-stream)
2014-09-01 07:48 UTC, Stas Sergeev
no flags Details
left arrow pressed (117.99 KB, application/octet-stream)
2014-09-01 07:49 UTC, Stas Sergeev
no flags Details
0001-Disable-auto_commit-option-for-tables-which-do-not-h.patch (5.66 KB, patch)
2014-09-02 07:54 UTC, Mike FABIAN
no flags Details | Diff

Description Stas Sergeev 2014-08-31 09:37:19 UTC
+++ This bug was initially created as a clone of Bug #1133127 +++
--- Additional comment from Stas Sergeev on 2014-08-29 15:17:18 EDT ---

Hi Mike, I am hitting something really weird
now. Not sure when/why that started to happen.

In rusle mode now when I type, the last char
is always underlined. This is not a problem by
itself. The problem is that now if I hit a left
arrow button, this char gets selected, but I
can't move the cursor! Other arrow buttons do
not work too. And if, instead of arrow, I switch
back to EN, the last char, that was underlined,
gets erased! But at least then arrow keys start
to work again (until I switch back to rusle).

I guess I am hitting some super-duper cool ibus
feature that I occasionally enabled by a super-secret
key combo... just as it always happen. :)

--- Additional comment from Mike FABIAN on 2014-08-30 08:05:43 EDT ---

I guess you accidentally did hit Ctrl+/ which switches
between "Direct commit mode" and "Normal commit mode.

I.e. your settings are:

$ dconf dump /desktop/ibus/engine/table/rusle/
[/]
onechar=false
inputmode=1
lookuptablepagesize=9
lookuptableorientation=true
autowildcard=true
multiwildcardchar=''
singlewildcardchar=''
alwaysshowlookup=false
autoselect=true
endeffullwidthpunct=false
tabdeffullwidthpunct=false
spacekeybehavior=false
chinesemode=0
tabdeffullwidthletter=false
autocommit=false
endeffullwidthletter=false


"autocommit=false" is the culprit.

This option does not make any sense for rusle either.  For some
Chinese input methods it is important.

I am not yet sure whether I can disable that option for all non-CJK
input methods. Thinking  about it...

For most input methods, typing one character does not give a unique
result, like it does with rusle where each single character maps to
one other character and that’s it.

Even the Russian translit input method is not like that, for example
when typing C, it cannot yet commit the character to the application
because translit.txt contains:

C	Ц	1000
Ch	Ч	1000
CH	Ч	1000

Therefore, it has to wait whether a “h” or a “H” or something else
follows.  When typing a “C” with translit, Ц is shown underlined.
The underline shows you that it is in “preedit”, it has not yet been
passed to the application. Waiting for more input. Until a resulting
character is matched exactly by typing more input or by selecting a
character from the candidate list (if the option to show the candidate
list is on), you see something in preedit underlined.  Then, when the
input is unique or a candidate selected, the preedit is committed. In
case of translit, if you type "Cx”, the Ц is committed because it is
now known that Ch -> Ч is not possible anymore.

There are two ways to commit: Direct commit to the application or
commit to preedit. Committing to preedit makes it possible to type more
characters, commit them to preedit as well and create a possibly very
long preedit. Finally one can commit that long preedit manually by
typing space.

For some Chinese input methods, such as Wubi, this feature is used to
define new shortcuts. One types several Chinese characters, commits
them all to preedit, finally commits that preedit with space and then
a new shortcut for the whole Chinese string consisting of many Chinese
characters is automatically defined according to some rules.

That is completely useless for rusle.  rusle is a fixed conversion
table, no new shortcuts are ever defined.  Therefore, for rusle, that
“Normal commit mode” which commits to preedit is useless.

I must think whether I can automatically determine which tables need
this “Normal commit” option and which don’t to be able to disable it
automatically for tables where it makes no sense.

--- Additional comment from Mike FABIAN on 2014-08-30 08:14:58 EDT ---

By the way, if you open the setup tool for rusle,
at the bottom there is a button 

[Restore all defaults]

This button takes you to sane defaults for the current
table, i.e. defaults which are known to work well for that table.
In case of rusle, it also resets from "Normal commit" to "Direct commit".

--- Additional comment from Stas Sergeev on 2014-08-30 09:05:42 EDT ---

(In reply to Mike FABIAN from comment #36)
> In case of rusle, it also resets from "Normal commit" to "Direct commit".
Hello Mike, so when I see in the menu
"Direct commit mode", does it mean this is a current
mode, or it is a "click here to enter that mode" option?
Very ambiguous, how about a normal practice of a check boxes...

So: then I see in the menu "Direct commit mode", the bug
does not happen. When I see in the menu "Normal commit mode",
everything is screwed up.

--- Additional comment from Stas Sergeev on 2014-08-30 09:19:58 EDT ---

I also wonder why the user is supposed to
know what is "Normal commit" and "Direct commit".
IMHO a completely meaningless things, are they
really needed in the main language menu?

--- Additional comment from Mike FABIAN on 2014-08-30 13:31:39 EDT ---

(In reply to Stas Sergeev from comment #38)
> (In reply to Mike FABIAN from comment #36)
> > In case of rusle, it also resets from "Normal commit" to "Direct commit".
> Hello Mike, so when I see in the menu
> "Direct commit mode", does it mean this is a current
> mode,

Yes, that is the current mode.

> or it is a "click here to enter that mode" option?
> Very ambiguous, how about a normal practice of a check boxes...

Yes, it is a bit weird. One does not know to which mode it will
change when clicking.

In Chinese input methods, there is one menu entry which toggles between
5 states each time one clicks the menu entry:

0) Only simplified Chinese
1) Only traditional Chinese
2) Simplified Chinese preferred
3) Traditional Chinese preferred
4) All Chinese characters shown, no special preference

So after clicking the menu 5 times one is back to where one came from.

This is confusing and ugly.

I have on my todo list to replace these toggles in the menu
by sub-menus with check boxes. Probably that is what you suggest as well.
If you want to see how the sub-menus with check boxes look like,
you can see it in ibus-kkc (A Japanese input method).

There is one problem stopping me from doing that now: If one uses a
non-Gnome desktop, for example XFCE, then ibus can display a "floating
panel" which is always visible, not only when the menu is opened. This
"floating panel" always shows these options in form of colourful
icons. With mouse over, the icons show what it means and what mode one
will switch to when clicking it.

When one wants to change for example from the Chinese mode 0 to
Chinese mode 4 (as above), one can click one of these icons 4 times.
This is much faster than opening the menu 4 times and clicking on
a menu entry 4 times (lots of mouse movement!).

So it is ridiculous doing this via the menu, it is not so bad with the
floating panel. Some people like the floating panel.

> So: then I see in the menu "Direct commit mode", the bug
> does not happen. When I see in the menu "Normal commit mode",
> everything is screwed up.

Yes, "Normal commit mode" makes no sense whatsoever for rusle.
Therefore, "Direct commit mode" is the default for rusle. This option
in rusle.txt does make "Direct commit mode" the default:

### If true then the result string will be committed to client automatically.
### This should be used with AUTO_SELECT = TRUE.
AUTO_COMMIT = TRUE

"Normal commit mode" is useful for some input methods though, mainly
for some Chinese input methods.

I have to think whether there are any non-CJK input methods where
"Normal commit mode" is useful. If not, then I can disable that option
for all non-CJK input methods.  Just like I disabled the
fullwidth/halfwidth options for non-CJK input methods.

--- Additional comment from Mike FABIAN on 2014-08-30 13:34:16 EDT ---

(In reply to Stas Sergeev from comment #39)
> I also wonder why the user is supposed to
> know what is "Normal commit" and "Direct commit".
> IMHO a completely meaningless things,

You are right that it is very bad that there is no good documentation
explaining this. I should add documentation for these options.

> are they really needed in the main language menu?

For some Chinese input methods, for example Wubi, it is useful and
should be there.

--- Additional comment from Stas Sergeev on 2014-08-30 14:03:39 EDT ---

(In reply to Mike FABIAN from comment #40)
> I have on my todo list to replace these toggles in the menu
> by sub-menus with check boxes. Probably that is what you suggest as well.
> If you want to see how the sub-menus with check boxes look like,
> you can see it in ibus-kkc (A Japanese input method).
I added Japanese SKK, and the sub-menu indeed looks much
better than what we have for rusle now.

> When one wants to change for example from the Chinese mode 0 to
> Chinese mode 4 (as above), one can click one of these icons 4 times.
> This is much faster than opening the menu 4 times and clicking on
> a menu entry 4 times (lots of mouse movement!).
> So it is ridiculous doing this via the menu, it is not so bad with the
> floating panel. Some people like the floating panel.
I find it strange that you compare floating panel
with current rusle menu, and not with the SKK sub-menu
style. From your description I can guess that sub-menu
is still better because it allows any change in just 1
mouse click whereas floating panel require 4.

(In reply to Mike FABIAN from comment #41)
> (In reply to Stas Sergeev from comment #39)
> > I also wonder why the user is supposed to
> > know what is "Normal commit" and "Direct commit".
> > IMHO a completely meaningless things,
> You are right that it is very bad that there is no good documentation
> explaining this. I should add documentation for these options.
Well, documentation is a good thing, but the menu items
itself should be somewhat sensible too. For example,
"Phrase mode" means something, while "Normal commit mode"
means purely nothing, IMHO.
Almost certainly the options that are useful for users,
can have a meaningful name. Options with meaningless
names are usually invented by programmers for programmers. :)

> > are they really needed in the main language menu?
> For some Chinese input methods, for example Wubi, it is useful and
> should be there.
Do they really need to switch it from default all that often?

Comment 1 Stas Sergeev 2014-08-31 09:42:16 UTC
Hi Mike.

While the good menu style and the better name for
"commit mode" is about an UI and can be discuss
indefinitely, the more simple question is just why
it breaks arrow keys?
Maybe simply committing the pending input not only
by Space, but also by Arrows, Enter and other "special"
keys? Then the only problem I will see in the "normal"
mode is the underlined letter, which is fine.

Another question: if ibus knows for sure that there
are no candidates for preedit, why does it even underlines
something and waits for the next char? In case of
translit, as you explained, there are candidates
when some letters are typed. But some letters do
not have candidates even in translit table, so why
they cannot be committed directly?

Comment 2 Stas Sergeev 2014-08-31 09:49:21 UTC
(In reply to Stas Sergeev from comment #0)
> That is completely useless for rusle.  rusle is a fixed conversion
> table, no new shortcuts are ever defined.  Therefore, for rusle, that
> “Normal commit mode” which commits to preedit is useless.
> 
> I must think whether I can automatically determine which tables need
> this “Normal commit” option and which don’t to be able to disable it
> automatically for tables where it makes no sense.
Is it possible to determine that on a per-character
basis, and not per-table?
Like, if in rusle there are no candidates for any
typed char, they should just be committed immediately.
For the mixed table, like translit, only wait in
preedit for those chars for which the candidates
do really exist.
Is it possible?

Of course it may still be nice to also disable that
mode entirely for the tables where preedit is not
needed for any input. But the problem will not happen
if it is resolved on a per-char level.

Comment 3 Mike FABIAN 2014-08-31 10:31:20 UTC
(In reply to Stas Sergeev from comment #1)
> Hi Mike.
> 
> While the good menu style and the better name for
> "commit mode" is about an UI and can be discuss
> indefinitely, the more simple question is just why
> it breaks arrow keys?

It doesn’t “break” the arrow keys, it changes the function
of the arrow keys to edit the preedit.

> Maybe simply committing the pending input not only
> by Space, but also by Arrows, Enter and other "special"
> keys? Then the only problem I will see in the "normal"
> mode is the underlined letter, which is fine.

No, if stuff is committed using “Normal commit mode”, it is
committed to preedit, which you can distinguish because it is
underlined. Using the arrow keys then moves *inside* the preedit,
not inside the text which is already committed to the application.

Committing the preedit by typing a space automatically defines a new
shortcut for the string in the preedit (when using an input method
like Wubi which has rules to automatically define such shortcuts).
But before committing the preedit by using space, you can still review
and edit *the preedit*. I.e. move around with the arrow keys between
the left and the right border of the preedit, insert more characters
somewhere inside the preedit, delete some characters and review the
shortcut which will be defined when the preedit is committed.

That is quite complicated, but it is meant to be like this.

It is of course completely useless for rusle, so rusle
should just never use this "Normal commit mode".

> Another question: if ibus knows for sure that there
> are no candidates for preedit, why does it even underlines
> something and waits for the next char? In case of
> translit, as you explained, there are candidates
> when some letters are typed. But some letters do
> not have candidates even in translit table, so why
> they cannot be committed directly?

They *are* committed directly in this case!

translit,  just like rusle, should *never* use “Normal commit mode”,
always "Direct commit mode".

When typing Cheburashka with translit using “Direct commit mode”,
the following happens:


C                 _Ц_
Ch                Ч
Che               Ч_е_
Cheb              Чеб
Chebu             Чебу
Chebur            Чебур
Chebura           Чебура
Cheburas          Чебура_с_
Cheburash         Чебура_ш_
Cheburashk        Чебураш
Cheburashka       Чебурашка

Here I have marked the parts where the underlined preedit is seen with
underscores:

    _contents of preedit_

So it works just like you suggest, when there are no candidates it
commits directly, you see the preedit only when there is more than
one candidate.

I.e. we do not have a bug here, rusle is broken with “Normal commit
mode”, but “Normal commit mode” is just something which should
never be used with rusle or translit.

Instead of “fixing” it for rusle, I should disable it for input methods
which have no use for this “Normal commit mode”.

Comment 4 Mike FABIAN 2014-08-31 10:43:28 UTC
“Normal commit mode” is only only useful, if one wants to move
around in the preedit and edit the preedit itself. 

In translit one would never want to do that. In translit, the
preedit is never longer than one character. Moving around, inserting,
deleting in a preedit of length 1 makes no sense. If one types 
Che and sees Ч_е_, and the last character was a mistake, just delete it
with Backspace. No need to do fancy editing in the preedit.

In Wubi however, the preedit can have any length, many characters.
Before committing such a long preedit with space to define a new shortcut
for the contents of that preedit, one may want to review the preedit and
see the shortcut which will be defined.

Comment 5 Stas Sergeev 2014-08-31 11:13:25 UTC
(In reply to Mike FABIAN from comment #3)
> No, if stuff is committed using “Normal commit mode”, it is
> committed to preedit, which you can distinguish because it is
> underlined. Using the arrow keys then moves *inside* the preedit,
Well, maybe that's true for Left arrow.
But why also Up and Down and Right arrows do not work?
They are not supposed to get me inside preedit.
As you explain further, I am only allowed to be
moved inside preedit boundaries, and that's why
the other arrows do not work.
Would it be possible to allow moving freely, including
outside of the preedit? IMHO, underlining the preedit
boundaries is enough to allow the user to edit it.
Not allowing it to escape the preedit is way too heavy-handed.

> They *are* committed directly in this case!
> 
> translit,  just like rusle, should *never* use “Normal commit mode”,
> always "Direct commit mode".
> 
> When typing Cheburashka with translit using “Direct commit mode”,
> the following happens:
OK, this means, even after all the explanations
I still don't understand the difference between the
2 modes. :(
Initially I thought in Direct mode every typed
char is committed immediately to the application,
so the candidates are not being awaited.
Now you explain that even in Direct mode you can
type ch and get ч. I though in Direct mode you would
type ch and always get цх.
According to your latest explanations, is it correct
that Normal and Direct modes are identical, both using
some pre-commit buffer. Normal mode allows you to edit
inside that buffer, while direct mode does not allow
this.
Is this understanding correct?

> “Normal commit mode” is only only useful, if one wants to move
> around in the preedit and edit the preedit itself. 
>
> In translit one would never want to do that. In translit, the
> preedit is never longer than one character. Moving around, inserting,
> deleting in a preedit of length 1 makes no sense.
I am confused.
In your example with cheburashka there were chars with
the length of 2, like ch->ч.
Arrrh... I guess I am starting to understand...
When we type "ch" we only have c in preedit, and h
makes a commit. So while the char consists of 2 letters,
you say the preedit length is 1...
In case of rusle, the preedit length is then 0.
Is this understanding correct?

Comment 6 Mike FABIAN 2014-08-31 16:54:12 UTC
(In reply to Stas Sergeev from comment #5)

> I am confused.
> In your example with cheburashka there were chars with
> the length of 2, like ch->ч.
> Arrrh... I guess I am starting to understand...
> When we type "ch" we only have c in preedit, and h
> makes a commit.

Yes!

> So while the char consists of 2 letters,
> you say the preedit length is 1...
> In case of rusle, the preedit length is then 0.
> Is this understanding correct?

Yes.

When using “Direct commit mode” with rusle, you will
never ever see any preedit. As you say, the preedit length
in rusle with “Direct commit mode” is always 0.
Every character is committed immediately. What else could one want?
“Normal commit mode” is never useful for rusle. So I should just
disable it for rusle (*and* for all the other input methods
where it is completely useless, this includes translit and possibly
all non-CJK input methods, I’ll check carefully ...).

The tne problem is solved for rusle, no preedit, no problems with any
of the arrow keys. Arrow left, right, up, down all work normally.

For translit it is “almost” solved when “Normal commit mode” is
disabled.

Remaining small problem for translit:

When typing “C” you see _Ц_, i.e. you see a preedit because the
input method has to wait whether a "h" follows or something else.
Arrow up and down now walk through the possible candidates. In this
case there are two possible candidates, “Ц” and “Ч”. So arrow up
and down cycle between these two. In Chinese input methods, there are
often many candidates and arrow up/down cycle through a long list
(Usually one switches the display of the candidate list on then in the
setup, this is the default for the Chinese input methods, a sort of
combobox opens and the arrow up/down keys cycle through the candidates
in that combobox). For translit, I think it is OK if arrow up/down
cycle between “Ц” and “Ч” when “C” has been typed.

*But*, arrow left and arrow right still commit to preedit! Even when
“Direct commit mode” is active. You can see that by typing “C” with
translit and then “arrow right”. The Ц changes colour to red which indicates
that it has been committed to preedit but not to the application yet and
the arrow keys now move around in that preedit. Also, when typing “C”
with translit and then the left shift key, the Ц is committed to preedit.
Again you can see that because the colour becomes red. That makes no sense
for translit where the preedit length is never longer than 1.

I am not yet sure what to to about this in translit.
Maybe leave it as it is, it is really a minor problem.
I thought about disableing committing to predit with the left shift
key and the arrow left/right keys when using “Direct commit mode”,
But when using a Chinese input method like Wubi with direct commit mode,
it can still be useful to be able to manually commit to preedit to
define new shortcuts.

Example with wubi-jidian86:

Type “a”, select the character “工” with arrow up/down in the candidate list,
commit it to preedit with the left shift key. Type “b” and select the
the character “了” in the candidate list and commit it to preedit as well
with the left shift key. Now you have the string “工了” committed to preedit,
shown by the red colour. You can move around in that preedit with arrow left
and right. When the cursor is on “工”, the auxiliary text shows:

    a aaa aaaa #: aabn
    
which means that the possible key sequences to type “工” are
“a”, “aaa”, or “aaaa” and the new key sequence which will be defined
to type the whole string “工了”  will be “aabn”.

When you move the cursor over the “了” you see:

    b bnh  #: aabn

which means that the possible key sequences to type “了” are
“b” or “bnh” and again “aabn” is the key sequence which will
be defined for the string “工了” if the user commits this by typing
space to the application now.

I think you probably have to try this to understand it.

So disabling committing manually to preedit with arrow left/right
and the left shift key always might not be a good idea, it would
loose some useful feature for wubi.

But this committing to preedit never seems to make sense for non-CJK
input methods. I cannot think of any reason why this should be useful
for a non-CJK input method. So I guess for non-CJK input methods I
will do:

- disable “Normal commit mode“
- disable manually committing to preedit using arrow left/right and left shift

And, as you say, I should think of better names for “Direct commit
mode” and “Normal commit mode”. Currently in the setup tool one sees

    Commit mode:  [Direct/Normal] <- combobox

I should probably change this to:

    Auto commit:  [To application/To preedit]

“Auto commit” because this is the name of the option in the table
source, True means to application, False means to preedit.  “Auto
commit” also fits better than “Commit mode” because this option is
about automatic commits which happen when a candidate has been matched
uniquely (Like when typing “Ch” or “Cx” in translit, an automatic
commit happens in both cases, when typing “h“ or “x”). This option
has nothing to do with manually committing to preedit by
using the left shift key or the arrow left/right keys.

Comment 7 Mike FABIAN 2014-08-31 17:23:22 UTC
Created attachment 933160 [details]
what-is-commit-to-preedit-shown-using-wubi-jidian86-as-an-example.png

screenshot trying to explain what commit to preedit is using
wubi-jidian86 as an example.

The black text in gedit at the left and the right has already
been committed to the application. There is no underline, it is just black.

The red text has been committed to preedit, but not to the application.
Same for the green text, it also has been committed to preedit but not
to the application. When moving around the cursor with the arrow keys
in the string committed to preedit, the part to the left of the cursor
is red, the part to the right of the cursor is green.

The black *and* underlined text in the middle is the preedit for the
current input sequence. The current input sequence is “i”, visible a
the top of the of the candidate list (Before the “(1/6)”. The
currently selected match is 不, using arrow up or down one can select
other matches. Or one continue typing, for example by typing the
additional keys “ht” one would get 小 (the blue Latin characters
following the candidates indicate the missing part of the key sequence
to complete that character).

With arrow left/right or with the left shift key one can now commit
the selected candidate, for example 不 to preedit as well.  Then the
key sequence which will be defined for the whole string is
displayed. It is “abgd” in this case. So if one commits this whole
string now by typing space, one can in future type “abgd“ to get
“工了不以在” as a candidate.

This whole exercise of “committing to preedit is to define
new shortcuts for longer strings.

Ah, better idea! Instead of disabling “Normal commit” for non-CJK
table, I should disable it if a table does not have an
entry for RULES:

### Rules for user define phrase construct:
RULES = ce2:p11+p12+p21+p22;ce3:p11+p21+p31+p32;ca4:p11+p21+p31+p-11

If there are no such RULES, no new shortcuts can be defined
automatically (I plan to add a feature to define new shortcuts
manually, but that is a different story and it will not be for rusle).
In that case, without such RULES, committing to preedit makes no
sense, how could a new shortcut be defined for the stuff committed to
preedit without such rules? So checking for the existance of RULES in
the table source seems to be a better way to decide whether committing
to preedit should be allowed or not. Better than checking CJK vs
non-CJK.

Explaining this makes me understand it better ☺.

Comment 8 Stas Sergeev 2014-08-31 19:52:32 UTC
Thanks for the detailed explanations!
I think I am now getting the picture.
The most important thing is that there
seem to be 2 separate preedit phases:
1 allows you to select candidates for
a single char
2 allows you to select a short-cut for
some previous typing.

So while Normal mode has both, Direct
mode has just the first one.
Is this understanding correct?
If I know there are 2 different preedit
stages and Direct mode disables just one,
I would probably get that all with much
fewer efforts. :)
When you said preedit is not needed for
translit, I was entirely confused. But
it appears only stage 2 is not needed,
but you still need stage 1 to select
candidates for c.

Now as rusle does not have stage 1, I
was stuck at stage 2 in Normal mode when
trying to move with an arrows.
You seem to explain what the arrows do
for stage 1: they select a candidate.
But this probably does not apply to my
question, because in Normal mode I stuck
at stage 2 where the binding could be
defined. What do the arrows do for stage 2?
I tried to experiment with SKK but I don't
see where is there a switch between
Direct/Normal modes...

OK, I hope my understanding is now closer
to the reality. Of course it could be in
fact further away...

For example, you suggest to use the names:
Auto commit:  [To application/To preedit]
which makes me think that I do not understand
anything even now.
As you explained, preedit is used in Direct
mode too - for selecting the candidates in
translit, for example. If this is true, how
would I justify the "Auto commit to preedit"?
It is already in preedit when I am selecting
the candidates! So how can I commit from
preedit to preedit?
Oh well, I guess that's hopeless... I probably
can't understand ibus. :)

Comment 9 Mike FABIAN 2014-08-31 22:18:13 UTC
(In reply to Stas Sergeev from comment #8)

> The most important thing is that there
> seem to be 2 separate preedit phases:
> 1 allows you to select candidates for
> a single char
> 2 allows you to select a short-cut for
> some previous typing.

Yes.

> So while Normal mode has both, Direct
> mode has just the first one.
> Is this understanding correct?

Yes.

2 still exists in direct mode, one can still commit manually to
preedit phase 2 by pressing the left shift key or the arrow left/right
keys.  But in direct mode, all automatic commits bypass phase 2 and go
directly to the application.

> If I know there are 2 different preedit
> stages and Direct mode disables just one,

Yes, that is about correct. It disables automatic
commits to phase 2.

> I would probably get that all with much
> fewer efforts. :)
> When you said preedit is not needed for
> translit, I was entirely confused. But
> it appears only stage 2 is not needed,

Yes.

> but you still need stage 1 to select
> candidates for c.

Yes.

> Now as rusle does not have stage 1, I
> was stuck at stage 2 in Normal mode when
> trying to move with an arrows.

When using rusle with "Normal commit mode", you can actually see
both stages.

Type “a” and you see _ф_ (underlined, black). This ist in stage
1. Then type arrow right or the left shift key and you see _ф_
(underlined, red).  This is in stage 2. Type some other character or a
space and the ф gets committed to the application and becomes black
without underline.

In “Direct commit mode”, typing “a” commits ф immediately to the
application bypassing both stage 1 and stage 2. Both stages are
useless for rusle. For translit, stage 1 has some uses (Like when
typing “C” and waiting for the next character to decide what to do)
but stage 2 is useless for translit as well.

> You seem to explain what the arrows do
> for stage 1: they select a candidate.

Yes.

> But this probably does not apply to my
> question, because in Normal mode I stuck
> at stage 2 where the binding could be
> defined. What do the arrows do for stage 2?

Move around in the text which is in stage 2.

> I tried to experiment with SKK but I don't
> see where is there a switch between
> Direct/Normal modes...

Are you really using ibus-skk not ibus-kkc? Both are Japanese input
methods, skk is a very old one, kkc a very modern one.

*None* of the Japanese input methods have something like stage 2
in ibus-table.

This committing of stuff to preedit, i.e. committing not to the
application but to something like stage 2 which can then again be
edited and finally committed seems to be a unique feature of
ibus-table.  I have never seen this in any other ibus input method.

I am not sure how useful this really is, it is a very complicated and
confusing thing. But it makes it possible to define new shortcuts fast
with Wubi. I did not want to destroy any features while I cleaned up
the code in ibus-table, so I kept that feature and just fixed the bugs
in this feature. I wonder about the usefulness of this quite exotic
feature myself though.

I want to add a different feature to define new shortcuts in a less
automatic way, like typing some shortcut, e.g. Ctrl+= (that was the
shortcut in SCIM for this feature), then pop up a dialog where one can
enter a key sequence and what the result for this key sequence should
be and then close that dialog. That makes defining shortcuts possible
for tables which do not have such automatic shortcut creation rules
like Wubi has:

### Rules for user define phrase construct: RULES =
ce2:p11+p12+p21+p22;ce3:p11+p21+p31+p32;ca4:p11+p21+p31+p-11

This defines shortcuts automatically from the string using these rules.

But for rusle, this feature cannot be enabled because any new
shortcut would cause problems.

So this feature on my todo list is not for rusle but more for other
tables.  Like adding a new user defined emoticon for emoji-table or
adding some mathematical symbol which is lacking in the latex table as
a user defined symbol.

> OK, I hope my understanding is now closer
> to the reality. Of course it could be in
> fact further away...

No, it is quite correct.

> For example, you suggest to use the names:
> Auto commit:  [To application/To preedit]
> which makes me think that I do not understand
> anything even now.
> As you explained, preedit is used in Direct
> mode too - for selecting the candidates in
> translit, for example. If this is true, how
> would I justify the "Auto commit to preedit"?

“Auto commit to preedit” means auto commit from stage 1 to stage 2.
“Auto commit to application” means auto commit from stage 2 to the
application, bypassing stage 2.

> It is already in preedit when I am selecting
> the candidates! So how can I commit from
> preedit to preedit?

The preedit when selecting candidates is what you call stage 1.
“Committing to preedit” means committing to stage 2, a special
stage of the preedit which no other ibus input method has,
only ibus-table has this.

> Oh well, I guess that's hopeless... I probably
> can't understand ibus. :)

That is only ibus-table. A really unusual feature of ibus-table.  This
is useful only for a handful input methods which have RULES=something
*and* USER_CAN_DEFINE_PHRASE=TRUE.  “git grep RULES” and “git grep
USER_CAN_DEFINE_PHRASE” in the repos shows me that these are only:

erbi-qs
wubi-haifeng86
wubi-jidian86

So only 3 of the tables currently available for ibus-table use this.
All 3 are for Chinese.

All others do not need stage 2.

Comment 10 Stas Sergeev 2014-08-31 23:05:45 UTC
(In reply to Mike FABIAN from comment #9)
> When using rusle with "Normal commit mode", you can actually see
> both stages.
> Type “a” and you see _ф_ (underlined, black). This ist in stage
> 1.
Why do I see it if there are no candidates to select?
I guess its not needed much?

> Then type arrow right or the left shift key and you see _ф_
> (underlined, red).
Instead, I see it non-underlined, selected.
Some setting mismatch I guess.

> > But this probably does not apply to my
> > question, because in Normal mode I stuck
> > at stage 2 where the binding could be
> > defined. What do the arrows do for stage 2?
> Move around in the text which is in stage 2.
Up and Down seem to do nothing.
I wonder if it is possible to allow free movement,
but I guess it is not easy to implement.

> Are you really using ibus-skk not ibus-kkc? Both are Japanese input
> methods, skk is a very old one, kkc a very modern one.
In GUI I have only Japanese SKK. There is also some
Kana Kanji - is this kkc?

> I am not sure how useful this really is, it is a very complicated and
> confusing thing.
That's why I thought it may not be in the main
GUI. :) It could be in some advanced GUI.
But I understand your proposal about the different
short-cut mechanism.

> “Auto commit to preedit” means auto commit from stage 1 to stage 2.
> “Auto commit to application” means auto commit from stage 2 to the
> application, bypassing stage 2.
Well, this means “Auto commit to preedit” is likely
still not the best name. Much better than "Normal mode"
of course. :) But if you are about to remove that entirely
and replace the functionality, then what's the deal at all.

Comment 11 Mike FABIAN 2014-09-01 03:46:49 UTC
(In reply to Stas Sergeev from comment #10)
> (In reply to Mike FABIAN from comment #9)
> > When using rusle with "Normal commit mode", you can actually see
> > both stages.
> > Type “a” and you see _ф_ (underlined, black). This ist in stage
> > 1.
> Why do I see it if there are no candidates to select?
> I guess its not needed much?

You see it *only* in “Normal commit mode” in rusle. You do not need
to worry about this, because, as I wrote, I will disable normal commit
mode for rusle.

> > Then type arrow right or the left shift key and you see _ф_
> > (underlined, red).
> Instead, I see it non-underlined, selected.
> Some setting mismatch I guess.

I guess  you tried arrow *left*, not arrow *right*.
When you use arrow left, of course you put the cursor
*on* the character, not directly after the character.

> > > But this probably does not apply to my
> > > question, because in Normal mode I stuck
> > > at stage 2 where the binding could be
> > > defined. What do the arrows do for stage 2?
> > Move around in the text which is in stage 2.
> Up and Down seem to do nothing.
> I wonder if it is possible to allow free movement,
> but I guess it is not easy to implement.

What should up and down do if you are in stage 2?  There is nothing
meaningful they could do. If you are in stage 2 you can edit tne
contents of stage 2. As soon as you start typing again somewhere
inside the text in stage 2, of course up and down work again to select
the candidates.  Maybe you have to try wubi if you want to understand
how this works.

> > Are you really using ibus-skk not ibus-kkc? Both are Japanese input
> > methods, skk is a very old one, kkc a very modern one.
> In GUI I have only Japanese SKK. There is also some
> Kana Kanji - is this kkc?

Yes, Kana Kanji is kkc.

> > I am not sure how useful this really is, it is a very complicated and
> > confusing thing.
> That's why I thought it may not be in the main
> GUI. :) It could be in some advanced GUI.
> But I understand your proposal about the different
> short-cut mechanism.

> > “Auto commit to preedit” means auto commit from stage 1 to stage 2.
> > “Auto commit to application” means auto commit from stage 2 to the
> > application, bypassing stage 2.
> Well, this means “Auto commit to preedit” is likely
> still not the best name. Much better than "Normal mode"
> of course. :) But if you are about to remove that entirely
> and replace the functionality, then what's the deal at all.

I will disable it for *rusle*. But *not* for Wubi.
So nothing is replaced, that functionality is just disabled
for input methods which don’t need it like rusle.

Comment 12 Stas Sergeev 2014-09-01 07:48:45 UTC
Created attachment 933266 [details]
right arrow pressed

Comment 13 Stas Sergeev 2014-09-01 07:49:08 UTC
Created attachment 933267 [details]
left arrow pressed

Comment 14 Stas Sergeev 2014-09-01 08:01:45 UTC
(In reply to Mike FABIAN from comment #11)
> > Instead, I see it non-underlined, selected.
> > Some setting mismatch I guess.
> I guess  you tried arrow *left*, not arrow *right*.
Attached 2 screen shots.
One with right arrow, one with left.
The difference is very minor: after Left,
cursor disappears.
When I was doing a screen shot with Alt-PrtSc,
the preedit buffer was erased. Fortunately, on
the screens shot it is still there, but it immediately
removes the last char.

> > Up and Down seem to do nothing.
> > I wonder if it is possible to allow free movement,
> > but I guess it is not easy to implement.
> What should up and down do if you are in stage 2?
Navigate you through the previously typed text, up
and down. :)

>  There is nothing
> meaningful they could do.
The problem I want to point is that user gets locked
inside some text region with no obvious way to escape
it. When I see a menu with candidates, I know that the
arrows will navigate me through that menu. Or I can
just close that menu.
When I see a cursor, I know that arrays will navigate
me through the whole text. When this doesn't happen I
report bug. :)
Please note that any attempt to escape the preedit region
either does not work or cause it to disappear. IMHO
this is a bad usability decision. I am not pretending
to be a usability expert, but I think it would be much
better to let user navigate the whole text as he used
to, and if he leaves the preedit region, perhaps it
should be committed as is, rather than to disappear.

> I will disable it for *rusle*. But *not* for Wubi.
> So nothing is replaced, that functionality is just disabled
> for input methods which don’t need it like rusle.
I was referring to this:
---
I want to add a different feature to define new shortcuts in a less
automatic way, like typing some shortcut, e.g. Ctrl+= (that was the
shortcut in SCIM for this feature)
---
IMHO this is much better than what we have now.
So I thought you are going to remove the "Normal" thing.
If it will stay (even just for some layouts), at least
I hope it will not be as easily switchable by mistake
as it currently is (either by occasionally hitting a
short-cut key, or clicking it in the lang applet menu).

Comment 15 Stas Sergeev 2014-09-01 08:25:03 UTC
As for the user-friendly names.
Just a proposal.
How about "Short-cut assignment mode: [On/Off]"?
Firstly, user does not know what preedit is and
how many stages it has.
Secondly, "Short-cut assignment mode" hints the
user about the fact that it is not a normal typing
mode, so he will unlikely enable it if he wants
just to type text.

Comment 16 Mike FABIAN 2014-09-01 09:04:42 UTC
(In reply to Stas Sergeev from comment #14)
> (In reply to Mike FABIAN from comment #11)
> > > Instead, I see it non-underlined, selected.
> > > Some setting mismatch I guess.
> > I guess  you tried arrow *left*, not arrow *right*.
> Attached 2 screen shots.
> One with right arrow, one with left.
> The difference is very minor: after Left,
> cursor disappears.
> When I was doing a screen shot with Alt-PrtSc,
> the preedit buffer was erased. Fortunately, on
> the screens shot it is still there, but it immediately
> removes the last char.

Oh, firefox seems to do something special there to override the
appearance of the preëdit.  Try the same in gedit or gnome-terminal,
then you see the preëdit colouring done by ibus-table.

> > > Up and Down seem to do nothing.
> > > I wonder if it is possible to allow free movement,
> > > but I guess it is not easy to implement.
> > What should up and down do if you are in stage 2?
> Navigate you through the previously typed text, up
> and down. :)

That makes no sense in stage 2.

> >  There is nothing
> > meaningful they could do.

> The problem I want to point is that user gets locked
> inside some text region with no obvious way to escape
> it. When I see a menu with candidates, I know that the
> arrows will navigate me through that menu. Or I can
> just close that menu.
> When I see a cursor, I know that arrays will navigate
> me through the whole text. When this doesn't happen I
> report bug. :)

But for any Chinese user, it is obvious that this preëdit
can be committed by typing space.

> Please note that any attempt to escape the preedit region
> either does not work or cause it to disappear.

Space commits it and ESC kills it. That is normal and obvious.

> IMHO
> this is a bad usability decision. I am not pretending
> to be a usability expert, but I think it would be much
> better to let user navigate the whole text as he used
> to, and if he leaves the preedit region, perhaps it
> should be committed as is, rather than to disappear.
> 
> > I will disable it for *rusle*. But *not* for Wubi.
> > So nothing is replaced, that functionality is just disabled
> > for input methods which don’t need it like rusle.
> I was referring to this:
> ---
> I want to add a different feature to define new shortcuts in a less
> automatic way, like typing some shortcut, e.g. Ctrl+= (that was the
> shortcut in SCIM for this feature)
> ---
> IMHO this is much better than what we have now.

It is not “better” but “different”.

The current method to define new shortcuts in Wubi is very automatic,
it needs very little extra typing and clicking.  A Wubi user can just
stay in “Normal commit mode” and type away, committing from time to
time to the applicationi using space.  Everything between one space
and the next then gets a new shortcut defined.  Probably useful to
define lots of shortcuts for many longer strings just during normal
typing with little extra effort.

The idea to open a new dialog has advantages and disadvantages:

+ more obvious to use
+ shortcuts definable even for tables which do not have RULES
+ even for tables which do have RULES, special shortcuts differing
  from these RULES can be defined if desired
+ shortcuts can be defined even for stuff which cannot be typed
  with the current input method (Because in the dialog one can switch
  to a different input method. For example one could define a shortcut
  for something like ☺ in an input method which cannot enter such a
  character, after defining such a shortcut it can)

- More typing and clicking required compared to the current method
  to define shortcuts in Wubi automatically.
- as shortcuts are completely user define they don’t need to follow
  any rules and thus the user may need to remember them.

> So I thought you are going to remove the "Normal" thing.
> If it will stay (even just for some layouts), at least
> I hope it will not be as easily switchable by mistake
> as it currently is (either by occasionally hitting a
> short-cut key, or clicking it in the lang applet menu).

It will stay only for the 3 Chinese input methods I mentioned.  For
these 3, I think it is OK, it is much more obvious what happens there
compared to what you experienced with rusle.

Comment 17 Mike FABIAN 2014-09-01 09:09:17 UTC
(In reply to Stas Sergeev from comment #15)
> As for the user-friendly names.
> Just a proposal.
> How about "Short-cut assignment mode: [On/Off]"?
> Firstly, user does not know what preedit is and
> how many stages it has.
> Secondly, "Short-cut assignment mode" hints the
> user about the fact that it is not a normal typing
> mode, so he will unlikely enable it if he wants
> just to type text.

It can be used as a normal typing mode in Wubi.
I guess the current  naming “Normal commit” was chosen
by the original developer of ibus-table because he
considered what you call “Short cut defining mode”
as the “normal mode of operation”, not some weird
feature which is rarely used. Defining lots 
of new shortcuts all the time may be quite helpful
for  Wubi.

Comment 18 Mike FABIAN 2014-09-02 07:54:30 UTC
Created attachment 933617 [details]
0001-Disable-auto_commit-option-for-tables-which-do-not-h.patch

Patch to fix the problem.

Comment 19 Stas Sergeev 2014-09-02 19:23:47 UTC
Seems to work, thanks! :)

Comment 20 Fedora Update System 2014-09-04 14:44:29 UTC
ibus-table-1.8.10-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/ibus-table-1.8.10-1.fc19

Comment 21 Fedora Update System 2014-09-04 14:45:07 UTC
ibus-table-1.8.10-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/ibus-table-1.8.10-1.fc20

Comment 22 Stas Sergeev 2014-09-07 10:28:46 UTC
Hello Mike, any treatment to the "Phrase mode"?
IIRC you wanted to disable it for rusle too?

Comment 23 Mike FABIAN 2014-09-07 18:37:29 UTC
(In reply to Stas Sergeev from comment #22)
> Hello Mike, any treatment to the "Phrase mode"?
> IIRC you wanted to disable it for rusle too?

I did. 

See:

https://admin.fedoraproject.org/updates/ibus-table-1.8.10-1.fc20

https://github.com/kaio/ibus-table/releases/tag/1.8.10

> Disable auto_commit option for tables which do not have RULES
> Resolves: rhbz#1135759 https://bugzilla.redhat.com/show_bug.cgi?id=1135759
> Disable hotkey to switch Chinese mode if database is not Chinese
> Disable “onechar” (Phrase mode/Single char mode) option for non-CJK databases

Comment 24 Stas Sergeev 2014-09-07 19:37:47 UTC
Ah, thanks!
You just haven't posted the patch here, so
I thought you didn't.

Comment 25 Fedora Update System 2014-09-09 22:04:25 UTC
Package ibus-table-1.8.10-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ibus-table-1.8.10-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-10317/ibus-table-1.8.10-1.fc20
then log in and leave karma (feedback).

Comment 26 Fedora Update System 2014-09-14 12:03:26 UTC
ibus-table-1.8.11-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/ibus-table-1.8.11-1.fc19

Comment 27 Fedora Update System 2014-09-14 12:04:24 UTC
ibus-table-1.8.11-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/ibus-table-1.8.11-1.fc20

Comment 28 Fedora Update System 2014-09-16 09:08:29 UTC
ibus-table-1.9.0-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/ibus-table-1.9.0-1.fc19

Comment 29 Fedora Update System 2014-09-16 09:14:36 UTC
ibus-table-1.9.0-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/ibus-table-1.9.0-1.fc20

Comment 30 Fedora Update System 2014-09-30 01:53:10 UTC
ibus-table-1.9.0-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 31 Fedora Update System 2014-09-30 01:55:24 UTC
ibus-table-1.9.0-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.