EmacsでOSの違いを判定する変数

Emacsの設定ファイルでOSによって設定を変えたい場合は、
system-typeという変数を使います。

system-typeの値は
`gnu’ compiled for a GNU Hurd system.
`gnu/linux’ compiled for a GNU/Linux system.
`gnu/kfreebsd’ compiled for a GNU system with a FreeBSD kernel.
`darwin’ compiled for Darwin (GNU-Darwin, Mac OS X, …).
`ms-dos’ compiled as an MS-DOS application.
`windows-nt’ compiled as a native W32 application.
`cygwin’ compiled using the Cygwin library.
という値になりますので、例えば

(if (eq system-type 'gnu/linux)
    (load "~/.emacs.d/.gnu-linux.emacs")
)

とすれば、GNU/Linuxの場合のみの設定ができます。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です