2

I can use fcitx normally in all of other programs. But I can't not use fcitx in Emacs which means I can not switch to other input method such as Chinese input method. I tried a lot and Googled a lot didn't find solution. This confuses me a lot!

I use emacs -q to start emacs.

Can you help me? Thanks in advance!

  1. Emacs version: 25.1.1
  2. fcitx version: 4.2.8.5
  3. Operating system: Slackware 14.2

uname -a output:

Linux Planet 4.4.38 #2 SMP Sun Dec 11 16:18:36 CST 2016 x86_64 Intel(R) Core(TM) i3-2330M CPU @ 2.20GHz GenuineIntel GNU/Linux

fcitx-diagnose output: fcitx-diagnose

~/.xprofile and ~/.profile both contain the following:

export XMODIFIERS=@im=fcitx
export LC_CTYPE=zh_CN.UTF-8
export QT_IM_MODULE=fcitx
export GTK_IM_MODULE=fcitx
abel_abel
  • 49
  • 5
  • Please give details of the problem rather than just dumping your config. E.g. show us what you've done, what you expected to happen, and what happened instead. – Stefan Feb 21 '17 at 13:41
  • What I expected to happen: I can switch to Chinese input method in Emacs using `C-M SPACE`. Now, I can use this shortcut in all of the other applications to switch between Chinese input method and English. But in Emacs I can't. I have tested a lot such as changing the shortcut to switch method in Fcitx configuration, change `~/.xprofile` and `~/.profile` as the [fcitx wiki](https://fcitx-im.org/wiki/Input_method_related_environment_variables) said. It doesn't work. – abel_abel Feb 21 '17 at 15:28
  • How do you start Emacs? Can you try `M-: (getenv "XMODIFIERS") RET` to make sure that your Emacs indeed gets the env-vars settings you put into your `~/.profile` (never heard of `~/.xprofile`). – Stefan Feb 22 '17 at 03:00
  • @Stefan Thanks! I start Emacs using `emacs -q` as I said in the question. I use the GUI version of Emacs. `M-: (getenv "XMODIFIERS") RET` returns `@im=fcitx` which is the same as the value I set in `~/.profile`. – abel_abel Feb 22 '17 at 03:12
  • Then I suggest you `M-x report-emacs-bug RET` so that Emacs maintainers can take a look at it: it sounds like a bug. – Stefan Feb 22 '17 at 04:37

2 Answers2

2

These are a few steps that worked for me:

  1. Edit the /etc/locale.gen file, uncomment zh_CN.UTF-8 UTF-8 line.
  2. Run sudo locale-gen.
  3. Make sure the correct fonts are installed. I used manjaro, so I installed xorg-fonts-misc-otb from AUR, the xorg-fonts-misc no longer provides the required fonts according to https://wiki.archlinux.org/index.php/Fcitx#Emacs. NOTE that needs to reboot after font installation.
  4. Start emacs with the command: LC_CTYPE=zh_CN.UTF-8 XMODIFIERS=@im=fcitx emacs. Reference: https://fcitx-im.or/wiki/Input_method_related_environment_variables
Jason
  • 2,950
  • 2
  • 30
  • 50
0

I've encountered something like this as well. The problem has something to do with locale settings (LC_CTIME in your case).

In my case, fcitx stopped working when I set LC_TIME for Emacs to en. Emacs daemon complained: Locale not supported by C library. Using the fallback 'C' locale. I'm not sure if the problem is caused by an invalid / unavailable locale or setting the locale to anything other than default.

Either way, removing your LC_CTIME line in your profile files should help.

Kisaragi Hiu
  • 202
  • 2
  • 8