GNU Emacs Lisp Reference Manual
Emacs provides access to variables in the operating system environment through various functions. These variables include the name of the system, the user's UID, and so on.
aix-v3berkeley-unixdguxgnuhpuxirixlinuxms-dosnext-machrtuunisoft-unixusg-unix-vvax-vmswindows-ntxenixWe do not wish to add new symbols to make finer distinctions unless it is absolutely necessary! In fact, we hope to eliminate some of these alternatives in the future. We recommend using system-configuration to distinguish between different operating systems.
string-match.(system-name)
=> "prep.ai.mit.edu"
The symbol system-name is a variable as well as a function. In fact, the function returns whatever value the variable system-name currently holds. Thus, you can set the variable system-name in case Emacs is confused about the name of your system. The variable is also useful for constructing frame titles (see Frame Titles).
nil, it is used instead of system-name for purposes of generating email addresses. For example, it is used when constructing the default value of user-mail-address. See User Identification. (Since this is done when Emacs starts up, the value actually used is the one saved when Emacs was dumped. See Building Emacs.)process-environment. (getenv "USER")
=> "lewis"
lewis@slug[10] % printenv
PATH=.:/user/lewis/bin:/usr/bin:/usr/local/bin
USER=lewis
TERM=ibmapa16
SHELL=/bin/csh
HOME=/user/lewis
process-environment; binding that variable with let is also reasonable practice.getenv and setenv work by means of this variable. process-environment
=> ("l=/usr/stanford/lib/gnuemacs/lisp"
"PATH=.:/user/lewis/bin:/usr/class:/nfsusr/local/bin"
"USER=lewis"
"TERM=ibmapa16"
"SHELL=/bin/csh"
"HOME=/user/lewis")
":" for Unix and GNU systems, and ";" for MS-DOS and Windows NT.nil if that directory cannot be determined.nil, this is a directory within which to look for the `lib-src' and `etc' subdirectories. This is non-nil when Emacs can't find those directories in their standard installed locations, but can find them in a directory related somehow to the one containing the Emacs executable.(load-average)
=> (169 48 36)
lewis@rocky[5] % uptime
11:55am up 1 day, 19:37, 3 users,
load average: 1.69, 0.48, 0.36
t or nil, indicating whether the privilege is to be turned on or off. Its default is nil. The function returns t if successful, nil otherwise. If the third argument, getprv, is non-nil, setprv does not change the privilege, but returns t or nil indicating whether the privilege is currently enabled.