How can I find out which OS I am running in Emacs?
I开发者_JAVA百科s there an Elisp command which can return "Mac", "Windows", "linux", etc??
system-type is a variable defined in `C source code'. Its value is gnu/linux
Documentation: The value is a symbol indicating the type of operating system you are using. Special values:
`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.
Anything else (in Emacs 23.1, the possibilities are: aix, berkeley-unix, hpux, irix, lynxos 3.0.1, usg-unix-v) indicates some sort of Unix system.
精彩评论