Giter Site home page Giter Site logo

fcitx.el's Introduction

fcitx.el

http://melpa.org/packages/fcitx-badge.svg http://stable.melpa.org/packages/fcitx-badge.svg

Better fcitx integration for Emacs.

中文版(需要更新)

This package provides a set of functions to make fcitx work better in Emacs.

This is originally designed to be used along with fcitx on Linux, but it can also be used on other platforms with other input methods.

Setup

Recommendation: install this package from melpa.

Or, if you like to manually install this package:

(add-to-list 'load-path "/path/to/fcitx.el")
(require 'fcitx)

You can choose between two different setup commands:

M-x fcitx-default-setup

or

M-x fcitx-aggressive-setup

The differences between these two setups will be explained later.

Example Settings

All the examples below use fcitx-aggressive-setup.

For Emacs users on Linux:

(fcitx-aggressive-setup)
(setq fcitx-use-dbus t)  ;; or set to 'fcitx5 if you use fcitx5

For Emacs users on OS X:

(fcitx-aggressive-setup)

For Spacemacs users:

;; Make sure the following comes before `(fcitx-aggressive-setup)'
(setq fcitx-active-evil-states '(insert emacs hybrid)) ; if you use hybrid mode
(fcitx-aggressive-setup)
(fcitx-prefix-keys-add "M-m") ; M-m is common in Spacemacs
;; (setq fcitx-use-dbus t) ; uncomment if you're using Linux

NOTE: In Linux, using the dbus interface has a better performance. But if you also set echo-keystrokes, you may experience a lagging issue. See #30. If that is something you can’t tolerate, don’t change the value of fcitx-use-dbus.

Features

This package comes with a bunch of features to provide better fcitx integration for Emacs. For every feature, you can enable or disable it using the corresponding *-turn-on or *-turn-off command.

To simplify the configuration, we provide two different setup commands, fcitx-default-setup and fcitx-aggressive-setup. They will enable different lists of features. You can choose the setup command that fits your need best. For users who want a better control, you can define and use your own setup command by enabling the features you want using the *-turn-on commands.

The Feature List

X indicates that the corresponding feature is enabled.

Featurefcitx-default-setupfcitx-aggressive-setup
Prefix-keyXX
EvilXX
Character & key inputXX
M-x,M-!,M-& and M-:X
Disable fcitx in minibufferX
org-speed-command supportXX
Isearch

Features Enabled in Both Setup Commands

The following features are enabled in both fcitx-default-setup and fcitx-aggressive-setup. You don’t have to do anything if you’re satisfied with the default settings.

Disable Fcitx by Prefix Keys

  • Why this feature

    If you’ve enabled fcitx, then you can’t easily change your buffer by C-x b because the second key, b, will be blocked by fcitx(and you need to press enter in order to send b to emacs). This feature allows you to temporarily disable fcitx after pressing some prefix keys you’ve defined.

  • What do the pre-defined setup comamnds do

    Both setup comamnds define C-x and C-c to be such prefix keys, which means fcitx will be disabled after C-x or C-c is pressed. This setting should be enough for most users.

  • For Spacemacs users

    If you’re a Spacemacs user who uses it in the Emacs way(or hybrid mode), it is possible that you want M-m to be the prefix key too. You can use the following command to add M-m:

    (fcitx-prefix-keys-add "M-m")
        
  • For users who want more customizations

    You can define the prefix keys as you want:

    (fcitx-prefix-keys-add "C-x" "C-c" "C-h" "M-s" "M-o")
        

    After defining prefix keys, you need to call

    (fcitx-prefix-keys-turn-on)
        

    to enable this feature.

    Of course, you can use

    (fcitx-prefix-keys-turn-off)
        

    to disable this feature.

Evil Support

  • Why this feature

    This feature allows you to disable fcitx when you exit the “insert mode” and to reenable fcitx after enter “insert mode”. Similar to fcitx.vim.

    In addition, it will also disable fcitx if you use switch-to-buffer or other-window to switch to a buffer which is not in “insert mode”. For example, if you’re currently in “insert mode” in buffer A and you’ve enabled fcitx, then you call switch-to-buffer to switch to another buffer B, which is currently, say, in normal mode, then fcitx will be disabled in buffer B.

  • What do the pre-defined setup comamnds do

    Both setup commands enable this feature. By default, fcitx.el consider both evil-insert-state and evil-emacs-state as “insert mode”. Any transition from evil-insert-state or evil-emacs-state to any other evil state will disable fcitx if necessary.

  • How to customize it

    The evil states in which fcitx should be enabled are defined in the variable fcitx-active-evil-states. The default value is (insert emacs), which means fcitx will be enabled if necessary when entering evil-insert-state or evil-emacs-state. For Spacemacs users who use its hybrid mode, you may also want to add hybrid mode to the list:

    (setq fcitx-active-evil-states '(insert emacs hybrid))
        
  • Bugs

    Note that currently the Evil support is not perfect. If you come across any bugs, consider filing an issue or creating a pull request.

Character & Key Input Support

  • Why this feature
    • Case 1: If you’re using ace-pinyin, you need to input a letter after calling ace-pinyin.
    • Case 2: You’re using C-h k to see the binding for a key sequence.

    In both cases, fcitx will block your input. This feature can make fcitx automatically disabled when you’re required to input a key sequence or a character.

  • What do the pre-defined setup comamnds do

    Both commands call (fcitx-read-funcs-turn-on) to enable this feature.

  • What if I don’t want it

    Use (fcitx-read-funcs-turn-off) to disable it.

org-speed-command Support

  • Why this feature

    This feature allows fcitx to be disabled when the cursor is at the beginning of an org heading so that you can use speed keys such as n and p.

  • What do the pre-defined setup comamnds do

    Both commands call (fcitx-org-speed-command-turn-on) to enable this feature.

  • What if I don’t want it

    Use (fcitx-org-speed-command-turn-off) to disable it.

Features Enabled ONLY in fcitx-default-setup Command

M-x, M-!, M-& and M-: Support

  • Why these features

    Usually you don’t want to type Chinese when you use M-x, M-! (shell-command), M-& (async-shell-command) or M-: (eval-expression). You can automatically disable fcitx when you’re using these commands.

  • What does fcitx-default-setup do

    It enables these features by calling the following commands:

    (fcitx-M-x-turn-on)
    (fcitx-shell-command-turn-on)
    (fcitx-eval-expression-turn-on)
        

    Your M-x binding should be one of execute-extended-command (the default M-x command), smex , helm-M-x and counsel-M-x.

    WARNING: If you rebind M-x to smex, helm-M-x, or counsel-M-x, then you should call fcitx-default-setup or fcitx-M-x-turn-on after the key rebinding.

  • How to customize it

    You can enable some of the above three features by calling their corresponding *-turn-on commands, but remember if you rebind your M-x, you should call (fcitx-M-x-turn-on) after the key rebinding.

Features Enabled ONLY in fcitx-aggressive-setup Command

Disable Fcitx in Minibuffer

  • Why this features

    For me, I personally don’t need to type Chinese in minibuffer, so I would like to temporarily disable fcitx in minibuffer, no matter in what kind of command. If you are the same as me, then you could choose this setup.

  • What does fcitx-aggressive-setup do

    Unlike fcitx-default-setup, it would not turn on M-x, M-!, M-& and M-: support. Instead, it will call fcitx-aggressive-minibuffer-turn-on to temporarily disable fcitx in all commands that use minibuffer as a source of input, including, but not limited to, M-x, M-!, M-& and M-:. That is why this is called “aggressive-setup”. For example, if you press C-x b to switch buffer, or press C-x C-f to find file, fcitx will be disabled when you are in the minibuffer so that you can type English letters directly. However, if you choose fcitx-default-setup, fcitx will not be disabled after you press C-x b or C-x C-f. I prefer this more aggressive setup because I don’t use Chinese in my filename or buffer name.

Extra Functions That are not Enabled in Both Commands

These functions are not enabled in either fcitx-default-setup or fcitx-aggressive-setup. You need to enable them manually if you want to use them.

I-search Support

Usually when you use fcitx, you also want to I-search in Chinese, so this feature is not enabled by eith fcitx-default-setup or fcitx-aggressive-setup. If you do want to disable fcitx when using I-search, enable this feature explicitly by

(fcitx-isearch-turn-on)

Using D-Bus Interface

For Linux users, it is recommended that you set fcitx-use-dbus to be non-=nil= to speed up a little (but pay attention to the lagging issue mentioned above):

(setq fcitx-use-dbus t)  ;; or 'fcitx5 if you use fcitx5

For OSX users who use fcitx-remote-for-osx, don’t set this variable.

Work with Other Input Methods

Although this package is named fcitx.el, it is not tightly coupled with fcitx itself. fcitx.el makes use of the tool fcitx-remote (or the dbus interface in Linux) to do the following two things:

  1. Know the status of the current input method (active or inactive)
  2. Activate or deactivate the input method

If you want to add support for other input methods, as long as it is possible to achieve the above two things from Emacs Lisp, then you get all the functionalities in fcitx.el for free. That said, you just need to provide three functions:

  1. one that returns the status of the current input method
  2. one to activate the input method
  3. one to deactivate the input method

So we can see that the functionalities provided in this package is very general, which can be easily adapted to used with other input methods.

TODO

  • Better Evil support

For more features, pull requests are always welcome!

fcitx.el's People

Contributors

blahgeek avatar cute-jumper avatar gfzeng avatar lins05 avatar pniedzielski avatar stepnem avatar wgjak47 avatar xuchunyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fcitx.el's Issues

Make it check when Emacs gets focused

Hello,

I often use fcitx to write Korean in another application (like web browser, chat program...). When I focus Emacs again, and I'm in Evil normal mode, I would like it to disable fcitx.
Is something like this easily added? Or should it work already and maybe it's only an issue with my setup?
Reading this it looks like maybe it would be enough to add a check at the switch-frame event.
But I'm a noob Emacs user.

spacemacs重新加载配置报错

spacemacs develop branch只添加chinese layer,使用fcitx5。

(chinese :variables
         chinese-use-fcitx5 t
         chinese-enable-fcitx t)

每次SPC f e R重新加载配置就*warning*buffer报错Error (use-package): fcitx/:config: Unknown ‘M-x’ binding command. Only original M-x, ‘smex’, ‘helm-M-x’ and ‘counsel-M-x’ are supported.

虽然不影响功能,但是每次都需要手动关闭*warning*buffer。请问如何解决?

Feature request: Add visual indicator for fcitx

Could you please consider adding a visual indicator (could be a unicode char, or a pretty symbol) at mode-line for fcitx to show if the input method is on? It will be cool to have that.

Aside from aesthetic reasons, I think it's super useful especially when we use emacs in fullscreen mode.

不支持 evil-insert-state 下的 C-o 命令

当采用 vim style 编辑时,有时会希望在 insert-state 下暂时运行一下 normal 的命令,这个功能绑定在 C-o,但是启用了 fcitx.el 后,按下 C-o 切换到 normal-state 后会立马切换回 insert-state,这应该是一个 bug,因为 fcitx 应该切换输入法,而不改变 evil state。

fcitx clobbers spacemacs when paste-transient-state triggers.

Here is the backtrace log I get by sending emacs SIGUSER2.

Debugger entered--Lisp error: (quit)
  dbus-call-method(:session "org.fcitx.Fcitx" "/inputmethod" "org.fcitx.Fcitx.InputMethod" "GetCurrentState")
  fcitx--active-p-dbus()
  fcitx--active-p()
  fcitx--evil-switch-buffer-before()
  fcitx--evil-switch-buffer( #[(buffer-or-name &optional norecord force-same-window)
    switch-to-buffer("*LV*")
  lv-window()
  lv-message(#("Pasting Transient State\n[6/6]  [C-j/C-k] cycles through yanked text, [p/P] pastes the same text  above or below. Anything else exits.\n[KEY] exits state  [KEY] will not exit" 0 23 (face spacemacs-transient-state-title-face) 32 35 (face hydra-face-red) 36 39 (face hydra-face-red) 70 71 (face hydra-face-red) 72 73 (face hydra-face-red) 134 135 (face italic) 135 138 (face (hydra-face-blue italic)) 138 154 (face italic) 154 157 (face (hydra-face-red italic)) 157 172 (face italic)))
  hydra-show-hint((concat #("Pasting Transient State\n" 0 23 (face spacemacs-transient-state-title-face)) (concat (format "[%s/%s]  [%s/%s] cycles through yanked text, [%s/%s] pastes the same text  above or below. Anything else exits." (length kill-ring-yank-pointer) (length kill-ring) #("C-j" 0 3 (face hydra-face-red)) #("C-k" 0 3 (face hydra-face-red)) #("p" 0 1 (face hydra-face-red)) #("P" 0 1 (face hydra-face-red))) "") nil #("\n[KEY] exits state  [KEY] will not exit" 1 2 (face italic) 2 5 (face (hydra-face-blue italic)) 5 21 (face italic) 21 24 (face (hydra-face-red italic)) 24 39 (face italic))) spacemacs/paste-transient-state)
  spacemacs/paste-transient-state/evil-paste-after()
  funcall-interactively(spacemacs/paste-transient-state/evil-paste-after)
  call-interactively(spacemacs/paste-transient-state/evil-paste-after nil nil)
  command-execute(spacemacs/paste-transient-state/evil-paste-after)
  execute-kbd-macro([112])
  evil-execute-repeat-info(([112]))
  evil-execute-repeat-info-with-count(nil ([112]))
  evil-repeat(nil nil)
  funcall-interactively(evil-repeat nil nil)
  call-interactively(evil-repeat nil nil)
  command-execute(evil-repeat)

I didn't activate fcitx in the first place. I don't know what causes spacemacs suspension.

Unable to activate fcitx in Emacs

I'm not sure whether this is a bug related to this package or Emacs itself, but since I've found this package, I'd like to post here for help.

I have never been able to get fcitx working in Emacs, though it works normally in other apps. I've read some blog posts on this topic, for example http://blog.fourcels.me/2015/11/11/emacs-support-fcitx.html and http://www.cnblogs.com/pylemon/archive/2012/01/05/2312682.html, but their method (set LC_CTYPE to zh_CN.UTF-8) didn't seem to help. After installing this package in Spacemacs, fcitx seems to be still not activated either.

Since I've found multiple posts on this topic, it must be a pretty commonplace issue. I'd like to know whether anybody has heard of it on Ubuntu and how they solved it, if applicable. I'm currently on Ubuntu 16.04 LTS with GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, modified by Debian. Thanks in advance.

fcitx-aggressive-setup makes tramp with sudo hangs on 'Sending password'

When I trun on aggressive setup, tramp with sudo will hangs on 'Sending password', I think it is a bug, I like the aggressive method but I need tramp with sudo to edit files as root, I hope you fix the bug and, to make more people easily get this nice plugin, can you add it to the elpa repository? Thanks

fcitx not disabled when use M-m to bring up which-key menu

In spacemacs while in emacs state, when hit M-m to bring up which-key menu, fcitx was not disabled as expected. Here is my fcitx.el setup:

(setq fcitx-use-dbus t)
(fcitx-aggressive-setup)

My system is archlinux 64 with emacs 24.5.1, spacemacs 0.105.9

After updating to emacs27, fcitx no longer works.

At the time of emacs26.3, fcitx worked very well. I upgraded the newly released emacs27 a few days ago, fcitx can be installed normally, but it cannot automatically switch to English when exiting from vim's insert mode.

怎么在用snippets的时候自动切换到英文

配置了snippets,让¥¥自动变成 $$ 并在其中输入公式。但是输入法还是中文的,不知道怎么配置。有什么方法吗?

具体环境是Ubuntu 20.10,emacs 27.2,doom org-mode yasnippets。

希望实现的功能是进入snippets时候自动切成英文,打公式,离开的时候切回中文。

[Feature request] Add support for avy-goto-char-2

When editing Chinese in insert state, I would like to use avy to jump around, when call avy-goto-char-2, it is still use Chinese Input method, I want it to change to English Input Method and switch back when jump action ended.

Thanks.

fcitx导致helm file出错

在一个无文件关联的buffer里做helm-file操作,比如保存新文件,或跳转,会抛出如下异常,

Error in post-command-hook (helm--maybe-update-keymap): (error "No buffer named *helm*")

堆栈如下,

Debugger entered--Lisp error: (file-missing "Setting current directory" "No such file or directory" "/home/amos/.emacs.d/private/snippets/org-mode/")
  call-process("fcitx-remote" nil nil nil "-c")
  fcitx--deactivate-proc()
  fcitx--deactivate()
  fcitx--evil-switch-buffer-after()
  fcitx--evil-switch-buffer(#[513 "\301 �?\205�

fcitx配置

(use-package fcitx)
(fcitx-aggressive-setup)

系统配置

 Archlinux
 Emacs 26.0.50.1
 fcitx 20161119
 spacemacs @7d75e651a4603c0b

f q 找不到 “强

如题。
在一行中出现的“强”字不能通过f q或者F q的方式找到

Turn off fcitx when current buffer is read only

When current buffer is read-only, it makes no sense to input Chinese there. So maybe we should add a predicate for this? Further, can we suppress fcitx totally when we in such buffer, even when we press the toggle key accidentally?

Not working as expected when navigating through which-key menu

The M-m prefix key works great in spacemacs. However there is still an unresolved issue. I'll try to describe it:

In spacemacs, pressing M-m in emacs/hybrid state will bring out the which-key menu, hinting on which key to press next in order to get the desired command. And pressing the corresponding key will bring out menu of next level or just run the command, and so on and so on. If I press a wrong key in that process, I can always hit C-h u to undo that key and return to last level of menu. However, with latest MELPA version of fcitx.el, When C-h u is pressed, the Chinese im tooltip still pops up.

fcitx-aggressive-setup makes trouble for evil visual action

In evil normal mode, key sequences like "v t a" means "select the text between the current cursor position and the first 'a' character". However, this stops working after (fcitx-aggressive-setup) is called.

After some digging I found it can be fixed by (fcitx-read-funcs-turn-off), but I'm not sure if this would affect other functionality of fcitx-remote.

在 Linux 完全下不工作

配置代码如下:

(when (eq system-type 'gnu/linux)
  ;; (fcitx-prefix-keys-add "SPC")
  ;; (setq fcitx-use-dbus 't)
  (setq fcitx-active-evil-states '(insert emacs hybrid))
  (fcitx-aggressive-setup)
  )

eshellterminal 下都试过了 fcitx-remote -c-o 都能正常切换输入法,问题应该不在 fcitx-remote 上。
同样地配置把 gnu/linux 换成 darwin 在 Mac 下是好用的,在 Linux 下写不写 when 语句都无效。 dbus 行注释与否都无效。
具体表现为进入 insert-mode ,切换中文输入法,按 esc ,还是中文输入法。

以下是系统信息:

  • 输入法: fcitx-rime
  • fcitx version: 4.2.9.6
  • OS: gnu/linux (x86_64-pc-linux-gnu)
  • Shell: /bin/bash
  • Emacs: 26.2 (Apr 13, 2019)
  • Doom: 2.0.9 (HEAD -> develop, origin/develop, origin/HEAD f754d4ff 2019-07-23 18:23:17 +0200)
  • Graphic display: t (daemon: nil)
  • System features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD LCMS2
  • Details:
    env bootstrapper: envvar-file
    elc count: 0
    uname -a:  Linux 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64
    modules:   (:completion company ivy :ui doom doom-dashboard doom-quit hl-todo modeline nav-flash ophints (popup +all +defaults) treemacs vc-gutter vi-tilde-fringe window-select workspaces :editor evil file-templates fold multiple-cursors rotate-text snippets :emacs dired electric vc :tools eval flycheck (lookup +docsets) magit :lang data emacs-lisp markdown (org +dragndrop +ipython +pandoc +present) python sh web :config default)
    packages:  (company-tabnine ox-gfm youdao-dictionary fcitx winum company-web)
    exec-path: (/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games ~/.emacs.d/bin ~/.emacs.d/bin /usr/lib/x86_64-linux-gnu/emacs/26.2/x86_64-linux-gnu/)

fcitx-aggressive-setup: Args out of range: "", 0

when i install fcitx
M-x fcitx-aggressive-setup
then the minibuf print:
fcitx-aggressive-setup: Args out of range: "", 0
and fcitx is not work normally
i am use spacemacs base on emacs 24.5

How do I even use fcitx with Emacs at all? Says "No input window"

Hi!

This is not an issue with fcitx.el, but how do I even use fcitx with Emacs at all? I'm on Linux Mint. I'm trying to use fcitx to type Korean Hangul. It works in the terminal, in the browser, and so on. But in Emacs (graphical) fcitx says "No input window", and it does not work at all. How do I make it work?

evil 设置问题

这个项目非常棒,解决了我在 emacs 的 evil 模式中频繁切换输入法的问题。
但和之前我直接用 fcitx-remote -c 相比,它太智能了:在编辑模式开启输入法 --> 一般模式自动关闭 --> 回到编辑模式自动开启。我只想用前一半的功能,也就是按 ESC 之后,我希望输入法永久关闭,而不是临时关闭,回到编辑模式也不开启。

也就是说,我只想在 esc 的时候触发,在按 i, a 等进入编辑模式的按键时不再触发

请问如何设置?

Hangs emacs with fcitx-remote-for-osx

Hello I develop a command line tools in osx called fcitx-remote-for-osx.It makes fcitx.el and fcitx.vim works for osx directly.But I meet some troubles and need help.

xcodebuild/fcitx-remote-for-osx#3

When I enable prefix keys related feature of fcitx.el,something like C-xC-f will hangs emacs.But I couldn't find the reason.

Emacs version:GNU Emacs 25.0.50.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1112)) of 2015-10-30

Spacemacs version:v.0.104.2

fcitx can't be reenable after enter the spacemacs hybrid mode

I use the example setting for spacemacs users in README.

It disable fcitx successfully when I press "M-m" or when I press "ESC" to exit the “hybrid insert mode”, but it can not reenable fcitx after I press "i" to enter “hybrid insert mode”.

Spacemacs 无法使用

Error (use-package): fcitx/:config: Unknown ‘M-x’ binding command. Only original M-x, ‘smex’, ‘helm-M-x’ and ‘counsel-M-x’ are supported.

spacemacs下添加chinese-enable-fcitx t后报错

cannot work with fcitx5

the version of my emacs is 28.1

the following is my configuration

(use-package fcitx    
  :ensure t    
  :config    
  (fcitx-aggressive-setup)    
  (setq fcitx-use-dbus t)    
  )    

and the error was reported

Warning (fcitx.el): `fcitx-remote' is not avaiable. Please check your fcitx installtion. Disable showing Disable logging

after googling, i found a solution from the post, https://kisaragi-hiu.com/why-fcitx5

here is my final configuration

(use-package fcitx
  :ensure t
  :config
  (setq fcitx-use-dbus nil
      fcitx-remote-command "fcitx5-remote")
  (fcitx-aggressive-setup))

从 org-capture 退出时不自动切换为英文

问题重现

在 org file 中使用中文输入,ESC 回到 normal state,然后 C-c c 进入 org-capture ,选中任意 templates 之后 按 i 进入 insert state,切换到中文输入,输入内容。到这里都没有问题,所有步骤都正常切换了输入法状态。
输入完成后, C-c C-c 保存退出(用 C-c C-k 不保存也是一样),光标回到 org file ,模式为 normal ,这时输入法状态为中文,按 i 试图进入 insert 模式的时候搜狗出现了……

另外,从 org file 中如果不用 ESC 回到 normal state 直接使用 C-c c 进入 org-capture,此时 org-capture 为 normal state ,这时也没有自动切换为英文。

求问是 fcitx 还需要进一步设置(已经用了 aggressive-setup )还是 package 设计就是需要先退回 normal 模式再切换 buffer ?

环境信息

OS: Mac OS X
Emacs: emacs 26.1 with spacemacs
spacemacs: V0.300.0
spacemacs branch: develop
spacemacs editing style: vim
Input method: Sogou
Package: fcitx.el fcitx-remote-for-osx.el
fcitx setup: (fcitx-aggressive-setup)

Latest master hangs emacs

  • OS: MacOS 10.12 Sierra
  • Emacs: 24.5.1
  • fcitx.el version: fcitx-20161013.1040 from MELPA

How to reproduce it?

Sometimes emacs seems to be calling fcitx-remote in an endless loop. When it hangs, I run the command pstree -p $(pgrep "(Emacs|emacs)"), and each time it should show a fcitx-remote process with a different pid.

When it happens, the only way I can do is to kill emacs by "pkill -9 Emacs".

(btw I suggest to add a .github issues template to this project to make it easier for people to provide the OS and emacs version when reporting issues).

D-Bus 功能不支持 Fcitx5

至少这里的 org.fcitx.Fcitx 得改成 org.fcitx.Fcitx5 ,不然 dbus 找不到对应的 .service 文件。

然而接下来就不知道应该怎么改了,dbus 看起来不认识这个 /inputmethod

fcitx.el/fcitx.el

Lines 558 to 578 in 12dc263

(defun fcitx--activate-dbus ()
(dbus-call-method :session
"org.fcitx.Fcitx"
"/inputmethod"
"org.fcitx.Fcitx.InputMethod"
"ActivateIM"))
(defun fcitx--deactivate-dbus ()
(dbus-call-method :session
"org.fcitx.Fcitx"
"/inputmethod"
"org.fcitx.Fcitx.InputMethod"
"InactivateIM"))
(defun fcitx--active-p-dbus ()
(= (dbus-call-method :session
"org.fcitx.Fcitx"
"/inputmethod"
"org.fcitx.Fcitx.InputMethod"
"GetCurrentState")
2))

fcitx-read-only-turn-on 不能正常工作

在配置文件中使用的 aggressive setup,然后写入了(ficitx-read-only-turn-on)
查了一下 read-only-mode-hook,已经正常添加了 hook:
(fcitx--read-only-mode-toggle doom-modeline-update-buffer-file-state-icon editorconfig-mode-apply)

但如果本来在中文输入法下时,切换到 read-only buffers (例如 C-h f、Treemacs)中依旧会在中文输入法状态下。

image

MacOS,emacs 26.1,未使用 evil

关于 fcitx5 使用的问题

我使用的是fcitx5, 安装该包,发现无效。

搜索历史,发现已经支持了。
feat: add fcitx5 support by custom fcitx-remote-command
在这里声称添加了对fcitx5的支持,可是 defvar fcitx-remote-command "fcixt-remote" 的意思不是说依然是fcitx-remote而不是fcitx5-remote吗?
是要修改源代码?还是用软链?(我现在的办法是前者)

开这个issue是想问,正确的使用方法是什么?

新功能建议:开发一个像chinese-pyim的探针函数

程序里面引号等不小心弄成中文字符,有时会死的很惨。能不能开发一个类似chinese-pyim
中的 pyim-probe-program-mode,实现:如果当前的 mode 衍生自 prog-mode,那么仅仅在字符串
和 comment 中开启中文输入模式。

spacemacs related - not working on evil-hybrid/normal-state change

Thank you for this amazing repo! fcitx.el is really a life-saver, with it I can use my favorite input method with evil instead of those far more inferior emacs counterparts. But the tradeoff is: it doesn't work on spacemacs hybrid state. Currently, My work around is to fork this repo and search-replace every insert-state with hybrid-state. It's ugly but that's all I can do right now since I'm not skilled in emacs lisp. So I'm wondering if this feature will be added in the future considering the fast growing spacemacs users? Thanks!

Can not quit minibuffer which is in minibuffer-inactive-mode

I meet a subtle bug looks for a long time, it looks like caused by fcitx.el:

The emacs is not quit minibuffer automatically, the cursor leave in
minibuffer and the minibuffer's major mode is `minibuffer-inactive-mode`.
Such as press "C-x f" then "C-q", the cursor leave in minibuffer in
`minibuffer-inactive-mode`, the only thing i can do is switch to other buffer.

This bug come and gone occasionally, i try to capture the root cause but with no luck.
When i execute (fcitx-prefix-keys-turn-off) today, this bug gone soon:).

My configuration:

(fcitx-aggressive-setup)

Emacs version:

GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.35, cairo version 1.17.6) of 2022-12-05

It looks like this bug appears when come to use Emacs-28, Emacs-29 and Emacs-30.

Doesn't work in evil-emacs-state

Because many minor mode keybindings will be override by evil-insert-state.

When evil enter evil-insert-state , I change it to emacs state.

And I like the original Emacs key bindings (c-n/c-p/c-a etc) for editing text.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.