Commit fa022909 authored by Glenn Morris's avatar Glenn Morris
Browse files

Doc tweaks for cond

* doc/lispref/control.texi (Conditionals): Copyedits.

* src/eval.c (Fcond): Doc tweak.
parent 574411d0
2013-10-09 Glenn Morris <rgm@gnu.org>
* control.texi (Conditionals): Copyedits. (Bug#15558)
2013-10-08 Eli Zaretskii <eliz@gnu.org>
Support menus on text-mode terminals.
......
......@@ -218,15 +218,11 @@ list is the @var{condition}; the remaining elements, if any, the
@code{cond} tries the clauses in textual order, by evaluating the
@var{condition} of each clause. If the value of @var{condition} is
non-@code{nil}, the clause ``succeeds''; then @code{cond} evaluates its
@var{body-forms}, and the value of the last of @var{body-forms} becomes
the value of the @code{cond}. The remaining clauses are ignored.
@var{body-forms}, and returns the value of the last of @var{body-forms}.
Any remaining clauses are ignored.
If the value of @var{condition} is @code{nil}, the clause ``fails'', so
the @code{cond} moves on to the following clause, trying its
@var{condition}.
If every @var{condition} evaluates to @code{nil}, so that every clause
fails, @code{cond} returns @code{nil}.
the @code{cond} moves on to the following clause, trying its @var{condition}.
A clause may also look like this:
......@@ -235,8 +231,11 @@ A clause may also look like this:
@end example
@noindent
Then, if @var{condition} is non-@code{nil} when tested, the value of
@var{condition} becomes the value of the @code{cond} form.
Then, if @var{condition} is non-@code{nil} when tested, the @code{cond}
form returns the value of @var{condition}.
If every @var{condition} evaluates to @code{nil}, so that every clause
fails, @code{cond} returns @code{nil}.
The following example has four clauses, which test for the cases where
the value of @code{x} is a number, string, buffer and symbol,
......
2013-10-09 Glenn Morris <rgm@gnu.org>
* eval.c (Fcond): Doc tweak.
2013-10-09 Eli Zaretskii <eliz@gnu.org>
* xfaces.c (x_free_gc) [HAVE_X_WINDOWS, HAVE_NTGUI]: Don't pass
......
/* Evaluator for GNU Emacs Lisp interpreter.
Copyright (C) 1985-1987, 1993-1995, 1999-2013 Free Software
Foundation, Inc.
Copyright (C) 1985-1987, 1993-1995, 1999-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
......@@ -405,9 +405,9 @@ Each clause looks like (CONDITION BODY...). CONDITION is evaluated
and, if the value is non-nil, this clause succeeds:
then the expressions in BODY are evaluated and the last one's
value is the value of the cond-form.
If a clause has one element, as in (CONDITION), then the cond-form
returns CONDITION's value, if that is non-nil.
If no clause succeeds, cond returns nil.
If a clause has one element, as in (CONDITION),
CONDITION's value if non-nil is returned from the cond-form.
usage: (cond CLAUSES...) */)
(Lisp_Object args)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment