Emacs 以编程方式区分系统类型——Windos XP v。视窗7
我正在寻求一些帮助,以编程方式区分系统类型Windows XP和Windows 7——使用相同的Emacs版本Emacs 以编程方式区分系统类型——Windos XP v。视窗7,emacs,elisp,Emacs,Elisp,我正在寻求一些帮助,以编程方式区分系统类型Windows XP和Windows 7——使用相同的Emacs版本 Emacs版本:2014-10-02在LEG570上发布的GNU Emacs 24.3.94.1(i686-pc-mingw32) 我想做一些类似的事情: (cond ((eq system-type 'darwin) . . .) ((and (eq system-type 'windows-nt) (eq ... Windows XP))
Emacs版本
:2014-10-02在LEG570上发布的GNU Emacs 24.3.94.1(i686-pc-mingw32)
我想做一些类似的事情:
(cond
((eq system-type 'darwin)
. . .)
((and
(eq system-type 'windows-nt)
(eq ... Windows XP)) ;; pseudocode
. . .)
((and
(eq system-type 'windows-nt)
(eq ... Windows 7)) ;; pseudocode
. . .) )
(cond ((equal (w32-version) '...) ...)
我认为这方面的做法如下:
- 系统类型为“windows nt”时具有子条件
- 解析某些外来代码的输出以获取Windows变量
if system-type is windows-nt
variant = parse (shell-command-to-string "ver")
conditions to run code for interesting variant with a default :else case
在这两个系统上尝试M-:x(w32版本)RET
。结果应该是不同的。
然后将其用于类似以下内容:
(cond
((eq system-type 'darwin)
. . .)
((and
(eq system-type 'windows-nt)
(eq ... Windows XP)) ;; pseudocode
. . .)
((and
(eq system-type 'windows-nt)
(eq ... Windows 7)) ;; pseudocode
. . .) )
(cond ((equal (w32-version) '...) ...)
谢谢你的建议。虽然你的建议很好,但是Stefan的答案更容易实现,所以我选择了那个。