forked from tumashu/pyim-wbdict
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyim-wbdict.el
101 lines (83 loc) · 3.85 KB
/
pyim-wbdict.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
;;; pyim-wbdict.el --- Some wubi dicts for pyim -*- lexical-binding: t; -*-
;; * Header
;; Copyright (C) 2016 Feng Shu <[email protected]>
;; Author: Feng Shu <[email protected]>
;; URL: https://github.com/tumashu/pyim-wbdict
;; Version: 0.0.1
;; Package-Requires: ((pyim "1.0"))
;; Keywords: convenience, Chinese, pinyin, input-method, complete
;;; License:
;; This file is not part of GNU Emacs.
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 3
;; of the License, or (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;; * pyim-wbdict README :README:doc:
;; ** 简介
;; pyim-wbdict 是 pyim 的一个五笔词库包。
;; 1. pyim-wbdict-v86.pyim 源于 emacs-eim 的五笔词库。
;; 2. pyim-wbdict-v98.pyim 源于 98wubi-tables 的五笔词库。
;; 3. pyim-wbdict-v98-morphe.pyim 源于 98wubi-tables 的五笔词库。
;; ** 安装和使用
;; 1. 配置melpa源,参考:http://melpa.org/#/getting-started
;; 2. M-x package-install RET pyim-wbdict RET
;; 3. 在emacs配置文件中(比如: ~/.emacs)添加如下代码:
;; #+BEGIN_EXAMPLE
;; (require 'pyim-wbdict)
;; ;; (pyim-wbdict-v86-enable) ;86版五笔用户使用这个命令
;; ;; (pyim-wbdict-v98-enable) ;98版五笔用户使用这个命令
;; ;; (pyim-wbdict-v98-morphe-enable) ;98版五笔(单字)用户使用这个命令,该词库为超大字符集,部分生僻字形可能需要安装支持EXT-B的字体(如HanaMinB等)才能正确显示
;; #+END_EXAMPLE
;;; Code:
;; * 代码 :code:
;;;###autoload
(defun pyim-wbdict-v86-enable ()
"Add wubi dict (86 version) to pyim."
(interactive)
(let* ((dir (file-name-directory
(locate-library "pyim-wbdict.el")))
(file (concat dir "pyim-wbdict-v86.pyim")))
(when (file-exists-p file)
(if (featurep 'pyim)
(pyim-extra-dicts-add-dict
`(:name "wbdict-v86-elpa" :file ,file :elpa t))
(message "pyim 没有安装,pyim-wbdict 启用失败。")))))
;;;###autoload
(defun pyim-wbdict-v98-enable ()
"Add wubi dict (98 version) to pyim."
(interactive)
(let* ((dir (file-name-directory
(locate-library "pyim-wbdict.el")))
(file (concat dir "pyim-wbdict-v98.pyim")))
(when (file-exists-p file)
(if (featurep 'pyim)
(pyim-extra-dicts-add-dict
`(:name "wbdict-v98-elpa" :file ,file :elpa t))
(message "pyim 没有安装,pyim-wbdict 启用失败。")))))
;;;###autoload
(defun pyim-wbdict-v98-morphe-enable ()
"Add wubi dict (98 version with superset & single-word) to pyim."
(interactive)
(let* ((dir (file-name-directory
(locate-library "pyim-wbdict.el")))
(file (concat dir "pyim-wbdict-v98-morphe.pyim")))
(when (file-exists-p file)
(if (featurep 'pyim)
(pyim-extra-dicts-add-dict
`(:name "wbdict-v98-morphe-elpa" :file ,file :elpa t))
(message "pyim 没有安装,pyim-wbdict 启用失败。")))))
;;;###autoload
(define-obsolete-function-alias 'pyim-wbdict-gbk-enable 'pyim-wbdict-v98-enable "0.0.1")
(define-obsolete-function-alias 'pyim-wbdict-gb2312-enable 'pyim-wbdict-v98-enable "0.0.1")
;; * Footer
(provide 'pyim-wbdict)
;;; pyim-wbdict.el ends here