aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2013-10-09 13:17:20 -0400
committerGlenn Morris2013-10-09 13:17:20 -0400
commitfa02290953acd2d0cda982d98ffd32e9f6873d28 (patch)
tree2a141d56f3222dceb56771b7cb5d606f9809362c
parent574411d08a399826fb02d7c2d71280d567e5d181 (diff)
downloademacs-fa02290953acd2d0cda982d98ffd32e9f6873d28.tar.gz
emacs-fa02290953acd2d0cda982d98ffd32e9f6873d28.zip
Doc tweaks for cond
* doc/lispref/control.texi (Conditionals): Copyedits. * src/eval.c (Fcond): Doc tweak.
-rw-r--r--doc/lispref/ChangeLog4
-rw-r--r--doc/lispref/control.texi17
-rw-r--r--src/ChangeLog4
-rw-r--r--src/eval.c8
4 files changed, 20 insertions, 13 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 4f6a92ef5f3..8b55cfddec2 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,7 @@
12013-10-09 Glenn Morris <rgm@gnu.org>
2
3 * control.texi (Conditionals): Copyedits. (Bug#15558)
4
12013-10-08 Eli Zaretskii <eliz@gnu.org> 52013-10-08 Eli Zaretskii <eliz@gnu.org>
2 6
3 Support menus on text-mode terminals. 7 Support menus on text-mode terminals.
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index 70eabcd84a4..34a02aab69d 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -218,15 +218,11 @@ list is the @var{condition}; the remaining elements, if any, the
218@code{cond} tries the clauses in textual order, by evaluating the 218@code{cond} tries the clauses in textual order, by evaluating the
219@var{condition} of each clause. If the value of @var{condition} is 219@var{condition} of each clause. If the value of @var{condition} is
220non-@code{nil}, the clause ``succeeds''; then @code{cond} evaluates its 220non-@code{nil}, the clause ``succeeds''; then @code{cond} evaluates its
221@var{body-forms}, and the value of the last of @var{body-forms} becomes 221@var{body-forms}, and returns the value of the last of @var{body-forms}.
222the value of the @code{cond}. The remaining clauses are ignored. 222Any remaining clauses are ignored.
223 223
224If the value of @var{condition} is @code{nil}, the clause ``fails'', so 224If the value of @var{condition} is @code{nil}, the clause ``fails'', so
225the @code{cond} moves on to the following clause, trying its 225the @code{cond} moves on to the following clause, trying its @var{condition}.
226@var{condition}.
227
228If every @var{condition} evaluates to @code{nil}, so that every clause
229fails, @code{cond} returns @code{nil}.
230 226
231A clause may also look like this: 227A clause may also look like this:
232 228
@@ -235,8 +231,11 @@ A clause may also look like this:
235@end example 231@end example
236 232
237@noindent 233@noindent
238Then, if @var{condition} is non-@code{nil} when tested, the value of 234Then, if @var{condition} is non-@code{nil} when tested, the @code{cond}
239@var{condition} becomes the value of the @code{cond} form. 235form returns the value of @var{condition}.
236
237If every @var{condition} evaluates to @code{nil}, so that every clause
238fails, @code{cond} returns @code{nil}.
240 239
241The following example has four clauses, which test for the cases where 240The following example has four clauses, which test for the cases where
242the value of @code{x} is a number, string, buffer and symbol, 241the value of @code{x} is a number, string, buffer and symbol,
diff --git a/src/ChangeLog b/src/ChangeLog
index eee3ee8237e..3ae42ea87c8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12013-10-09 Glenn Morris <rgm@gnu.org>
2
3 * eval.c (Fcond): Doc tweak.
4
12013-10-09 Eli Zaretskii <eliz@gnu.org> 52013-10-09 Eli Zaretskii <eliz@gnu.org>
2 6
3 * xfaces.c (x_free_gc) [HAVE_X_WINDOWS, HAVE_NTGUI]: Don't pass 7 * xfaces.c (x_free_gc) [HAVE_X_WINDOWS, HAVE_NTGUI]: Don't pass
diff --git a/src/eval.c b/src/eval.c
index 3b4dc9a88d1..1e0a63a0ece 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1,6 +1,6 @@
1/* Evaluator for GNU Emacs Lisp interpreter. 1/* Evaluator for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985-1987, 1993-1995, 1999-2013 Free Software 2
3 Foundation, Inc. 3Copyright (C) 1985-1987, 1993-1995, 1999-2013 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -405,9 +405,9 @@ Each clause looks like (CONDITION BODY...). CONDITION is evaluated
405and, if the value is non-nil, this clause succeeds: 405and, if the value is non-nil, this clause succeeds:
406then the expressions in BODY are evaluated and the last one's 406then the expressions in BODY are evaluated and the last one's
407value is the value of the cond-form. 407value is the value of the cond-form.
408If a clause has one element, as in (CONDITION), then the cond-form
409returns CONDITION's value, if that is non-nil.
408If no clause succeeds, cond returns nil. 410If no clause succeeds, cond returns nil.
409If a clause has one element, as in (CONDITION),
410CONDITION's value if non-nil is returned from the cond-form.
411usage: (cond CLAUSES...) */) 411usage: (cond CLAUSES...) */)
412 (Lisp_Object args) 412 (Lisp_Object args)
413{ 413{