以下伪代码的elisp代码
if "the emacs version is less than 23.1.x"
do
something
else
something-else
Run Code Online (Sandbox Code Playgroud)
写成
(if (or (< emacs-major-version 23)
(and (= emacs-major-version 23)
(<= emacs-minor-version 1)))
(setq color-theme-is-global t)
(color-theme-initialize))
Run Code Online (Sandbox Code Playgroud)
如何优化上面的代码,以便"emacs-major-version"不会被引用两次.
Mic*_*ert 11
没有必要,有version<=和emacs-version
(if (version<= emacs-version "23.1")
(setq color-theme-is-global t)
(color-theme-initialize))
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
364 次 |
| 最近记录: |