Merge from emacs-24; up to 2012-05-02T07:12:52Z!rgm@gnu.org.
[bpt/emacs.git] / doc / lispref / functions.texi
index 2ba277d..9e1d3f9 100644 (file)
@@ -530,8 +530,7 @@ defines the symbol @var{name} as a function that looks like this:
 @end example
 
 @code{defun} stores this lambda expression in the function cell of
-@var{name}.  It returns the value @var{name}, but usually we ignore this
-value.
+@var{name}.  Its return value is @emph{undefined}.
 
 As described previously, @var{argument-list} is a list of argument
 names and may include the keywords @code{&optional} and @code{&rest}.
@@ -543,9 +542,6 @@ Here are some examples:
 @example
 @group
 (defun foo () 5)
-     @result{} foo
-@end group
-@group
 (foo)
      @result{} 5
 @end group
@@ -553,9 +549,6 @@ Here are some examples:
 @group
 (defun bar (a &optional b &rest c)
     (list a b c))
-     @result{} bar
-@end group
-@group
 (bar 1 2 3 4 5)
      @result{} (1 2 (3 4 5))
 @end group
@@ -576,7 +569,6 @@ Here are some examples:
   (forward-word 1)
   (backward-char 1)
   (capitalize-word 1))
-     @result{} capitalize-backwards
 @end group
 @end example
 
@@ -593,7 +585,7 @@ redefinition from unintentional redefinition.
 @anchor{Definition of defalias}
 This special form defines the symbol @var{name} as a function, with
 definition @var{definition} (which can be any valid Lisp function).
-It returns @var{definition}.
+Its return value is @emph{undefined}.
 
 If @var{docstring} is non-@code{nil}, it becomes the function
 documentation of @var{name}.  Otherwise, any documentation provided by
@@ -1015,9 +1007,6 @@ function.
 @example
 @group
 (defun bar (n) (+ n 2))
-     @result{} bar
-@end group
-@group
 (symbol-function 'bar)
      @result{} (lambda (n) (+ n 2))
 @end group
@@ -1063,9 +1052,6 @@ subsequent attempt to access this cell will cause a
 @example
 @group
 (defun foo (x) x)
-     @result{} foo
-@end group
-@group
 (foo 1)
      @result{}1
 @end group
@@ -1114,8 +1100,9 @@ named function that you create (e.g.@: with @code{defun}), as well as
 any anonymous function that you create using the @code{lambda} macro
 or the @code{function} special form or the @code{#'} syntax
 (@pxref{Anonymous Functions}), is automatically converted into a
-closure.
+@dfn{closure}.
 
+@cindex closure
   A closure is a function that also carries a record of the lexical
 environment that existed when the function was defined.  When it is
 invoked, any lexical variable references within its definition use the
@@ -1263,8 +1250,8 @@ example, byte-compiling @file{fortran.el} used to warn:
 
 @example
 In end of data:
-fortran.el:2152:1:Warning: the function `gud-find-c-expr' is not known
-    to be defined.
+fortran.el:2152:1:Warning: the function `gud-find-c-expr' is not
+    known to be defined.
 @end example
 
 In fact, @code{gud-find-c-expr} is only used in the function that