aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-03-26 20:49:32 -0400
committerGlenn Morris2012-03-26 20:49:32 -0400
commitcf0495f2cd34a7ffb5ab3437337f386f11827eaa (patch)
tree0e8ba97d339b34bacbf4defc28f45e7f601068fe
parentf9210e18be29dd83fab9f4e260a29f6e6e5f0c62 (diff)
downloademacs-cf0495f2cd34a7ffb5ab3437337f386f11827eaa.tar.gz
emacs-cf0495f2cd34a7ffb5ab3437337f386f11827eaa.zip
More lispref/os.texi small edits
* doc/lispref/os.texi (System Environment): Copyedits. Remove some examples that do not seem useful. Mention setenv third arg. tty-erase-char does not seem to be nil under a window-system. (User Identification): Copyedits. Remove some examples that do not seem useful.
-rw-r--r--doc/lispref/ChangeLog8
-rw-r--r--doc/lispref/os.texi169
2 files changed, 83 insertions, 94 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index d80732833e8..406948b9601 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,11 @@
12012-03-27 Glenn Morris <rgm@gnu.org>
2
3 * os.texi (System Environment): Copyedits. Remove some examples
4 that do not seem useful. Mention setenv third arg.
5 tty-erase-char does not seem to be nil under a window-system.
6 (User Identification): Copyedits.
7 Remove some examples that do not seem useful.
8
12012-03-26 Glenn Morris <rgm@gnu.org> 92012-03-26 Glenn Morris <rgm@gnu.org>
2 10
3 * os.texi (Startup Summary): Copyedits. Fix startup screen logic. 11 * os.texi (Startup Summary): Copyedits. Fix startup screen logic.
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 7e4cfc0e31f..ebf2a35925a 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -833,15 +833,15 @@ system, the user's @acronym{UID}, and so on.
833 833
834@defvar system-configuration 834@defvar system-configuration
835This variable holds the standard GNU configuration name for the 835This variable holds the standard GNU configuration name for the
836hardware/software configuration of your system, as a string. The 836hardware/software configuration of your system, as a string. For
837convenient way to test parts of this string is with 837example, a typical value for a 64-bit GNU/Linux system is
838@code{string-match}. 838@samp{"x86_64-unknown-linux-gnu"}.
839@end defvar 839@end defvar
840 840
841@cindex system type and name 841@cindex system type and name
842@defvar system-type 842@defvar system-type
843The value of this variable is a symbol indicating the type of operating 843The value of this variable is a symbol indicating the type of operating
844system Emacs is operating on. Here is a table of the possible values: 844system Emacs is running on. The possible values are:
845 845
846@table @code 846@table @code
847@item aix 847@item aix
@@ -861,7 +861,7 @@ The GNU system (using the GNU kernel, which consists of the HURD and Mach).
861 861
862@item gnu/linux 862@item gnu/linux
863A GNU/Linux system---that is, a variant GNU system, using the Linux 863A GNU/Linux system---that is, a variant GNU system, using the Linux
864kernel. (These systems are the ones people often call ``Linux,'' but 864kernel. (These systems are the ones people often call ``Linux'', but
865actually Linux is just the kernel, not the whole system.) 865actually Linux is just the kernel, not the whole system.)
866 866
867@item gnu/kfreebsd 867@item gnu/kfreebsd
@@ -874,33 +874,28 @@ Hewlett-Packard HPUX operating system.
874Silicon Graphics Irix system. 874Silicon Graphics Irix system.
875 875
876@item ms-dos 876@item ms-dos
877Microsoft MS-DOS ``operating system.'' Emacs compiled with DJGPP for 877Microsoft's DOS. Emacs compiled with DJGPP for MS-DOS binds
878MS-DOS binds @code{system-type} to @code{ms-dos} even when you run it on 878@code{system-type} to @code{ms-dos} even when you run it on MS-Windows.
879MS-Windows.
880 879
881@item usg-unix-v 880@item usg-unix-v
882AT&T Unix System V. 881AT&T Unix System V.
883 882
884@item windows-nt 883@item windows-nt
885Microsoft Windows NT and later. The same executable supports Windows 884Microsoft Windows NT, 9X and later. The value of @code{system-type}
8869X, but the value of @code{system-type} is @code{windows-nt} in either 885is always @code{windows-nt}, e.g. even on Windows 7.
887case.
888 886
889@end table 887@end table
890 888
891We do not wish to add new symbols to make finer distinctions unless it 889We do not wish to add new symbols to make finer distinctions unless it
892is absolutely necessary! In fact, we hope to eliminate some of these 890is absolutely necessary! In fact, we hope to eliminate some of these
893alternatives in the future. We recommend using 891alternatives in the future. If you need to make a finer distinction
894@code{system-configuration} to distinguish between different operating 892than @code{system-type} allows for, you can test
895systems. 893@code{system-configuration}, e.g. against a regexp.
896@end defvar 894@end defvar
897 895
898@defun system-name 896@defun system-name
899This function returns the name of the machine you are running on. 897This function returns the name of the machine you are running on, as a
900@example 898string.
901(system-name)
902 @result{} "www.gnu.org"
903@end example
904@end defun 899@end defun
905 900
906 The symbol @code{system-name} is a variable as well as a function. In 901 The symbol @code{system-name} is a variable as well as a function. In
@@ -910,6 +905,7 @@ fact, the function returns whatever value the variable
910system. The variable is also useful for constructing frame titles 905system. The variable is also useful for constructing frame titles
911(@pxref{Frame Titles}). 906(@pxref{Frame Titles}).
912 907
908@c FIXME seems like this section is not the best place for this option?
913@defopt mail-host-address 909@defopt mail-host-address
914If this variable is non-@code{nil}, it is used instead of 910If this variable is non-@code{nil}, it is used instead of
915@code{system-name} for purposes of generating email addresses. For 911@code{system-name} for purposes of generating email addresses. For
@@ -917,37 +913,43 @@ example, it is used when constructing the default value of
917@code{user-mail-address}. @xref{User Identification}. (Since this is 913@code{user-mail-address}. @xref{User Identification}. (Since this is
918done when Emacs starts up, the value actually used is the one saved when 914done when Emacs starts up, the value actually used is the one saved when
919Emacs was dumped. @xref{Building Emacs}.) 915Emacs was dumped. @xref{Building Emacs}.)
916@c FIXME sounds like should probably give this a :set-after and some
917@c custom-initialize-delay voodoo.
920@end defopt 918@end defopt
921 919
922@deffn Command getenv var &optional frame 920@deffn Command getenv var &optional frame
923@cindex environment variable access 921@cindex environment variable access
924This function returns the value of the environment variable @var{var}, 922This function returns the value of the environment variable @var{var},
925as a string. @var{var} should be a string. If @var{var} is undefined 923as a string. @var{var} should be a string. If @var{var} is undefined
926in the environment, @code{getenv} returns @code{nil}. If returns 924in the environment, @code{getenv} returns @code{nil}. It returns
927@samp{""} if @var{var} is set but null. Within Emacs, the environment 925@samp{""} if @var{var} is set but null. Within Emacs, a list of environment
928variable values are kept in the Lisp variable @code{process-environment}. 926variables and their values is kept in the variable @code{process-environment}.
929 927
930@example 928@example
931@group 929@group
932(getenv "USER") 930(getenv "USER")
933 @result{} "lewis" 931 @result{} "lewis"
934@end group 932@end group
933@end example
934
935The shell command @code{printenv} prints all or part of the environment:
935 936
937@example
936@group 938@group
937lewis@@slug[10] % printenv 939bash$ printenv
938PATH=.:/user/lewis/bin:/usr/bin:/usr/local/bin 940PATH=/usr/local/bin:/usr/bin:/bin
939USER=lewis 941USER=lewis
940@end group 942@end group
941@group 943@group
942TERM=ibmapa16 944TERM=xterm
943SHELL=/bin/csh 945SHELL=/bin/bash
944HOME=/user/lewis 946HOME=/home/lewis
945@end group 947@end group
948@dots{}
946@end example 949@end example
947@end deffn 950@end deffn
948 951
949@c Emacs 19 feature 952@deffn Command setenv variable &optional value substitute
950@deffn Command setenv variable &optional value
951This command sets the value of the environment variable named 953This command sets the value of the environment variable named
952@var{variable} to @var{value}. @var{variable} should be a string. 954@var{variable} to @var{value}. @var{variable} should be a string.
953Internally, Emacs Lisp can handle any string. However, normally 955Internally, Emacs Lisp can handle any string. However, normally
@@ -955,8 +957,13 @@ Internally, Emacs Lisp can handle any string. However, normally
955of letters, digits and underscores, starting with a letter or 957of letters, digits and underscores, starting with a letter or
956underscore. Otherwise, errors may occur if subprocesses of Emacs try 958underscore. Otherwise, errors may occur if subprocesses of Emacs try
957to access the value of @var{variable}. If @var{value} is omitted or 959to access the value of @var{variable}. If @var{value} is omitted or
958@code{nil}, @code{setenv} removes @var{variable} from the environment. 960@code{nil} (or, interactively, with a prefix argument), @code{setenv}
959Otherwise, @var{value} should be a string. 961removes @var{variable} from the environment. Otherwise, @var{value}
962should be a string.
963
964If the optional argument @var{substitute} is non-@code{nil}, Emacs
965calls the function @code{substitute-env-vars} to expand any
966environment variables in @var{value}.
960 967
961@code{setenv} works by modifying @code{process-environment}; binding 968@code{setenv} works by modifying @code{process-environment}; binding
962that variable with @code{let} is also reasonable practice. 969that variable with @code{let} is also reasonable practice.
@@ -973,14 +980,14 @@ of this variable.
973@smallexample 980@smallexample
974@group 981@group
975process-environment 982process-environment
976@result{} ("l=/usr/stanford/lib/gnuemacs/lisp" 983@result{} ("PATH=/usr/local/bin:/usr/bin:/bin"
977 "PATH=.:/user/lewis/bin:/usr/class:/nfsusr/local/bin"
978 "USER=lewis" 984 "USER=lewis"
979@end group 985@end group
980@group 986@group
981 "TERM=ibmapa16" 987 "TERM=xterm"
982 "SHELL=/bin/csh" 988 "SHELL=/bin/bash"
983 "HOME=/user/lewis") 989 "HOME=/home/lewis"
990 @dots{})
984@end group 991@end group
985@end smallexample 992@end smallexample
986 993
@@ -991,23 +998,21 @@ specifies the variable, and the other ``duplicates'' are ignored.
991 998
992@defvar initial-environment 999@defvar initial-environment
993This variable holds the list of environment variables Emacs inherited 1000This variable holds the list of environment variables Emacs inherited
994from its parent process. It is computed during startup, see 1001from its parent process when Emacs started.
995@ref{Startup Summary}.
996@end defvar 1002@end defvar
997 1003
998@defvar path-separator 1004@defvar path-separator
999This variable holds a string which says which character separates 1005This variable holds a string that says which character separates
1000directories in a search path (as found in an environment variable). Its 1006directories in a search path (as found in an environment variable). Its
1001value is @code{":"} for Unix and GNU systems, and @code{";"} for MS-DOS 1007value is @code{":"} for Unix and GNU systems, and @code{";"} for MS systems.
1002and MS-Windows.
1003@end defvar 1008@end defvar
1004 1009
1005@defun parse-colon-path path 1010@defun parse-colon-path path
1006This function takes a search path string such as would be the value of 1011This function takes a search path string such as the value of
1007the @code{PATH} environment variable, and splits it at the separators, 1012the @code{PATH} environment variable, and splits it at the separators,
1008returning a list of directory names. @code{nil} in this list stands for 1013returning a list of directory names. @code{nil} in this list means
1009``use the current directory.'' Although the function's name says 1014the current directory. Although the function's name says
1010``colon,'' it actually uses the value of @code{path-separator}. 1015``colon'', it actually uses the value of @code{path-separator}.
1011 1016
1012@example 1017@example
1013(parse-colon-path ":/foo:/bar") 1018(parse-colon-path ":/foo:/bar")
@@ -1022,30 +1027,32 @@ value is a string, and does not include a directory name.
1022 1027
1023@defvar invocation-directory 1028@defvar invocation-directory
1024This variable holds the directory from which the Emacs executable was 1029This variable holds the directory from which the Emacs executable was
1025invoked, or perhaps @code{nil} if that directory cannot be determined. 1030invoked, or @code{nil} if that directory cannot be determined.
1026@end defvar 1031@end defvar
1027 1032
1028@defvar installation-directory 1033@defvar installation-directory
1029If non-@code{nil}, this is a directory within which to look for the 1034If non-@code{nil}, this is a directory within which to look for the
1030@file{lib-src} and @file{etc} subdirectories. This is non-@code{nil} 1035@file{lib-src} and @file{etc} subdirectories. In an installed Emacs,
1036it is normally @code{nil}. It is non-@code{nil}
1031when Emacs can't find those directories in their standard installed 1037when Emacs can't find those directories in their standard installed
1032locations, but can find them in a directory related somehow to the one 1038locations, but can find them in a directory related somehow to the one
1033containing the Emacs executable. 1039containing the Emacs executable (i.e., @code{invocation-directory}).
1034@end defvar 1040@end defvar
1035 1041
1036@defun load-average &optional use-float 1042@defun load-average &optional use-float
1037This function returns the current 1-minute, 5-minute, and 15-minute load 1043This function returns the current 1-minute, 5-minute, and 15-minute
1038averages, in a list. 1044system load averages, in a list. The load average indicates the
1045number of processes trying to run on the system.
1039 1046
1040By default, the values are integers that are 100 times the system load 1047By default, the values are integers that are 100 times the system load
1041averages, which indicate the average number of processes trying to run. 1048averages, but if @var{use-float} is non-@code{nil}, then they are
1042If @var{use-float} is non-@code{nil}, then they are returned 1049returned as floating point numbers without multiplying by 100.
1043as floating point numbers and without multiplying by 100.
1044 1050
1045If it is impossible to obtain the load average, this function signals 1051If it is impossible to obtain the load average, this function signals
1046an error. On some platforms, access to load averages requires 1052an error. On some platforms, access to load averages requires
1047installing Emacs as setuid or setgid so that it can read kernel 1053installing Emacs as setuid or setgid so that it can read kernel
1048information, and that usually isn't advisable. 1054information, and that usually isn't advisable.
1055@c FIXME which platforms are these? Are they still relevant?
1049 1056
1050If the 1-minute load average is available, but the 5- or 15-minute 1057If the 1-minute load average is available, but the 5- or 15-minute
1051averages are not, this function returns a shortened list containing 1058averages are not, this function returns a shortened list containing
@@ -1060,13 +1067,9 @@ the available averages.
1060(load-average t) 1067(load-average t)
1061 @result{} (1.69 0.48 0.36) 1068 @result{} (1.69 0.48 0.36)
1062@end group 1069@end group
1063
1064@group
1065lewis@@rocky[5] % uptime
1066 11:55am up 1 day, 19:37, 3 users,
1067 load average: 1.69, 0.48, 0.36
1068@end group
1069@end example 1070@end example
1071
1072The shell command @code{uptime} returns similar information.
1070@end defun 1073@end defun
1071 1074
1072@defun emacs-pid 1075@defun emacs-pid
@@ -1077,7 +1080,8 @@ as an integer.
1077@defvar tty-erase-char 1080@defvar tty-erase-char
1078This variable holds the erase character that was selected 1081This variable holds the erase character that was selected
1079in the system's terminal driver, before Emacs was started. 1082in the system's terminal driver, before Emacs was started.
1080The value is @code{nil} if Emacs is running under a window system. 1083@c FIXME? Seems untrue since 23.1. For me, it is 0.
1084@c The value is @code{nil} if Emacs is running under a window system.
1081@end defvar 1085@end defvar
1082 1086
1083@node User Identification 1087@node User Identification
@@ -1107,27 +1111,18 @@ want to use the default value.
1107@end defopt 1111@end defopt
1108 1112
1109@defun user-login-name &optional uid 1113@defun user-login-name &optional uid
1110If you don't specify @var{uid}, this function returns the name under 1114This function returns the name under which the user is logged in.
1111which the user is logged in. If the environment variable @code{LOGNAME} 1115It uses the environment variables @code{LOGNAME} or @code{USER} if
1112is set, that value is used. Otherwise, if the environment variable 1116either is set. Otherwise, the value is based on the effective
1113@code{USER} is set, that value is used. Otherwise, the value is based 1117@acronym{UID}, not the real @acronym{UID}.
1114on the effective @acronym{UID}, not the real @acronym{UID}.
1115 1118
1116If you specify @var{uid}, the value is the user name that corresponds 1119If you specify @var{uid} (a number), the result is the user name that
1117to @var{uid} (which should be an integer), or @code{nil} if there is 1120corresponds to @var{uid}, or @code{nil} if there is no such user.
1118no such user.
1119
1120@example
1121@group
1122(user-login-name)
1123 @result{} "lewis"
1124@end group
1125@end example
1126@end defun 1121@end defun
1127 1122
1128@defun user-real-login-name 1123@defun user-real-login-name
1129This function returns the user name corresponding to Emacs's real 1124This function returns the user name corresponding to Emacs's real
1130@acronym{UID}. This ignores the effective @acronym{UID} and ignores the 1125@acronym{UID}. This ignores the effective @acronym{UID}, and the
1131environment variables @code{LOGNAME} and @code{USER}. 1126environment variables @code{LOGNAME} and @code{USER}.
1132@end defun 1127@end defun
1133 1128
@@ -1135,16 +1130,8 @@ environment variables @code{LOGNAME} and @code{USER}.
1135This function returns the full name of the logged-in user---or the value 1130This function returns the full name of the logged-in user---or the value
1136of the environment variable @code{NAME}, if that is set. 1131of the environment variable @code{NAME}, if that is set.
1137 1132
1138@c "Bil" is the correct spelling. 1133If the Emacs process's user-id does not correspond to any known user (and
1139@example 1134provided @code{NAME} is not set), the result is @code{"unknown"}.
1140@group
1141(user-full-name)
1142 @result{} "Bil Lewis"
1143@end group
1144@end example
1145
1146If the Emacs job's user-id does not correspond to any known user (and
1147provided @code{NAME} is not set), the value is @code{"unknown"}.
1148 1135
1149If @var{uid} is non-@code{nil}, then it should be a number (a user-id) 1136If @var{uid} is non-@code{nil}, then it should be a number (a user-id)
1150or a string (a login name). Then @code{user-full-name} returns the full 1137or a string (a login name). Then @code{user-full-name} returns the full
@@ -1164,14 +1151,8 @@ Titles}).
1164 1151
1165@defun user-real-uid 1152@defun user-real-uid
1166This function returns the real @acronym{UID} of the user. 1153This function returns the real @acronym{UID} of the user.
1167The value may be a floating point number. 1154The value may be a floating point number, in the (unlikely) event that
1168 1155the UID is too large to fit in a Lisp integer.
1169@example
1170@group
1171(user-real-uid)
1172 @result{} 19
1173@end group
1174@end example
1175@end defun 1156@end defun
1176 1157
1177@defun user-uid 1158@defun user-uid