Skip to content

Commit 6438aba

Browse files
authored
添加“切到 evil-normal-state 时首项自动上屏”的可选功能 (#213)
* 添加“切到 evil-normal-state 时首项自动上屏”的可选功能; 优化 rime-commit1 相关函数的可读性; 同步修改 README 并稍作完善。 * 对过时函数名新增提示,以便平稳过渡。 * 对 README.org 和 INSTALLATION.org 进行大量结构优化(内容不变) * Sync README.org and INSTALLATION.org with the _EN ones. * sync README_EN.org to README.org. * Nearly full sync between CN and EN docs, but leave some translation undone. Tagged "TTBD" the parts to be translated in README_EN.org. * Minor fixes on html and indent. * translation, minor sync between CN and EN. * Translation. Minor fixes. * Translation. Most TTBDs are done. * Translation on the last TTBD, partly. * Translation all done. * Fix typo of "schema" * minor fix. * message minor fix. * Minor typo fix. * Minor fix about data dir part in README. * 将commit1与evil、toggle-input-method等解耦;新增全局commit1选项;同步更新中英文的README。 * Fix coding error. * Alter the position of defun of rime-commit1.
1 parent 0a50c91 commit 6438aba

File tree

5 files changed

+727
-386
lines changed

5 files changed

+727
-386
lines changed

INSTALLATION.org

Lines changed: 84 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
1-
#+title: Emacs Rime 安装与使用方法
1+
#+title: Emacs Rime 基本安装与使用方法
22

33
** 依赖
4-
54
- Emacs 26.1+ ,且需启用动态支持模块。
6-
75
- emacs-rime 会自动构建所需的动态模块,这需要 ~make~ 和 ~gcc~ 可用。
6+
*** 如何获得支持动态模块的 Emacs ?
7+
#+html: <details>
8+
#+html: <summary>切换折叠</summary>
9+
**** Linux
10+
Linux 各主要发行版自带 emacs 默认已启用动态模块支持。
11+
12+
**** MacOS
13+
***** emacs-plus 默认启用 ~--with-modules~ 选项,使用 homebrew 安装命令如下:
14+
#+BEGIN_SRC shell
15+
brew tap d12frosted/emacs-plus
16+
brew install emacs-plus
17+
#+END_SRC
18+
19+
***** emacs-mac 安装时需要启用 ~--with-modules~ 选项,使用 homebrew 安装命令如下 :
20+
#+BEGIN_SRC shell
21+
brew tap railwaycat/emacsmacport
22+
brew install emacs-mac --with-modules
23+
#+END_SRC
24+
25+
**** 手工编译
26+
27+
使用 ~--with-modules~ 选项.
28+
29+
#+html: </details>
830

931
** 安装 librime
1032

@@ -86,6 +108,28 @@
86108

87109
在 mingw64 环境中启动 emacs 来获取正确的 =SHELL= 环境变量,用来在 Emacs 内构建 librime-emacs 以及 =MSYSTEM_PREFIX= 环境变量来设置 ~rime-share-data-dir~ 变量。
88110

111+
*** 编译时无法找到 rime_api.h ?
112+
#+html: <details>
113+
#+html: <summary>切换折叠</summary>
114+
必须设置 ~rime-librime-root~ 参照安装方法中的说明。
115+
116+
#+html: </details>
117+
*** 编译时无法找到 emacs-module.h ?
118+
#+html: <details>
119+
#+html: <summary>切换折叠</summary>
120+
121+
如果自己编译 Emacs 且没有安装到标准目录(/usr/, /usr/local/),
122+
*必须* 指定 ~rime-emacs-module-header-root~ 。
123+
124+
在 ~:custom~ 中加入如下内容.
125+
126+
(假设将 Emacs 安装到了 ~/emacs)
127+
128+
#+BEGIN_SRC emacs-lisp
129+
(rime-emacs-module-header-root "~/emacs/include")
130+
#+END_SRC
131+
132+
#+html: </details>
89133
** 最小配置
90134

91135
Emacs Rime 已发布到 Melpa 。
@@ -96,40 +140,43 @@
96140
(default-input-method "rime"))
97141
#+end_src
98142

