Next: , Previous: , Up: System Interface   [Contents][Index]


58.4 User Identification

Variable: user-mail-address

This holds the nominal email address of the user who is using SXEmacs. When SXEmacs starts up, it computes a default value that is usually right, but users often set this themselves when the default value is not right.

Function: user-login-name &optional uid

If you do not specify uid, this function returns the name under which the user is logged in. If the environment variable LOGNAME is set, that value is used. Otherwise, if the environment variable USER is set, that value is used. Otherwise, the value is based on the effective UID, not the real UID.

If you specify uid, the value is the user name that corresponds to uid (which should be an integer).

(user-login-name)
     ⇒ "lewis"
Function: user-real-login-name

This function returns the user name corresponding to SXEmacs’s real UID. This ignores the effective UID and ignores the environment variables LOGNAME and USER.

Variable: user-full-name

This variable holds the name of the user running this SXEmacs. It is initialized at startup time from the value of NAME environment variable. You can change the value of this variable to alter the result of the user-full-name function.

Function: user-full-name &optional user

This function returns the full name of user. If user is nil, it defaults to the user running this SXEmacs. In that case, the value of user-full-name variable, if non-nil, will be used.

If user is specified explicitly, user-full-name variable is ignored.

(user-full-name)
     ⇒ "Hrvoje Niksic"
(setq user-full-name "Hrvoje \"Niksa\" Niksic")
(user-full-name)
     ⇒ "Hrvoje \"Niksa\" Niksic"
(user-full-name "hniksic")
     ⇒ "Hrvoje Niksic"

The symbols user-login-name, user-real-login-name and user-full-name are variables as well as functions. The functions return the same values that the variables hold. These variables allow you to “fake out” SXEmacs by telling the functions what to return. The variables are also useful for constructing frame titles (see Frame Titles).

Function: user-real-uid

This function returns the real UID of the user.

(user-real-uid)
     ⇒ 19
Function: user-uid

This function returns the effective UID of the user.

Function: user-home-directory

This function returns the “HOME” directory of the user, and is intended to replace occurrences of “(getenv "HOME")”. Under Unix systems, the following is done:

  1. Return the value of “(getenv "HOME")”, if set.
  2. Return “/”, as a fallback, but issue a warning. Future versions of SXEmacs will also attempt to lookup the HOME directory via getpwent(), but this has not yet been implemented.

Next: , Previous: , Up: System Interface   [Contents][Index]