(重新设计)中英文混打:OS输入法管理包 smart-input-source

这个只做了 C-x,o 的切换 ,然后各输了一个字母k 确认当前输入状态。最后切换到log 去复制内容,后面的不用看。

@aqua0210

正在看~~~~~
我明白了。。。。
知道问题出在哪里了。
明天改吧。

好的,早点休息了。明天再交流。

测试了:

  1. 不同阶段的退出:C-x C-g C-x b C-g
  2. 无中间输入的快键键:C-x o
  3. 有中间输入的快捷键C-x b txt<ret>

hint-mode 应该需要重新完善。
这块没太管~~

trace-mode 重命名为log-mode

经过测试目前情况如下:

  1. C-x,b 正常
  2. M-x,C-g 正常
  3. M-x, 在mini-buffer 还是中文。
  4. C-x,C-g 失败
  5. C-x,o 切换buffer 正常
  6. awesome-tab,切换buffer :
    a, 如果A buffer 是中文,B buffer 也是中文;正常
    b, 如果A buffer 中文,B buffer 是英文,A-B 切换后,B buffer 变成中文。失败

注:关于awesome-tab,可能是因为我没有进行针对设置。请教怎么把awesome-tab 加入配置?

(push 'awesome-tab smart-input-source-preserve-save-triggers)

不清楚你的切换命令是什么,是不是 'awesome-tab 可以开log去看下

M-x是绑定到什么命令? 把那个命令加到:

(push 'YOUR-COMMAND smart-input-source-preserve-M-x-commands)

我是counsel-M-x,我已经给加到默认值中了。

smart-input-source-log-mode打开,我看看。

smart-input-source-log-mode 看看。
正常的话,应该有 key sequence canceled才对。

我正在测试,awsome-tab 按你说方法已经正常。 M-x 是定义个的function smex+,设置了还是不行。

(defun smex+ ()
  (interactive)
  (let ((resize-mini-windows nil))
    (smex)
    ))

开log我看看

 Smart-Input-Source-Log mode enabled

"post@[normal]: [[8388717]]@key [smart-input-source-log-mode]@cmd [init-smart-input-source.el]@buf [t]@override"


"pre@[normal]: [FS]@key [smart-input-source-switch]@cmd [init-smart-input-source.el]@buf [t]@override"

"post@[normal]: [FS]@key [smart-input-source-switch]@cmd [init-smart-input-source.el]@buf [t]@override"


"pre@[normal]: [[24320]]@key [self-insert-command]@cmd [init-smart-input-source.el]@buf [t]@override"

"post@[normal]: [[24320]]@key [self-insert-command]@cmd [init-smart-input-source.el]@buf [t]@override"


"pre@[normal]: [[22987]]@key [self-insert-command]@cmd [init-smart-input-source.el]@buf [t]@override"

"post@[normal]: [[22987]]@key [self-insert-command]@cmd [init-smart-input-source.el]@buf [t]@override"

Reverting buffer ‘config’.
Omitting...
Omitted 3 lines.

Wrote c:/Users/XXX/Aquaemacs/site-lisp/config/init-smart-input-source.el
Omitted 3 lines.

"pre@[normal]: [\370]@key [smex+]@cmd [init-smart-input-source.el]@buf [t]@override"


"post@[normal]: []@key [smex+]@cmd [ *Minibuf-1*]@buf [t]@override"

Reverting buffer ‘config’.
Omitting...
Omitted 2 lines.

"pre@[normal]: [BEL]@key [abort-recursive-edit]@cmd [ *Minibuf-1*]@buf [t]@override"

Quit
"post@[normal]: []@key [abort-recursive-edit]@cmd [init-smart-input-source.el]@buf [t]@override"

"restore: [nil]@[init-smart-input-source.el]"


"pre@[normal]: [[8388717]]@key [smart-input-source-log-mode]@cmd [init-smart-input-source.el]@buf [t]@override"

Smart-Input-Source-Log mode disabled

M-x , C-g 取消后,中文变成了英文。在mini-buffer中是中文。

以下是C-x,C-g 的情况,中文状态下,C-x,C-g 取消后变成了英文

Smart-Input-Source-Log mode enabled
"post@[normal]: [[8388717]]@key [smart-input-source-log-mode]@cmd [init-smart-input-source.el]@buf [t]@override"
"pre@[normal]: [FS]@key [smart-input-source-switch]@cmd [init-smart-input-source.el]@buf [t]@override"
"post@[normal]: [FS]@key [smart-input-source-switch]@cmd [init-smart-input-source.el]@buf [t]@override"
"pre@[normal]: [CAN]@key [smart-input-source--prefix-override-handler]@cmd [init-smart-input-source.el]@buf [t]@override"
"prefix: [CAN], override: [t]"
"now: [2052]"
"set: english @ [init-smart-input-source.el]"
"post@[prefix]: [CAN]@key [smart-input-source--prefix-override-handler]@cmd [init-smart-input-source.el]@buf [nil]@override"
"pre@[sequence]: [CANCEL]@key [nil]@cmd [init-smart-input-source.el]@buf [nil]@override"
C-x C-g is undefined
"post@[sequence]: [CANBEL]@key [nil]@cmd [init-smart-input-source.el]@buf [nil]@override"
"Key sequence canceled"
"restore: [2052]@[init-smart-input-source.el]"
"pre@[normal]: [[21888]]@key [self-insert-command]@cmd [init-smart-input-source.el]@buf [t]@override"
"post@[normal]: [[21888]]@key [self-insert-command]@cmd [init-smart-input-source.el]@buf [t]@override"
"pre@[normal]: [[20160]]@key [self-insert-command]@cmd [init-smart-input-source.el]@buf [t]@override"
"post@[normal]: [[20160]]@key [self-insert-command]@cmd [init-smart-input-source.el]@buf [t]@override"
Reverting buffer ‘config’.
Omitting...
Omitted 3 lines.
Wrote c:/Users/Aqua/Aquaemacs/site-lisp/config/init-smart-input-source.el
Omitted 3 lines.
Reverting buffer ‘config’.
Omitting...
Omitted 2 lines.
"pre@[normal]: [CAN]@key [smart-input-source--prefix-override-handler]@cmd [init-smart-input-source.el]@buf [t]@override"
"prefix: [CAN], override: [t]"
"now: [2052]"
"set: english @ [init-smart-input-source.el]"
"post@[prefix]: [CAN]@key [smart-input-source--prefix-override-handler]@cmd [init-smart-input-source.el]@buf [nil]@override"
"pre@[sequence]: [CANBEL]@key [nil]@cmd [init-smart-input-source.el]@buf [nil]@override"
C-x C-g is undefined
"post@[sequence]: [CANBEL]@key [nil]@cmd [init-smart-input-source.el]@buf [nil]@override"
"Key sequence canceled"
"restore: [2052]@[init-smart-input-source.el]"
"pre@[normal]: [FS]@key [smart-input-source-switch]@cmd [init-smart-input-source.el]@buf [t]@override"
"post@[normal]: [FS]@key [smart-input-source-switch]@cmd [init-smart-input-source.el]@buf [t]@override"
"pre@[normal]: [[8388717]]@key [smart-input-source-log-mode]@cmd [init-smart-input-source.el]@buf [t]@override"
Smart-Input-Source-Log mode disabled

是哪个版本?我们确认一下,现在就git pull

刚才pull 有更新 commit a4d317e3f0080d6260feeb346bdd7a3b94f4308c

情况还是同上,M-x , C-g 和 C-x,C-g 有问题。

有个奇怪的现象,上一个版本,开log模式的时候M-x ,C-g是正常的 关闭后却不正常。

目前这个新版本,都不正常了。

总结下来,目前存在三个问题:
C-x,C-g 会把中文状态变成英文
M-x,C-g 同上

M-x,(smex+)minibuffer 是中文状态。

加入下面这条后,M-x 正常 ,原来两边都要加

(push 'smex+ smart-input-source-preserve-save-triggers)
(push 'smex+ smart-input-source-preserve-M-x-commands)

对的。这一条也要加。
我发现你的是这个问题了,刚才已经改了。
最新代码,现在不用加也行。

刚刚更新了你的最新版 不加 (push 'smex+ smart-input-source-preserve-save-triggers) 的话,M-x,C-g 正常,但是minibuffer是中文。

加的的话,minibuffer 正常切换为英文。但是C-g后就不正常。

所以,现在,就是 C-c C-g 还有 M-x C-g 不正常,是吧?

你再测试一下 C-x C-g, log上看没问题的。