*** empty log message ***
[bpt/emacs.git] / lispref / symbols.texi
index 6542d4b..7234a75 100644 (file)
@@ -1,7 +1,7 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999
-@c   Free Software Foundation, Inc.
+@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001,
+@c   2002, 2003, 2004, 2005, 2006, 2007  Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../info/symbols
 @node Symbols, Evaluation, Hash Tables, Top
@@ -115,10 +115,10 @@ the four cells of the symbol @code{buffer-file-name}:
      @result{} "buffer-file-name"
 (symbol-value 'buffer-file-name)
      @result{} "/gnu/elisp/symbols.texi"
-(symbol-plist 'buffer-file-name)
-     @result{} (variable-documentation 29529)
 (symbol-function 'buffer-file-name)
      @result{} #<subr buffer-file-name>
+(symbol-plist 'buffer-file-name)
+     @result{} (variable-documentation 29529)
 @end example
 
 @noindent
@@ -139,7 +139,7 @@ symbol naming a function written in Lisp would have a lambda expression
 
 @node Definitions, Creating Symbols, Symbol Components, Symbols
 @section Defining Symbols
-@cindex definition of a symbol
+@cindex definitions of symbols
 
   A @dfn{definition} in Lisp is a special form that announces your
 intention to use a certain symbol in a particular way.  In Emacs Lisp,
@@ -160,7 +160,7 @@ be customized, use @code{defcustom} (@pxref{Customization}).
   @code{defun} defines a symbol as a function, creating a lambda
 expression and storing it in the function cell of the symbol.  This
 lambda expression thus becomes the function definition of the symbol.
-(The term ``function definition'', meaning the contents of the function
+(The term ``function definition,'' meaning the contents of the function
 cell, is derived from the idea that @code{defun} gives the symbol its
 definition as a function.)  @code{defsubst} and @code{defalias} are two
 other ways of defining a function.  @xref{Functions}.
@@ -361,6 +361,7 @@ This variable is the standard obarray for use by @code{intern} and
 @end defvar
 
 @defun mapatoms function &optional obarray
+@anchor{Definition of mapatoms}
 This function calls @var{function} once with each symbol in the obarray
 @var{obarray}.  Then it returns @code{nil}.  If @var{obarray} is
 omitted, it defaults to the value of @code{obarray}, the standard
@@ -435,6 +436,8 @@ names, and the other two elements are the corresponding values.
 
 @node Plists and Alists
 @subsection Property Lists and Association Lists
+@cindex plist vs. alist
+@cindex alist vs. plist
 
 @cindex property lists vs association lists
   Association lists (@pxref{Association Lists}) are very similar to
@@ -475,7 +478,7 @@ This function returns the property list of @var{symbol}.
 @defun setplist symbol plist
 This function sets @var{symbol}'s property list to @var{plist}.
 Normally, @var{plist} should be a well-formed property list, but this is
-not enforced.
+not enforced.  The return value is @var{plist}.
 
 @smallexample
 (setplist 'foo '(a 1 b (2 3) c nil))
@@ -532,6 +535,18 @@ stored in the property list @var{plist}.  For example,
 @example
 (plist-get '(foo 4) 'foo)
      @result{} 4
+(plist-get '(foo 4 bad) 'foo)
+     @result{} 4
+(plist-get '(foo 4 bad) 'bar)
+     @result{} @code{wrong-type-argument} error
+@end example
+
+It accepts a malformed @var{plist} argument and always returns @code{nil}
+if @var{property} is not found in the @var{plist}.  For example,
+
+@example
+(plist-get '(foo 4 bad) 'bar)
+     @result{} nil
 @end example
 @end defun
 
@@ -571,7 +586,6 @@ using @code{equal} instead of @code{eq}.
 @end defun
 
 @defun plist-member plist property
-@tindex plist-member
 This returns non-@code{nil} if @var{plist} contains the given
 @var{property}.  Unlike @code{plist-get}, this allows you to distinguish
 between a missing property and a property with the value @code{nil}.