[chinese] Fix fcitx.el. And add a variable

Make fcitx.el work by default, it was not configured properly.

Added a layer variable to decide if dbus should be used or not:
chinese-fcitx-use-dbus
(default: nil)

Corrected README.org:
It's the dbus interface (not fcitx-remote) that is needed for linux.
This commit is contained in:
AmaiKinono 2018-03-09 22:21:50 +08:00 committed by duianto
parent 3d4e6fc0df
commit 5b7b5f2526
4 changed files with 31 additions and 7 deletions

View file

@ -1103,6 +1103,11 @@ Other:
- New packages:
- Added package =chinese-conv= for conversion between simplified and
traditional Chinese texts (Xiang Ji)
- Improvements:
- Added variable =chinese-fcitx-use-dbus=, and fixed the misinformation about
dbus in README.org (thanks to AmaiKinono)
- Fixes:
- Make =fcitx.el= work by default (thanks to AmaiKinono)
**** Chrome
- Key bindings:
- Added =markdown= key bindings to gmail message mode

View file

@ -99,7 +99,17 @@ with the following configuration.
**** Requirement
***** Linux
You need to install =fcitx= and =fcitx-remote= on your machine.
You need to install =fcitx= on your machine.
It's recommended to use the dbus interface to speed up =fcitx= a little:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '((chinese :variables
chinese-enable-fcitx t
chinese-fcitx-use-dbus t)))
#+END_SRC
But notice that [[https://github.com/cute-jumper/fcitx.el/issues/30][this may lead to command lag]].
***** Mac OS X
We don't have a =fcitx= in OS X yet but we already added an emulation called

View file

@ -23,6 +23,9 @@
(defvar chinese-enable-fcitx nil
"Enable fcitx to help writing Chinese in Evil mode.")
(defvar chinese-fcitx-use-dbus nil
"Use dbus interface for fcitx.el.")
;; Set the monospaced font size when mixed Chinese and English words
(defun spacemacs//set-monospaced-font (english chinese english-size chinese-size)
(set-face-attribute 'default nil :font

View file

@ -26,8 +26,14 @@
(defun chinese/init-fcitx ()
(use-package fcitx
:init
(fcitx-evil-turn-on)))
:init (fcitx-evil-turn-on)
:config
(progn
(setq fcitx-active-evil-states '(insert emacs hybrid))
(fcitx-default-setup)
(fcitx-prefix-keys-add "M-m" "C-M-m")
(when chinese-fcitx-use-dbus
(setq fcitx-use-dbus t)))))
(defun chinese/init-chinese-wbim ()
"Initialize chinese-wubi"