* doc/lispref/lists.texi (Sets And Lists): Mention cl provides union etc.
[bpt/emacs.git] / doc / lispref / os.texi
index e98bcab..b226d67 100644 (file)
@@ -1,10 +1,10 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001,
-@c   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+@c Copyright (C) 1990-1995, 1998-1999, 2001-2011
+@c   Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../../info/os
-@node System Interface, Antinews, Display, Top
+@node System Interface, Packaging, Display, Top
 @chapter Operating System Interface
 
   This chapter is about starting and getting out of Emacs, access to
@@ -20,14 +20,14 @@ terminal and the screen.
 * Getting Out::         How exiting works (permanent or temporary).
 * System Environment::  Distinguish the name and kind of system.
 * User Identification:: Finding the name and user id of the user.
-* Time of Day::                Getting the current time.
-* Time Conversion::     Converting a time from numeric form to 
+* Time of Day::         Getting the current time.
+* Time Conversion::     Converting a time from numeric form to
                           calendrical data and vice versa.
 * Time Parsing::        Converting a time from numeric form to text
                           and vice versa.
 * Processor Run Time::  Getting the run time used by Emacs.
 * Time Calculations::   Adding, subtracting, comparing times, etc.
-* Timers::             Setting a timer to call a function at a certain time.
+* Timers::              Setting a timer to call a function at a certain time.
 * Idle Timers::         Setting a timer to call a function when Emacs has
                           been idle for a certain length of time.
 * Terminal Input::      Accessing and recording terminal input.
@@ -36,6 +36,7 @@ terminal and the screen.
 * X11 Keysyms::         Operating on key symbols for X Windows.
 * Batch Mode::          Running Emacs without terminal interaction.
 * Session Management::  Saving and restoring state with X Session Management.
+* Dynamic Libraries::   On-demand loading of support libraries.
 @end menu
 
 @node Starting Up
@@ -201,6 +202,8 @@ Do not set this variable in the init file of a new user, or in a way
 that affects more than one user, as that would prevent new users from
 receiving information about copyleft and basic Emacs usage.
 
+@vindex inhibit-startup-message
+@vindex inhibit-splash-screen
 @code{inhibit-startup-message} and @code{inhibit-splash-screen} are
 aliases for this variable.
 @end defopt
@@ -489,6 +492,7 @@ to Emacs.
 @end defvar
 
 @defvar command-line-args-left
+@vindex argv
 The value of this variable is the list of command-line arguments that
 have not yet been processed.  @code{argv} is an alias for this.
 @end defvar
@@ -573,7 +577,6 @@ does not run the remaining functions in this hook.  Calling
 This variable is a normal hook; once @code{save-buffers-kill-emacs} is
 finished with all file saving and confirmation, it calls
 @code{kill-emacs} which runs the functions in this hook.
-@code{kill-emacs} does not run this hook in batch mode.
 
 @code{kill-emacs} may be invoked directly (that is not via
 @code{save-buffers-kill-emacs}) if the terminal is disconnected, or in
@@ -697,6 +700,7 @@ the terminal for the selected frame).  @xref{Multiple Terminals}.
 
 If @var{tty} is already suspended, this function does nothing.
 
+@vindex suspend-tty-functions
 This function runs the hook @code{suspend-tty-functions}, passing the
 terminal object as an argument to each function.
 @end defun
@@ -707,6 +711,7 @@ This function resumes the previously suspended terminal device
 terminal for that frame), or @code{nil} (meaning the terminal for the
 selected frame).
 
+@vindex resume-tty-functions
 This function reopens the terminal device, re-initializes it, and
 redraws its with that terminal's selected frame.  It then runs the
 hook @code{resume-tty-functions}, passing the terminal object as an
@@ -781,9 +786,6 @@ Hewlett-Packard HPUX operating system.
 @item irix
 Silicon Graphics Irix system.
 
-@item lynxos 3.0.1
-LynxOS-3.0.1.
-
 @item ms-dos
 Microsoft MS-DOS ``operating system.''  Emacs compiled with DJGPP for
 MS-DOS binds @code{system-type} to @code{ms-dos} even when you run it on
@@ -1104,13 +1106,13 @@ used for each part is always the same, so you can reliably use
 characters from the beginning of the string rather than from the end, as
 additional information may some day be added at the end.
 
-@c Emacs 19 feature
 The argument @var{time-value}, if given, specifies a time to format
-instead of the current time.  The argument should be a list whose first
-two elements are integers.  Thus, you can use times obtained from
-@code{current-time} (see below) and from @code{file-attributes}
-(@pxref{Definition of file-attributes}).  @var{time-value} can also be
-a cons of two integers, but this is considered obsolete.
+instead of the current time.  This argument should have the same form
+as the times obtained from @code{current-time} (see below) and from
+@code{file-attributes} (@pxref{Definition of file-attributes}).  It
+should be a list whose first two elements are integers; a third
+(microsecond) element, if present, is ignored.  @var{time-value} can
+also be a cons of two integers, but this usage is obsolete.
 
 @example
 @group
