chinese layer: fixes

- fix Source Code Pro not found issue
- add option to toggle youdao dict package.
- and also improve IM package installation.

use push instead of add-to-list
This commit is contained in:
andyque 2015-07-05 22:21:00 +08:00 committed by syl20bnr
parent 9e03747e55
commit c737da5952
3 changed files with 26 additions and 5 deletions

View File

@ -9,6 +9,7 @@
- [[#configuration][Configuration]]
- [[#configure-the-default-input-method配置默认中文输入法][Configure the Default Input Method(配置默认中文输入法)]]
- [[#configure-the-chinese-pyim-input-method配置中文拼音输入法][Configure the =Chinese-pyim= Input Method(配置中文拼音输入法)]]
- [[#enable-youdao有道-dictionary激活有道字典][Enable YouDao(有道) Dictionary(激活有道字典)]]
- [[#set-monospaced-font-size设置等宽字体][Set monospaced font size(设置等宽字体)]]
- [[#key-bindings][Key Bindings]]
- [[#youdao-dictionary][Youdao Dictionary]]
@ -46,6 +47,16 @@ file. You could call =pyim-dicts-manager= to open up the settings buffer and
press =i e= to install the default lexicon. The lexicon is about 20M, so you
should be patient when downloading starts. After the lexicon file is downloaded,
just press =s= to save and =R= to restart configuration.
*** Enable YouDao(有道) Dictionary(激活有道字典)
The YouDao Dictionary is disabled by default, if you want enable it.
You should set `chinese-enable-youdao-dict` to `t`.
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '((chinese :variables
chinese-enable-youdao-dict t)))
#+END_SRC
*** Set monospaced font size(设置等宽字体)
If you are mixing Chinese words with English words, the text is not perfectly

View File

@ -15,6 +15,9 @@
(defvar chinese-default-input-method 'pinyin
"The default chiense input method. Can be `wubi` or `pinyin`.")
(defvar chinese-enable-youdao-dict nil
"Enble YouDao Dict translation service.")
;; 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
@ -25,5 +28,6 @@
;; If the Hiragino Sans GB font is not found in your system, you could call this
;; method in dotspacemacs/config function with a different Chinese font name.
(when (system-is-mac)
(spacemacs//set-monospaced-font "Source Code Pro" "Hiragino Sans GB" 14 16))
;; If you are using mac, you could put the following code in your dotspacemacs/config function.
;; (when (system-is-mac)
;; (spacemacs//set-monospaced-font "Source Code Pro" "Hiragino Sans GB" 14 16))

View File

@ -14,13 +14,17 @@
;; which require an initialization must be listed explicitly in the list.
(setq chinese-packages
'(
youdao-dictionary
chinese-pyim
find-by-pinyin-dired
ace-pinyin
chinese-wbim
))
(if chinese-enable-youdao-dict
(push 'youdao-dictionary chinese-packages))
(if (eq chinese-default-input-method 'wubi)
(push 'chinese-wbim chinese-packages)
(push 'chinese-pyim chinese-packages))
(defun chinese/init-chinese-wbim ()
"Initialize chinese-wubi"
(use-package chinese-wbim
@ -40,6 +44,8 @@
(defun chinese/init-youdao-dictionary ()
(use-package youdao-dictionary
:if chinese-enable-youdao-dict
:defer
:config
(progn
;; Enable Cache