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.
string-match
.
alpha-vms
aix-v3
berkeley-unix
dgux
gnu
gnu/linux
hpux
irix
ms-dos
next-mach
rtu
unisoft-unix
usg-unix-v
vax-vms
windows-nt
xenix
We 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.
(system-name) => "www.gnu.org"
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 section 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 section User Identification. (Since this is
done when Emacs starts up, the value actually used is the one saved when
Emacs was dumped. See section 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.
By default, the values are integers that are 100 times the system load
averages, which indicate the average number of processes trying to run.
If use-float is non-nil
, then they are returned
as floating point numbers and without multiplying by 100.
(load-average) => (169 48 36) (load-average t) => (1.69 0.48 0.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.
Go to the first, previous, next, last section, table of contents.