@@ -1120,7 +1122,6 @@ a cons of two integers, but this is considered obsolete.
 @end example
 @end defun
 
-@c Emacs 19 feature
 @defun current-time
 This function returns the system's time value as a list of three
 integers: @code{(@var{high} @var{low} @var{microsec})}.  The integers
@@ -1142,7 +1143,6 @@ get with the function @code{file-attributes}.
 @xref{Definition of file-attributes}.
 @end defun
 
-@c Emacs 19 feature
 @defun current-time-zone &optional time-value
 This function returns a list describing the time zone that the user is
 in.
@@ -1179,7 +1179,7 @@ seconds since the epoch.  The argument @var{time-value}, if given,
 specifies a time to convert instead of the current time.  The argument
 should have the same form as for @code{current-time-string} (see
 above).  Thus, it accepts the output of @code{current-time} and
-@code{file-attributes}.
+@code{file-attributes} (@pxref{Definition of file-attributes}).
 
 @emph{Warning}: Since the result is floating point, it may not be
 exact.  Do not use this function if precise time stamps are required.
@@ -1336,6 +1336,12 @@ This stands for the month (01-12).
 This stands for the minute (00-59).
 @item %n
 This stands for a newline.
+@item %N
+This stands for the nanoseconds (000000000-999999999).  To ask for
+fewer digits, use @samp{%3N} for milliseconds, @samp{%6N} for
+microseconds, etc.  Any excess digits are discarded, without rounding.
+Currently Emacs time stamps are at best microsecond resolution so the
+last three digits generated by plain @samp{%N} are always zero.
 @item %p
 This stands for @samp{AM} or @samp{PM}, as appropriate.
 @item %r
@@ -1815,8 +1821,8 @@ manipulating terminal input.  See @ref{Display}, for related
 functions.
 
 @menu
-* Input Modes::                Options for how input is processed.
-* Recording Input::    Saving histories of recent or all input events.
+* Input Modes::         Options for how input is processed.
+* Recording Input::     Saving histories of recent or all input events.
 @end menu
 
 @node Input Modes
@@ -2179,13 +2185,60 @@ Emacs is restarted by the session manager.
 
 @group
 (defun save-yourself-test ()
-  (insert "(save-excursion
+  (insert "(save-current-buffer
   (switch-to-buffer \"*scratch*\")
   (insert \"I am restored\"))")
   nil)
 @end group
 @end example
 
-@ignore
-   arch-tag: 8378814a-30d7-467c-9615-74a80b9988a7
-@end ignore
+@node Dynamic Libraries
+@section Dynamically Loaded Libraries
+@cindex dynamic libraries
+
+  A @dfn{dynamically loaded library} is a library that is loaded on
+demand, when its facilities are first needed.  Emacs supports such
+on-demand loading of support libraries for some of its features.
+
+@defvar dynamic-library-alist
+This is an alist of dynamic libraries and external library files
+implementing them.
+
+Each element is a list of the form
+@w{@code{(@var{library} @var{files}@dots{})}}, where the @code{car} is
+a symbol representing a supported external library, and the rest are
+strings giving alternate filenames for that library.
+
+Emacs tries to load the library from the files in the order they
+appear in the list; if none is found, the running session of Emacs
+won't have access to that library, and the features that depend on the
+library will be unavailable.
+
+Image support on some platforms uses this facility.  Here's an example
+of setting this variable for supporting images on MS-Windows:
+
+@lisp
+(setq dynamic-library-alist
+      '((xpm "libxpm.dll" "xpm4.dll" "libXpm-nox4.dll")
+        (png "libpng12d.dll" "libpng12.dll" "libpng.dll"
+        "libpng13d.dll" "libpng13.dll")
+        (jpeg "jpeg62.dll" "libjpeg.dll" "jpeg-62.dll" "jpeg.dll")
+        (tiff "libtiff3.dll" "libtiff.dll")
+        (gif "giflib4.dll" "libungif4.dll" "libungif.dll")
+        (svg "librsvg-2-2.dll")
+        (gdk-pixbuf "libgdk_pixbuf-2.0-0.dll")
+        (glib "libglib-2.0-0.dll")
+       (gobject "libgobject-2.0-0.dll")))
+@end lisp
+
+Note that image types @code{pbm} and @code{xbm} do not need entries in
+this variable because they do not depend on external libraries and are
+always available in Emacs.
+
+Also note that this variable is not meant to be a generic facility for
+accessing external libraries; only those already known by Emacs can
+be loaded through it.
+
+This variable is ignored if the given @var{library} is statically
+linked into Emacs.
+@end defvar