99-
#+html: <details>
100-
#+html: <summary>使用 Straight</summary>
101-
#+BEGIN_SRC emacs-lisp
102-
(use-package rime
103-
:straight (rime :type git
104-
:host github
105-
:repo "DogLooksGood/emacs-rime"
106-
:files ("*.el" "Makefile" "lib.c"))
107-
:custom
108-
(default-input-method "rime"))
109-
#+END_SRC
110-
#+html: </details>
111-
112-
#+html: <details>
113-
#+html: <summary>使用 Quelpa</summary>
114-
#+BEGIN_SRC emacs-lisp
115-
(use-package rime
116-
:quelpa (rime :fetcher github
117-
:repo "DogLooksGood/emacs-rime"
118-
:files ("*.el" "Makefile" "lib.c"))
119-
:custom
120-
(default-input-method "rime"))
121-
#+END_SRC
122-
#+html: </details>
123-
124-
*NOTE* 如果你在 MacOS 上或是选择自己编译 librime (没有放在系统路径中), *必须* 指定 ~rime-librime-root~ 。
125-
126-
在 ~:custom~ 中加入如下内容.
127-
128-
(假设将 librime 解压到了 ~/.emacs.d/librime)
129-
130-
#+BEGIN_SRC emacs-lisp
131-
(rime-librime-root "~/.emacs.d/librime/dist")
132-
#+END_SRC
143+
*** 使用 Straight
144+
#+html: <details>
145+
#+html: <summary>切换折叠</summary>
146+
#+BEGIN_SRC emacs-lisp
147+
(use-package rime
148+
:straight (rime :type git
149+
:host github
150+
:repo "DogLooksGood/emacs-rime"
151+
:files ("*.el" "Makefile" "lib.c"))
152+
:custom
153+
(default-input-method "rime"))
154+
#+END_SRC
155+
#+html: </details>
156+
157+
*** 使用 Quelpa
158+
#+html: <details>
159+
#+html: <summary>切换折叠</summary>
160+
#+BEGIN_SRC emacs-lisp
161+
(use-package rime
162+
:quelpa (rime :fetcher github
163+
:repo "DogLooksGood/emacs-rime"
164+
:files ("*.el" "Makefile" "lib.c"))
165+
:custom
166+
(default-input-method "rime"))
167+
#+END_SRC
168+
#+html: </details>
169+
170+
*** 注意(MacOS)
171+
*NOTE* 如果你在 MacOS 上或是选择自己编译 librime (没有放在系统路径中), *必须* 指定 ~rime-librime-root~ 。
172+
173+
在 ~:custom~ 中加入如下内容.
174+
175+
(假设将 librime 解压到了 ~/.emacs.d/librime)
176+
177+
#+BEGIN_SRC emacs-lisp
178+
(rime-librime-root "~/.emacs.d/librime/dist")
179+
#+END_SRC
133180

134181
** 激活 Rime 输入法
135182

INSTALLATION_EN.org

Lines changed: 79 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,31 @@
55
Emacs 26.1+ with dynamic modules support, ~gcc~ and ~make~.
66

77
emacs-rime will build dynamic module automatically.
8+
*** How to get Emacs with dynamic module support?
9+
10+
- **Linux**
11+
12+
Emacs included in major linux distributions has dynamic module support enabled by default.
13+
14+
- **MacOS**
15+
16+
~emacs-plus~ enables dynamic modules support by default. homebrew installation:
17+
#+BEGIN_SRC shell
18+
brew tap d12frosted/emacs-plus
19+
brew install emacs-plus
20+
#+END_SRC
21+
22+
When installing ~emacs-mac~, you need to add ~--with-modules~ option. homebrew installation:
23+
#+BEGIN_SRC shell
24+
brew tap railwaycat/emacsmacport
25+
brew install emacs-mac --with-modules
26+
#+END_SRC
27+
28+
- **Compile Emacs 26 manually**
29+
30+
Use ~--with-modules~ option.
31+
32+
833

934
** Install librime
1035

@@ -86,49 +111,65 @@
86111

87112
Start emacs from mingw64's environment to get the correct =SHELL= environment variable for building librime-emacs inside Emacs and =MSYSTEM_PREFIX= for specifying the ~rime-share-data-dir~ variable.
88113

114+
*** Can't find rime_api.h when compile?
115+
116+
You *MUST* specify ~rime-librime-root~ in this case.
117+
118+
Check Installation for how to set.
119+
120+
*** Can't find emacs-module.h when compile?
121+
122+
If you build Emacs by yourself and does not install to standard location,
123+
you *MUST* specify ~rime-emacs-module-header-root~.
124+
125+
Put following in the ~:custom~ section.
126+
127+
(Assuming you install Emacs to ~/emacs)
128+
129+
#+BEGIN_SRC emacs-lisp
130+
(rime-emacs-module-header-root "~/emacs/include")
131+
#+END_SRC
132+
89133
** Minimal configuration
90134

91-
#+BEGIN_SRC emacs-lisp
135+
#+BEGIN_SRC emacs-lisp
136+
(use-package rime
137+
:custom
138+
(default-input-method "rime"))
139+
#+END_SRC
140+
141+
*** Use Straight
142+
#+BEGIN_SRC emacs-lisp
92143
(use-package rime
144+
:straight (rime :type git
145+
:host github
146+
:repo "DogLooksGood/emacs-rime"
147+
:files ("*.el" "Makefile" "lib.c"))
93148
:custom
94149
(default-input-method "rime"))
95-
#+END_SRC
96-
97-
#+html: <details>
98-
#+html: <summary>Use Straight</summary>
99-
#+BEGIN_SRC emacs-lisp
100-
(use-package rime
101-
:straight (rime :type git
102-
:host github
103-
:repo "DogLooksGood/emacs-rime"
104-
:files ("*.el" "Makefile" "lib.c"))
105-
:custom
106-
(default-input-method "rime"))
107-
#+END_SRC
108-
#+html: </details>
109-
110-
#+html: <details>
111-
#+html: <summary>Use Quelpa</summary>
112-
#+BEGIN_SRC emacs-lisp
113-
(use-package rime
114-
:quelpa (rime :fetcher github
115-
:repo "DogLooksGood/emacs-rime"
116-
:files ("*.el" "Makefile" "lib.c"))
117-
:custom
118-
(default-input-method "rime"))
119-
#+END_SRC
120-
#+html: </details>
121-
122-
*NOTE*: If you are on MacOS or don't have librime in standard path,
123-
you *MUST* specify ~rime-librime-root~.
124-
125-
Put following in the ~:custom~ section.
126-
127-
(Assuming you unzip librime to ~/.emacs.d/librime)
128-
129-
#+BEGIN_SRC emacs-lisp
130-
(rime-librime-root "~/.emacs.d/librime/dist")
131-
#+END_SRC
150+
#+END_SRC
151+
152+
*** Use Quelpa
153+
#+BEGIN_SRC emacs-lisp
154+
(use-package rime
155+
:quelpa (rime :fetcher github
156+
:repo "DogLooksGood/emacs-rime"
157+
:files ("*.el" "Makefile" "lib.c"))
158+
:custom
159+
(default-input-method "rime"))
160+
#+END_SRC
161+
162+
*** NOTICE (MacOS)
163+
If you are on MacOS or don't have librime in standard path,
164+
you *MUST* specify ~rime-librime-root~.
165+
166+
Put following in the ~:custom~ section.
167+
168+
(Assuming you unzip librime to ~/.emacs.d/librime)
169+
170+
#+BEGIN_SRC emacs-lisp
171+
(rime-librime-root "~/.emacs.d/librime/dist")
172+
#+END_SRC
132173

133174
** Activate input method
134175

0 commit comments

Comments
 (0)