Synchronize @dircategory directives in doc/misc with info/dir.
[bpt/emacs.git] / doc / misc / calc.texi
index 2441f0c..0a595d9 100644 (file)
@@ -3,7 +3,7 @@
 @c smallbook
 @setfilename ../../info/calc
 @c [title]
-@settitle GNU Emacs Calc 2.1 Manual
+@settitle GNU Emacs Calc Manual
 @setchapternewpage odd
 @comment %**end of header (This is for running Texinfo on a region.)
 
@@ -23,6 +23,7 @@
 @alias expr=math
 @alias tfn=code
 @alias mathit=expr
+@alias summarykey=key
 @macro cpi{}
 @math{@pi{}}
 @end macro
@@ -39,6 +40,9 @@
 @alias expr=samp
 @alias tfn=t
 @alias mathit=i
+@macro summarykey{ky}
+\ky\
+@end macro
 @macro cpi{}
 @expr{pi}
 @end macro
 @end iftex
 
 @copying
+@ifinfo
 This file documents Calc, the GNU Emacs calculator.
+@end ifinfo
+@ifnotinfo
+This file documents Calc, the GNU Emacs calculator, included with GNU Emacs 23.3.
+@end ifnotinfo
 
 Copyright @copyright{} 1990, 1991, 2001, 2002, 2003, 2004,
-2005, 2006, 2007 Free Software Foundation, Inc.
+2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2 or
+under the terms of the GNU Free Documentation License, Version 1.3 or
 any later version published by the Free Software Foundation; with the
 Invariant Sections being just ``GNU GENERAL PUBLIC LICENSE'', with the
 Front-Cover texts being ``A GNU Manual,'' and with the Back-Cover
 Texts as in (a) below.  A copy of the license is included in the section
 entitled ``GNU Free Documentation License.''
 
-(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
-this GNU Manual, like GNU software.  Copies published by the Free
-Software Foundation raise funds for GNU development.''
+(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
+modify this GNU manual.  Buying copies from the FSF supports it in
+developing GNU and promoting software freedom.''
 @end quotation
 @end copying
 
-@dircategory Emacs
+@dircategory Emacs misc features
 @direntry
-* Calc: (calc).         Advanced desk calculator and mathematical tool.
+* Calc: (calc).                 Advanced desk calculator and mathematical tool.
 @end direntry
 
 @titlepage
 @sp 6
 @center @titlefont{Calc Manual}
 @sp 4
-@center GNU Emacs Calc Version 2.1
+@center GNU Emacs Calc
 @c [volume]
 @sp 5
 @center Dave Gillespie
@@ -118,8 +127,6 @@ Software Foundation raise funds for GNU development.''
 @page
 
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1990, 1991, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007 Free Software Foundation, Inc.
 @insertcopying
 @end titlepage
 
@@ -152,6 +159,8 @@ file), type @kbd{?}.  (You can also type @kbd{h} to run through a
 longer Info tutorial.)
 @end ifinfo
 
+@insertcopying
+
 @menu
 * Getting Started::       General description and overview.
 @ifinfo
@@ -277,15 +286,15 @@ but Calc has the advantages of convenience, portability, and freedom.
 
 @noindent
 This document serves as a complete description of the GNU Emacs
-Calculator.  It works both as an introduction for novices, and as
+Calculator.  It works both as an introduction for novices and as
 a reference for experienced users.  While it helps to have some
 experience with GNU Emacs in order to get the most out of Calc,
 this manual ought to be readable even if you don't know or use Emacs
 regularly.
 
-The manual is divided into three major parts:@: the ``Getting
-Started'' chapter you are reading now, the Calc tutorial (chapter 2),
-and the Calc reference manual (the remaining chapters and appendices).
+This manual is divided into three major parts:@: the ``Getting
+Started'' chapter you are reading now, the Calc tutorial, and the Calc
+reference manual.
 @c [when-split]
 @c This manual has been printed in two volumes, the @dfn{Tutorial} and the
 @c @dfn{Reference}.  Both volumes include a copy of the ``Getting Started''
@@ -311,24 +320,25 @@ of Calc.  Or, you can look in the table of contents or the Concept
 Index to find the parts of the manual that discuss the things you
 need to know.
 
-@cindex Marginal notes
+@c @cindex Marginal notes
 Every Calc keyboard command is listed in the Calc Summary, and also
 in the Key Index.  Algebraic functions, @kbd{M-x} commands, and
 variables also have their own indices.  
-@texline Each
-@infoline In the printed manual, each
-paragraph that is referenced in the Key or Function Index is marked
-in the margin with its index entry.
+@c @texline Each
+@c @infoline In the printed manual, each
+@c paragraph that is referenced in the Key or Function Index is marked
+@c in the margin with its index entry.
 
 @c [fix-ref Help Commands]
-You can access this manual on-line at any time within Calc by
-pressing the @kbd{h i} key sequence.  Outside of the Calc window,
-you can press @kbd{C-x * i} to read the manual on-line.  Also, you
-can jump directly to the Tutorial by pressing @kbd{h t} or @kbd{C-x * t},
-or to the Summary by pressing @kbd{h s} or @kbd{C-x * s}.  Within Calc,
-you can also go to the part of the manual describing any Calc key,
-function, or variable using @w{@kbd{h k}}, @kbd{h f}, or @kbd{h v},
-respectively.  @xref{Help Commands}.
+You can access this manual on-line at any time within Calc by pressing
+the @kbd{h i} key sequence.  Outside of the Calc window, you can press
+@kbd{C-x * i} to read the manual on-line.  From within Calc the command
+@kbd{h t} will jump directly to the Tutorial; from outside of Calc the
+command @kbd{C-x * t} will jump to the Tutorial and start Calc if
+necessary.  Pressing @kbd{h s} or @kbd{C-x * s} will take you directly
+to the Calc Summary.  Within Calc, you can also go to the part of the
+manual describing any Calc key, function, or variable using 
+@w{@kbd{h k}}, @kbd{h f}, or @kbd{h v}, respectively.  @xref{Help Commands}.
 
 @ifnottex
 The Calc manual can be printed, but because the manual is so large, you
@@ -539,7 +549,7 @@ many weeks have passed since then.
 or equations involving variables.  Type @kbd{@w{' [x + y} = a, x y = 1] @key{RET}}
 to enter a pair of equations involving three variables.
 (Note the leading apostrophe in this example; also, note that the space
-between @samp{x y} is required.)  Type @w{@kbd{a S x,y @key{RET}}} to solve
+in @samp{x y} is required.)  Type @w{@kbd{a S x,y @key{RET}}} to solve
 these equations for the variables @expr{x} and @expr{y}.
 
 @noindent
@@ -551,7 +561,7 @@ system.  Type @kbd{d N} to return to normal notation.
 
 @noindent
 Type @kbd{7.5}, then @kbd{s l a @key{RET}} to let @expr{a = 7.5} in these formulas.
-(That's a letter @kbd{l}, not a numeral @kbd{1}.)
+(That's the letter @kbd{l}, not the numeral @kbd{1}.)
 
 @ifnotinfo
 @strong{Help functions.}  You can read about any command in the on-line
@@ -643,7 +653,7 @@ with the file you were editing on top and Calc on the bottom.
                                                 |  * 8
                                                 |  ->-5
                                                 |
---%%-Calc: 12 Deg       (Calculator)----All----- --%%-Emacs: *Calc Trail*
+--%*-Calc: 12 Deg       (Calculator)----All----- --%*- *Calc Trail*
 @end group
 @end smallexample
 
@@ -708,9 +718,11 @@ normal partial-screen mode.
 
 Finally, @kbd{C-x * o} (@code{calc-other-window}) is like @kbd{C-x * c}
 except that the Calc window is not selected.  The buffer you were
-editing before remains selected instead.  @kbd{C-x * o} is a handy
-way to switch out of Calc momentarily to edit your file; type
-@kbd{C-x * c} to switch back into Calc when you are done.
+editing before remains selected instead.  If you are in a Calc window,
+then @kbd{C-x * o} will switch you out of it, being careful not to
+switch you to the Calc Trail window.  So @kbd{C-x * o} is a handy
+way to switch out of Calc momentarily to edit your file; you can then
+type @kbd{C-x * c} to switch back into Calc when you are done.
 
 @node Quick Mode Overview, Keypad Mode Overview, The Standard Interface, Using Calc
 @subsection Quick Mode (Overview)
@@ -761,8 +773,8 @@ Stack; the lower window is a picture of a typical calculator keypad.
 |2:  17.3
 |1:  -5
 |    .
-|--%%-Calc: 12 Deg       (Calcul
-|----+-----Calc 2.1------+----1
+|--%*-Calc: 12 Deg       (Calcul
+|----+----+--Calc---+----+----1
 |FLR |CEIL|RND |TRNC|CLN2|FLT |
 |----+----+----+----+----+----|
 | LN |EXP |    |ABS |IDIV|MOD |
@@ -862,7 +874,8 @@ is
 and you wish to have Calc compute and format the derivative for
 you and store this derivative in the buffer automatically.  To
 do this with Embedded mode, first copy the formula down to where
-you want the result to be:
+you want the result to be, leaving a blank line before and after the
+formula:
 
 @smallexample
 @group
@@ -877,15 +890,16 @@ is
 @end smallexample
 
 Now, move the cursor onto this new formula and press @kbd{C-x * e}.
-Calc will read the formula (using the surrounding blank lines to
-tell how much text to read), then push this formula (invisibly)
-onto the Calc stack.  The cursor will stay on the formula in the
-editing buffer, but the buffer's mode line will change to look
-like the Calc mode line (with mode indicators like @samp{12 Deg}
-and so on).  Even though you are still in your editing buffer,
-the keyboard now acts like the Calc keyboard, and any new result
-you get is copied from the stack back into the buffer.  To take
-the derivative, you would type @kbd{a d x @key{RET}}.
+Calc will read the formula (using the surrounding blank lines to tell
+how much text to read), then push this formula (invisibly) onto the Calc
+stack.  The cursor will stay on the formula in the editing buffer, but
+the line with the formula will now appear as it would on the Calc stack
+(in this case, it will be left-aligned) and the buffer's mode line will
+change to look like the Calc mode line (with mode indicators like
+@samp{12 Deg} and so on).  Even though you are still in your editing
+buffer, the keyboard now acts like the Calc keyboard, and any new result
+you get is copied from the stack back into the buffer.  To take the
+derivative, you would type @kbd{a d x @key{RET}}.
 
 @smallexample
 @group
@@ -899,6 +913,9 @@ is
 @end group
 @end smallexample
 
+(Note that by default, Calc gives division lower precedence than multiplication,
+so that @samp{1 / ln(x) x} is equivalent to @samp{1 / (ln(x) x)}.)
+
 To make this look nicer, you might want to press @kbd{d =} to center
 the formula, and even @kbd{d B} to use Big display mode.
 
@@ -944,9 +961,9 @@ To leave Embedded mode, type @kbd{C-x * e} again.  The mode line
 and keyboard will revert to the way they were before.
 
 The related command @kbd{C-x * w} operates on a single word, which
-generally means a single number, inside text.  It uses any
-non-numeric characters rather than blank lines to delimit the
-formula it reads.  Here's an example of its use:
+generally means a single number, inside text.  It searches for an
+expression which ``looks'' like a number containing the point.
+Here's an example of its use:
 
 @smallexample
 A slope of one-third corresponds to an angle of 1 degrees.
@@ -1257,7 +1274,7 @@ you have followed a cross-reference, you can press the letter
 
 You can press @kbd{?} at any time for a brief summary of Info commands.
 
-Press @kbd{1} now to enter the first section of the Tutorial.
+Press the number @kbd{1} now to enter the first section of the Tutorial.
 
 @menu
 * Tutorial::
@@ -1287,10 +1304,13 @@ self-explanatory.  @xref{Embedded Mode}, for a description of
 the Embedded mode interface.
 
 The easiest way to read this tutorial on-line is to have two windows on
-your Emacs screen, one with Calc and one with the Info system.  (If you
-have a printed copy of the manual you can use that instead.)  Press
-@kbd{C-x * c} to turn Calc on or to switch into the Calc window, and
-press @kbd{C-x * i} to start the Info system or to switch into its window.
+your Emacs screen, one with Calc and one with the Info system.  Press
+@kbd{C-x * t} to set this up; the on-line tutorial will be opened in the
+current window and Calc will be started in another window.  From the
+Info window, the command @kbd{C-x * c} can be used to switch to the Calc
+window and @kbd{C-x * o} can be used to switch back to the Info window.
+(If you have a printed copy of the manual you can use that instead; in
+that case you only need to press @kbd{C-x * c} to start Calc.)
 
 This tutorial is designed to be done in sequence.  But the rest of this
 manual does not assume you have gone through the tutorial.  The tutorial
@@ -1738,9 +1758,9 @@ Calculator in Algebraic mode, which is closer to the way
 non-RPN calculators work.  In Algebraic mode, you enter formulas
 in traditional @expr{2+3} notation.
 
-@strong{Warning:} Note that @samp{/} has lower precedence than
-@samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.  See
-below for details.
+@strong{Notice:} Calc gives @samp{/} lower precedence than @samp{*}, so
+that @samp{a/b*c} is interpreted as @samp{a/(b*c)}; this is not
+standard across all computer languages.  See below for details.
 
 You don't really need any special ``mode'' to enter algebraic formulas.
 You can enter a formula at any time by pressing the apostrophe (@kbd{'})
@@ -2180,7 +2200,7 @@ Perhaps the most fundamental mode in Calc is the current @dfn{precision}.
 Notice the @samp{12} on the Calc window's mode line:
 
 @smallexample
---%%-Calc: 12 Deg       (Calculator)----All------
+--%*-Calc: 12 Deg       (Calculator)----All------
 @end smallexample
 
 @noindent
@@ -3002,10 +3022,9 @@ coefficient 30-choose-20, then determine its prime factorization.
 @end smallexample
 
 @noindent
-You can verify these prime factors by using @kbd{v u} to ``unpack''
-this vector into 8 separate stack entries, then @kbd{M-8 *} to
-multiply them back together.  The result is the original number,
-30045015.
+You can verify these prime factors by using @kbd{V R *} to multiply
+together the elements of this vector.  The result is the original
+number, 30045015.
 
 @cindex Hash tables
 Suppose a program you are writing needs a hash table with at least
@@ -5268,25 +5287,25 @@ Suppose we want to simplify this trigonometric formula:
 
 @smallexample
 @group
-1:  1 / cos(x) - sin(x) tan(x)
+1:  2 / cos(x)^2 - 2 tan(x)^2
     .
 
-    ' 1/cos(x) - sin(x) tan(x) @key{RET}   s 1
+    ' 2/cos(x)^2 - 2tan(x)^2 @key{RET}   s 1
 @end group
 @end smallexample
 
 @noindent
 If we were simplifying this by hand, we'd probably replace the
 @samp{tan} with a @samp{sin/cos} first, then combine over a common
-denominator.  There is no Calc command to do the former; the @kbd{a n}
-algebra command will do the latter but we'll do both with rewrite
+denominator.  The @kbd{I a s} command will do the former and the @kbd{a n}
+algebra command will do the latter, but we'll do both with rewrite
 rules just for practice.
 
 Rewrite rules are written with the @samp{:=} symbol.
 
 @smallexample
 @group
-1:  1 / cos(x) - sin(x)^2 / cos(x)
+1:  2 / cos(x)^2 - 2 sin(x)^2 / cos(x)^2
     .
 
     a r tan(a) := sin(a)/cos(a) @key{RET}
@@ -5316,7 +5335,7 @@ To merge over a common denominator, we can use another simple rule:
 
 @smallexample
 @group
-1:  (1 - sin(x)^2) / cos(x)
+1:  (2 - 2 sin(x)^2) / cos(x)^2
     .
 
     a r a/x + b/x := (a+b)/x @key{RET}
@@ -5331,13 +5350,13 @@ denominators.
 
 Second, meta-variable names are independent from variables in the
 target formula.  Notice that the meta-variable @samp{x} here matches
-the subformula @samp{cos(x)}; Calc never confuses the two meanings of
+the subformula @samp{cos(x)^2}; Calc never confuses the two meanings of
 @samp{x}.
 
 And third, rewrite patterns know a little bit about the algebraic
 properties of formulas.  The pattern called for a sum of two quotients;
 Calc was able to match a difference of two quotients by matching
-@samp{a = 1}, @samp{b = -sin(x)^2}, and @samp{x = cos(x)}.
+@samp{a = 2}, @samp{b = -2 sin(x)^2}, and @samp{x = cos(x)^2}.
 
 @c [fix-ref Algebraic Properties of Rewrite Rules]
 We could just as easily have written @samp{a/x - b/x := (a-b)/x} for
@@ -5349,15 +5368,15 @@ of Rewrite Rules}, for some examples of this.)
 One more rewrite will complete the job.  We want to use the identity
 @samp{sin(x)^2 + cos(x)^2 = 1}, but of course we must first rearrange
 the identity in a way that matches our formula.  The obvious rule
-would be @samp{@w{1 - sin(x)^2} := cos(x)^2}, but a little thought shows
+would be @samp{@w{2 - 2 sin(x)^2} := 2 cos(x)^2}, but a little thought shows
 that the rule @samp{sin(x)^2 := 1 - cos(x)^2} will also work.  The
 latter rule has a more general pattern so it will work in many other
 situations, too.
 
 @smallexample
 @group
-1:  (1 + cos(x)^2 - 1) / cos(x)           1:  cos(x)
-    .                                         .
+1:  (2 + 2 cos(x)^2 - 2) / cos(x)^2           1:  2
+    .                                            .
 
     a r sin(x)^2 := 1 - cos(x)^2 @key{RET}          a s
 @end group
@@ -5378,7 +5397,7 @@ having to retype it.
 ' a/x + b/x := (a+b)/x @key{RET}         s t merge @key{RET}
 ' sin(x)^2 := 1 - cos(x)^2 @key{RET}     s t sinsqr @key{RET}
 
-1:  1 / cos(x) - sin(x) tan(x)     1:  cos(x)
+1:  2 / cos(x)^2 - 2 tan(x)^2      1:  2
     .                                  .
 
     r 1                a r tsc @key{RET}  a r merge @key{RET}  a r sinsqr @key{RET}  a s
@@ -8012,7 +8031,7 @@ But if @w{@samp{17 inf = inf}}, then @samp{17 inf / inf = inf / inf = 17}, too.
 
 @samp{exp(inf) = inf}.  It's tempting to say that the exponential
 of infinity must be ``bigger'' than ``regular'' infinity, but as
-far as Calc is concerned all infinities are as just as big.
+far as Calc is concerned all infinities are the same size.
 In other words, as @expr{x} goes to infinity, @expr{e^x} also goes
 to infinity, but the fact the @expr{e^x} grows much faster than
 @expr{x} is not relevant here.
@@ -9667,6 +9686,11 @@ is like @kbd{M-x} except that it enters the initial string @samp{calc-}
 for you.  For example, the following key sequences are equivalent:
 @kbd{S}, @kbd{M-x calc-sin @key{RET}}, @kbd{x sin @key{RET}}.
 
+Although Calc is designed to be used from the keyboard, some of
+Calc's more common commands are available from a menu.  In the menu, the
+arguments to the functions are given by referring to their stack level
+numbers.
+
 @cindex Extensions module
 @cindex @file{calc-ext} module
 The Calculator exists in many parts.  When you type @kbd{C-x * c}, the
@@ -9789,18 +9813,29 @@ the stack but resets everything else to its initial state; with a
 negative prefix argument, @kbd{C-x * 0} preserves the contents of the
 stack but resets everything else to its default state.
 
-@pindex calc-version
-The @kbd{M-x calc-version} command displays the current version number
-of Calc and the name of the person who installed it on your system.
-(This information is also present in the @samp{*Calc Trail*} buffer,
-and in the output of the @kbd{h h} command.)
-
 @node Help Commands, Stack Basics, Basic Commands, Introduction
 @section Help Commands
 
 @noindent
 @cindex Help commands
 @kindex ?
+@kindex a ?
+@kindex b ?
+@kindex c ?
+@kindex d ?
+@kindex f ?
+@kindex g ?
+@kindex j ?
+@kindex k ?
+@kindex m ?
+@kindex r ?
+@kindex s ?
+@kindex t ?
+@kindex u ?
+@kindex v ?
+@kindex V ?
+@kindex z ?
+@kindex Z ?
 @pindex calc-help
 The @kbd{?} key (@code{calc-help}) displays a series of brief help messages.
 Some keys (such as @kbd{b} and @kbd{d}) are prefix keys, like Emacs'
@@ -10020,9 +10055,9 @@ During numeric entry, the only editing key available is @key{DEL}.
 @pindex calc-algebraic-entry
 @cindex Algebraic notation
 @cindex Formulas, entering
-Calculations can also be entered in algebraic form.  This is accomplished
-by typing the apostrophe key, ', followed by the expression in
-standard format:  
+The @kbd{'} (@code{calc-algebraic-entry}) command can be used to enter
+calculations in algebraic form.  This is accomplished by typing the
+apostrophe key, ', followed by the expression in standard format:  
 
 @example
 ' 2+3*4 @key{RET}.
@@ -10038,9 +10073,9 @@ expressions in this way.  You may want to use @key{DEL} every so often to
 clear previous results off the stack.
 
 You can press the apostrophe key during normal numeric entry to switch
-the half-entered number into Algebraic entry mode.  One reason to do this
-would be to use the full Emacs cursor motion and editing keys, which are
-available during algebraic entry but not during numeric entry.
+the half-entered number into Algebraic entry mode.  One reason to do
+this would be to fix a typo, as the full Emacs cursor motion and editing
+keys are available during algebraic entry but not during numeric entry.
 
 In the same vein, during either numeric or algebraic entry you can
 press @kbd{`} (backquote) to switch to @code{calc-edit} mode, where
@@ -10262,10 +10297,13 @@ are removed or restored.  If it was a ``store'' operation, you are
 queried whether or not to restore the variable to its original value.
 The @kbd{U} key may be pressed any number of times to undo successively
 farther back in time; with a numeric prefix argument it undoes a
-specified number of operations.  The undo history is cleared only by the
-@kbd{q} (@code{calc-quit}) command.  (Recall that @kbd{C-x * c} is
-synonymous with @code{calc-quit} while inside the Calculator; this
-also clears the undo history.)
+specified number of operations.  When the Calculator is quit, as with
+the @kbd{q} (@code{calc-quit}) command, the undo history will be
+truncated to the length of the customizable variable
+@code{calc-undo-length} (@pxref{Customizing Calc}), which by default
+is @expr{100}. (Recall that @kbd{C-x * c} is synonymous with
+@code{calc-quit} while inside the Calculator; this also truncates the
+undo history.)
 
 Currently the mode-setting commands (like @code{calc-precision}) are not
 undoable.  You can undo past a point where you changed a mode, but you
@@ -11055,29 +11093,29 @@ days 0 and @mathit{-1} respectively in Calc's internal numbering scheme.
 
 @cindex Julian day counting
 Another day counting system in common use is, confusingly, also called
-``Julian.''  The Julian day number is the numbers of days since 
-12:00 noon (GMT) on Jan 1, 4713 BC, which in Calc's scheme (in GMT) 
+``Julian.''  The Julian day number is the numbers of days since
+12:00 noon (GMT) on Jan 1, 4713 BC, which in Calc's scheme (in GMT)
 is @mathit{-1721423.5} (recall that Calc starts at midnight instead
 of noon).  Thus to convert a Calc date code obtained by unpacking a
 date form into a Julian day number, simply add 1721423.5 after
 compensating for the time zone difference.  The built-in @kbd{t J}
 command performs this conversion for you.
 
-The Julian day number is based on the Julian cycle, which was invented 
+The Julian day number is based on the Julian cycle, which was invented
 in 1583 by Joseph Justus Scaliger.  Scaliger named it the Julian cycle
-since it is involves the Julian calendar, but some have suggested that
+since it involves the Julian calendar, but some have suggested that
 Scaliger named it in honor of his father, Julius Caesar Scaliger.  The
-Julian cycle is based it on three other cycles: the indiction cycle,
-the Metonic cycle, and the solar cycle.  The indiction cycle is a 15
-year cycle originally used by the Romans for tax purposes but later
-used to date medieval documents.  The Metonic cycle is a 19 year
-cycle; 19 years is close to being a common multiple of a solar year
-and a lunar month, and so every 19 years the phases of the moon will
-occur on the same days of the year.  The solar cycle is a 28 year
-cycle; the Julian calendar repeats itself every 28 years.  The
-smallest time period which contains multiples of all three cycles is
-the least common multiple of 15 years, 19 years and 28 years, which
-(since they're pairwise relatively prime) is 
+Julian cycle is based on three other cycles: the indiction cycle, the
+Metonic cycle, and the solar cycle.  The indiction cycle is a 15 year
+cycle originally used by the Romans for tax purposes but later used to
+date medieval documents.  The Metonic cycle is a 19 year cycle; 19
+years is close to being a common multiple of a solar year and a lunar
+month, and so every 19 years the phases of the moon will occur on the
+same days of the year.  The solar cycle is a 28 year cycle; the Julian
+calendar repeats itself every 28 years.  The smallest time period
+which contains multiples of all three cycles is the least common
+multiple of 15 years, 19 years and 28 years, which (since they're
+pairwise relatively prime) is
 @texline @math{15\times 19\times 28 = 7980} years.
 @infoline 15*19*28 = 7980 years.
 This is the length of a Julian cycle.  Working backwards, the previous
@@ -11824,12 +11862,29 @@ which copies instead of moving the element in level @var{n}.)
 With a negative argument @mathit{-@var{n}}, @key{TAB} rotates the stack
 to move the object in level @var{n} to the deepest place in the
 stack, and the object in level @mathit{@var{n}+1} to the top.  @kbd{M-@key{TAB}}
-rotates the deepest stack element to be in level @mathit{n}, also
+rotates the deepest stack element to be in level @var{n}, also
 putting the top stack element in level @mathit{@var{n}+1}.
 
 @xref{Selecting Subformulas}, for a way to apply these commands to
 any portion of a vector or formula on the stack.
 
+@kindex C-xC-t
+@pindex calc-transpose-lines
+@cindex Moving stack entries
+The command @kbd{C-x C-t} (@code{calc-transpose-lines}) will transpose
+the stack object determined by the point with the stack object at the
+next higher level. For example, with @samp{10 20 30 40 50} on the
+stack and the point on the line containing @samp{30}, @kbd{C-x C-t}
+creates @samp{10 20 40 30 50}.  More generally, @kbd{C-x C-t} acts on
+the stack objects determined by the current point (and mark) similar
+to how the text-mode command @code{transpose-lines} acts on 
+lines.  With argument @var{n}, @kbd{C-x C-t} will move the stack object
+at the level above the current point and move it past N other objects;
+for example, with @samp{10 20 30 40 50} on the stack and the point on
+the line containing @samp{30}, @kbd{C-u 2 C-x C-t} creates 
+@samp{10 40 20 30 50}. With an argument of 0, @kbd{C-x C-t} will switch
+the stack objects at the levels determined by the point and the mark. 
+
 @node Editing Stack Entries, Trail Commands, Stack Manipulation, Stack and Trail
 @section Editing Stack Entries
 
@@ -11838,11 +11893,12 @@ any portion of a vector or formula on the stack.
 @pindex calc-edit
 @pindex calc-edit-finish
 @cindex Editing the stack with Emacs
-The backquote, @kbd{`} (@code{calc-edit}) command creates a temporary
-buffer (@samp{*Calc Edit*}) for editing the top-of-stack value using
-regular Emacs commands.  With a numeric prefix argument, it edits the
-specified number of stack entries at once.  (An argument of zero edits
-the entire stack; a negative argument edits one specific stack entry.)
+The @kbd{`} (@code{calc-edit}) command creates a temporary buffer
+(@samp{*Calc Edit*}) for editing the top-of-stack value using regular
+Emacs commands.  Note that @kbd{`} is a backquote, not a quote. With a
+numeric prefix argument, it edits the specified number of stack entries
+at once.  (An argument of zero edits the entire stack; a negative
+argument edits one specific stack entry.)
 
 When you are done editing, press @kbd{C-c C-c} to finish and return
 to Calc.  The @key{RET} and @key{LFD} keys also work to finish most
@@ -12078,17 +12134,18 @@ the @emph{appearance} or @emph{interpretation} of the stack's contents.
 @cindex Saving mode settings
 @cindex Permanent mode settings
 @cindex Calc init file, mode settings
-You can save all of the current mode settings in your Calc init file 
+You can save all of the current mode settings in your Calc init file
 (the file given by the variable @code{calc-settings-file}, typically
-@file{~/.calc.el}) with the @kbd{m m} (@code{calc-save-modes}) command.
-This will cause Emacs to reestablish these modes each time it starts up.
-The modes saved in the file include everything controlled by the @kbd{m}
-and @kbd{d} prefix keys, the current precision and binary word size,
-whether or not the trail is displayed, the current height of the Calc
-window, and more.  The current interface (used when you type @kbd{C-x * *}) 
-is also saved.  If there were already saved mode settings in the
-file, they are replaced.  Otherwise, the new mode information is
-appended to the end of the file.
+@file{~/.emacs.d/calc.el}) with the @kbd{m m} (@code{calc-save-modes})
+command.  This will cause Emacs to reestablish these modes each time
+it starts up.  The modes saved in the file include everything
+controlled by the @kbd{m} and @kbd{d} prefix keys, the current
+precision and binary word size, whether or not the trail is displayed,
+the current height of the Calc window, and more.  The current
+interface (used when you type @kbd{C-x * *}) is also saved.  If there
+were already saved mode settings in the file, they are replaced.
+Otherwise, the new mode information is appended to the end of the
+file.
 
 @kindex m R
 @pindex calc-mode-record-mode
@@ -13117,6 +13174,44 @@ are displayed with at least enough digits to represent
 in the current radix.  (Larger integers will still be displayed in their
 entirety.) 
 
+@cindex Two's complements
+With the binary, octal and hexadecimal display modes, Calc can
+display @expr{w}-bit integers using two's complement notation.  This
+option is selected with the key sequences @kbd{C-u d 2}, @kbd{C-u d 8}
+and @kbd{C-u d 6}, respectively, and a negative word size might be
+appropriate (@pxref{Binary Functions}). In two's complement 
+notation, the integers in the (nearly) symmetric interval from
+@texline @math{-2^{w-1}}
+@infoline @expr{-2^(w-1)}
+to
+@texline @math{2^{w-1}-1}
+@infoline @expr{2^(w-1)-1}
+are represented by the integers from @expr{0} to @expr{2^w-1}:
+the integers from @expr{0} to
+@texline @math{2^{w-1}-1}
+@infoline @expr{2^(w-1)-1}
+are represented by themselves and the integers from
+@texline @math{-2^{w-1}}
+@infoline @expr{-2^(w-1)}
+to @expr{-1} are represented by the integers from 
+@texline @math{2^{w-1}}
+@infoline @expr{2^(w-1)}
+to @expr{2^w-1} (the integer @expr{k} is represented by @expr{k+2^w}).
+Calc will display a two's complement integer by the radix (either
+@expr{2}, @expr{8} or @expr{16}), two @kbd{#} symbols, and then its
+representation (including any leading zeros necessary to include all
+@expr{w} bits).  In a two's complement display mode, numbers that
+are not displayed in two's complement notation (i.e., that aren't
+integers from  
+@texline @math{-2^{w-1}}
+@infoline @expr{-2^(w-1)}
+to
+@c (
+@texline @math{2^{w-1}-1})
+@infoline @expr{2^(w-1)-1})
+will be represented using Calc's usual notation (in the appropriate
+radix).
+
 @node Grouping Digits, Float Formats, Radix Modes, Display Modes
 @subsection Grouping Digits
 
@@ -13797,6 +13892,9 @@ shifted letter key.
 * C FORTRAN Pascal::
 * TeX and LaTeX Language Modes::
 * Eqn Language Mode::
+* Yacas Language Mode::
+* Maxima Language Mode::
+* Giac Language Mode::
 * Mathematica Language Mode::
 * Maple Language Mode::
 * Compositions::
@@ -13960,13 +14058,13 @@ entered this way or using square brackets.  Since FORTRAN uses round
 parentheses for both function calls and array subscripts, Calc displays
 both in the same way; @samp{a(i)} is interpreted as a function call
 upon reading, and subscripts must be entered as @samp{subscr(a, i)}.
-Also, if the variable @code{a} has been declared to have type
-@code{vector} or @code{matrix} then @samp{a(i)} will be parsed as a
-subscript.  (@xref{Declarations}.)  Usually it doesn't matter, though;
-if you enter the subscript expression @samp{a(i)} and Calc interprets
-it as a function call, you'll never know the difference unless you
-switch to another language mode or replace @code{a} with an actual
-vector (or unless @code{a} happens to be the name of a built-in
+If the variable @code{a} has been declared to have type
+@code{vector} or @code{matrix}, however,  then @samp{a(i)} will be
+parsed as a subscript.  (@xref{Declarations}.)  Usually it doesn't
+matter, though; if you enter the subscript expression @samp{a(i)} and
+Calc interprets it as a function call, you'll never know the difference
+unless you switch to another language mode or replace @code{a} with an
+actual vector (or unless @code{a} happens to be the name of a built-in
 function!).
 
 Underscores are allowed in variable and function names in all of these
@@ -14001,7 +14099,7 @@ mode may display it differently.
 Formulas are entered and displayed in the appropriate notation;
 @texline @math{\sin(a/b)}
 @infoline @expr{sin(a/b)}
-will appear as @samp{\sin\left( a \over b \right)} in @TeX{} mode and
+will appear as @samp{\sin\left( @{a \over b@} \right)} in @TeX{} mode and
 @samp{\sin\left(\frac@{a@}@{b@}\right)} in La@TeX{} mode.
 Math formulas are often enclosed by @samp{$ $} signs in @TeX{} and
 La@TeX{}; these should be omitted when interfacing with Calc.  To Calc,
@@ -14097,12 +14195,12 @@ to the function name @code{Vec}, because @code{vec} is the name of
 a built-in Calc function.  The following table shows the accents
 in Calc, @TeX{}, La@TeX{} and @dfn{eqn} (described in the next section):
 
+@ignore
 @iftex
 @begingroup
 @let@calcindexershow=@calcindexernoshow  @c Suppress marginal notes
 @let@calcindexersh=@calcindexernoshow
 @end iftex
-@ignore
 @starindex
 @end ignore
 @tindex acute
@@ -14202,9 +14300,11 @@ in Calc, @TeX{}, La@TeX{} and @dfn{eqn} (described in the next section):
 @starindex
 @end ignore
 @tindex VEC
+@ignore
 @iftex
 @endgroup
 @end iftex
+@end ignore
 @example
 Calc      TeX           LaTeX         eqn
 ----      ---           -----         ---
@@ -14399,7 +14499,7 @@ $$ \pmatrix{ {a \over b} & 0 \cr 0 & 2^{(x + 1)} } $$
 @sp 2
 @end iftex
 
-@node Eqn Language Mode, Mathematica Language Mode, TeX and LaTeX Language Modes, Language Modes
+@node Eqn Language Mode, Yacas Language Mode, TeX and LaTeX Language Modes, Language Modes
 @subsection Eqn Language Mode
 
 @noindent
@@ -14475,7 +14575,87 @@ The words @code{lcol} and @code{rcol} are recognized as synonyms
 for @code{ccol} during input, and are generated instead of @code{ccol}
 if the matrix justification mode so specifies.
 
-@node Mathematica Language Mode, Maple Language Mode, Eqn Language Mode, Language Modes
+@node Yacas Language Mode, Maxima Language Mode, Eqn Language Mode, Language Modes
+@subsection Yacas Language Mode
+
+@noindent
+@kindex d Y
+@pindex calc-yacas-language
+@cindex Yacas language
+The @kbd{d Y} (@code{calc-yacas-language}) command selects the
+conventions of Yacas, a free computer algebra system.  While the
+operators and functions in Yacas are similar to those of Calc, the names
+of built-in functions in Yacas are capitalized.  The Calc formula 
+@samp{sin(2 x)}, for example, is entered and displayed @samp{Sin(2 x)}
+in Yacas mode,  and `@samp{arcsin(x^2)} is @samp{ArcSin(x^2)} in Yacas
+mode.  Complex numbers are written  are written @samp{3 + 4 I}.
+The standard special constants are written @code{Pi}, @code{E},
+@code{I}, @code{GoldenRatio} and @code{Gamma}.  @code{Infinity}
+represents both @code{inf} and @code{uinf}, and @code{Undefined}
+represents @code{nan}.
+
+Certain operators on functions, such as @code{D} for differentiation 
+and @code{Integrate} for integration, take a prefix form in Yacas.  For
+example, the derivative of @w{@samp{e^x sin(x)}} can be computed with 
+@w{@samp{D(x) Exp(x)*Sin(x)}}.
+
+Other notable differences between Yacas and standard Calc expressions
+are that vectors and matrices use curly braces in Yacas, and subscripts
+use square brackets.  If, for example, @samp{A} represents the list
+@samp{@{a,2,c,4@}}, then @samp{A[3]} would equal @samp{c}.
+
+
+@node Maxima Language Mode, Giac Language Mode, Yacas Language Mode, Language Modes
+@subsection Maxima Language Mode
+
+@noindent
+@kindex d X
+@pindex calc-maxima-language
+@cindex Maxima language
+The @kbd{d X} (@code{calc-maxima-language}) command selects the
+conventions of Maxima, another free computer algebra system.  The
+function names in Maxima are similar, but not always identical, to Calc.
+For example, instead of @samp{arcsin(x)}, Maxima will use 
+@samp{asin(x)}.  Complex numbers are written @samp{3 + 4 %i}.  The
+standard special constants are written @code{%pi},  @code{%e},
+@code{%i}, @code{%phi} and @code{%gamma}.  In Maxima,  @code{inf} means
+the same as in Calc, but @code{infinity} represents Calc's @code{uinf}.
+
+Underscores as well as percent signs are allowed in function and
+variable names in Maxima mode.  The underscore again is equivalent to
+the @samp{#} in Normal mode, and the percent sign is equivalent to 
+@samp{o'o}.  
+
+Maxima uses square brackets for lists and vectors, and matrices are
+written as calls to the function @code{matrix}, given the row vectors of
+the matrix as arguments.  Square brackets are also used as subscripts.
+
+@node Giac Language Mode, Mathematica Language Mode, Maxima Language Mode, Language Modes
+@subsection Giac Language Mode
+
+@noindent
+@kindex d A
+@pindex calc-giac-language
+@cindex Giac language
+The @kbd{d A} (@code{calc-giac-language}) command selects the
+conventions of Giac, another free computer algebra system.  The function
+names in Giac are similar to Maxima.  Complex numbers are written
+@samp{3 + 4 i}.  The standard special constants in Giac are the same as
+in Calc, except that @code{infinity} represents both Calc's @code{inf}
+and @code{uinf}. 
+
+Underscores are allowed in function and variable names in Giac mode.
+Brackets are used for subscripts.  In Giac, indexing of lists begins at
+0, instead of 1 as in Calc.  So if  @samp{A} represents the list
+@samp{[a,2,c,4]}, then @samp{A[2]} would equal @samp{c}.  In general,
+@samp{A[n]} in Giac mode corresponds to @samp{A_(n+1)} in Normal mode.
+
+The Giac interval notation @samp{2 .. 3} has no surrounding brackets;
+Calc reads @samp{2 .. 3} as the closed interval @samp{[2 .. 3]} and
+writes any kind of interval as @samp{2 .. 3}.  This means you cannot see
+the difference between an open and a closed interval while in Giac mode.
+
+@node Mathematica Language Mode, Maple Language Mode, Giac Language Mode, Language Modes
 @subsection Mathematica Language Mode
 
 @noindent
@@ -14520,11 +14700,8 @@ pass through Calc.  As a special case, matrices are written as calls
 to the function @code{matrix}, given a list of lists as the argument,
 and can be read in this form or with all-capitals @code{MATRIX}.
 
-The Maple interval notation @samp{2 .. 3} has no surrounding brackets;
-Calc reads @samp{2 .. 3} as the closed interval @samp{[2 .. 3]}, and
-writes any kind of interval as @samp{2 .. 3}.  This means you cannot
-see the difference between an open and a closed interval while in
-Maple display mode.
+The Maple interval notation @samp{2 .. 3} is like Giac's interval
+notation, and is handled the same by Calc.
 
 Maple writes complex numbers as @samp{3 + 4*I}.  Its special constants
 are @code{Pi}, @code{E}, @code{I}, and @code{infinity} (all three of
@@ -15665,10 +15842,10 @@ stack window (or under an editing window in Embedded mode).
 The basic mode line format is:
 
 @example
---%%-Calc: 12 Deg @var{other modes}       (Calculator)
+--%*-Calc: 12 Deg @var{other modes}       (Calculator)
 @end example
 
-The @samp{%%} is the Emacs symbol for ``read-only''; it shows that
+The @samp{%*} indicates that the buffer is ``read-only''; it shows that
 regular Emacs commands are not allowed to edit the stack buffer
 as if it were text.
 
@@ -16432,6 +16609,7 @@ or matrix argument, these functions operate element-wise.
 @mindex v p
 @end ignore
 @kindex v p (complex)
+@kindex V p (complex)
 @pindex calc-pack
 The @kbd{v p} (@code{calc-pack}) command can pack the top two numbers on
 the stack into a composite object such as a complex number.  With
@@ -16443,6 +16621,7 @@ with an argument of @mathit{-2}, it produces a polar complex number.
 @mindex v u
 @end ignore
 @kindex v u (complex)
+@kindex V u (complex)
 @pindex calc-unpack
 The @kbd{v u} (@code{calc-unpack}) command takes the complex number
 (or other composite object) on the top of the stack and unpacks it
@@ -17829,7 +18008,7 @@ of the binary operations described here operate modulo @expr{2^w}.  In
 particular, negative arguments are converted to positive integers modulo
 @expr{2^w} by all binary functions.
 
-If the word size is negative, binary operations produce 2's complement
+If the word size is negative, binary operations produce twos-complement
 integers from 
 @texline @math{-2^{-w-1}}
 @infoline @expr{-(2^(-w-1))} 
@@ -18481,8 +18660,8 @@ function briefly; for a more detailed discussion (including some nifty
 diagrams), consult Steele's book.
 
 Note that the branch cuts for @code{arctan} and @code{arctanh} were
-changed between the first and second editions of Steele.  Versions of
-Calc starting with 2.00 follow the second edition.
+changed between the first and second editions of Steele.  Recent
+versions of Calc follow the second edition.
 
 The new branch cuts exactly match those of the HP-28/48 calculators.
 They also match those of Mathematica 1.2, except that Mathematica's
@@ -19244,6 +19423,7 @@ described in this chapter because they are most often used to build
 vectors.
 
 @kindex v p
+@kindex V p
 @pindex calc-pack
 The @kbd{v p} (@code{calc-pack}) [@code{pack}] command collects several
 elements from the stack into a matrix, complex number, HMS form, error
@@ -19376,6 +19556,7 @@ number of data items does not match the number of items required
 by the mode.
 
 @kindex v u
+@kindex V u
 @pindex calc-unpack
 The @kbd{v u} (@code{calc-unpack}) command takes the vector, complex
 number, HMS form, or other composite object on the top of the stack and
@@ -19493,6 +19674,7 @@ two stack arguments in the opposite order.  Thus @kbd{I |} is equivalent
 to @kbd{@key{TAB} |}, but possibly more convenient and also a bit faster.
 
 @kindex v d
+@kindex V d
 @pindex calc-diag
 @tindex diag
 The @kbd{v d} (@code{calc-diag}) [@code{diag}] function builds a diagonal
@@ -19511,6 +19693,7 @@ matrix first and then add a constant value to that matrix.  (Another
 alternative would be to use @kbd{v b} and @kbd{v a}; see below.)
 
 @kindex v i
+@kindex V i
 @pindex calc-ident
 @tindex idn
 The @kbd{v i} (@code{calc-ident}) [@code{idn}] function builds an identity
@@ -19531,6 +19714,7 @@ identity matrices are immediately expanded to the current default
 dimensions.
 
 @kindex v x
+@kindex V x
 @pindex calc-index
 @tindex index
 The @kbd{v x} (@code{calc-index}) [@code{index}] function builds a vector
@@ -19555,6 +19739,7 @@ sequence to be generated.  For example, @samp{index(-3, a, b)} produces
 is one for positive @var{n} or two for negative @var{n}.
 
 @kindex v b
+@kindex V b
 @pindex calc-build-vector
 @tindex cvec
 The @kbd{v b} (@code{calc-build-vector}) [@code{cvec}] function builds a
@@ -19565,7 +19750,9 @@ can also be used to build an @var{n}-by-@var{m} matrix of copies of @var{x}.
 to build a matrix of copies of that row.)
 
 @kindex v h
+@kindex V h
 @kindex I v h
+@kindex I V h
 @pindex calc-head
 @pindex calc-tail
 @tindex head
@@ -19576,6 +19763,7 @@ function returns the vector with its first element removed.  In both
 cases, the argument must be a non-empty vector.
 
 @kindex v k
+@kindex V k
 @pindex calc-cons
 @tindex cons
 The @kbd{v k} (@code{calc-cons}) [@code{cons}] function takes a value @var{h}
@@ -19585,15 +19773,18 @@ if @var{h} is itself a vector, @kbd{|} will concatenate the two vectors
 whereas @code{cons} will insert @var{h} at the front of the vector @var{t}.
 
 @kindex H v h
+@kindex H V h
 @tindex rhead
 @ignore
 @mindex @idots
 @end ignore
 @kindex H I v h
+@kindex H I V h
 @ignore
 @mindex @null
 @end ignore
 @kindex H v k
+@kindex H V k
 @ignore
 @mindex @null
 @end ignore
@@ -19615,6 +19806,7 @@ Also, @samp{head([a, b, c, d]) = a}, @samp{tail([a, b, c, d]) = [b, c, d]},
 
 @noindent
 @kindex v r
+@kindex V r
 @pindex calc-mrow
 @tindex mrow
 The @kbd{v r} (@code{calc-mrow}) [@code{mrow}] command extracts one row of
@@ -19665,6 +19857,7 @@ of a square matrix in the form of a vector.  In algebraic form this
 function is called @code{getdiag}.
 
 @kindex v c
+@kindex V c
 @pindex calc-mcol
 @tindex mcol
 @tindex mrcol
@@ -19682,6 +19875,7 @@ use subscript notation:  @samp{m_i_j} gives row @expr{i}, column @expr{j}
 of matrix @expr{m}.
 
 @kindex v s
+@kindex V s
 @pindex calc-subvector
 @tindex subvec
 The @kbd{v s} (@code{calc-subvector}) [@code{subvec}] command extracts
@@ -19702,6 +19896,7 @@ end of the vector are used.  The infinity symbol, @code{inf}, also
 has this effect when used as the ending index.
 
 @kindex I v s
+@kindex I V s
 @tindex rsubvec
 With the Inverse flag, @kbd{I v s} [@code{rsubvec}] removes a subvector
 from a vector.  The arguments are interpreted the same as for the
@@ -19717,6 +19912,7 @@ vectors one element at a time.
 
 @noindent
 @kindex v l
+@kindex V l
 @pindex calc-vlength
 @tindex vlen
 The @kbd{v l} (@code{calc-vlength}) [@code{vlen}] command computes the
@@ -19725,6 +19921,7 @@ Note that matrices are just vectors of vectors for the purposes of this
 command.
 
 @kindex H v l
+@kindex H V l
 @tindex mdims
 With the Hyperbolic flag, @kbd{H v l} [@code{mdims}] computes a vector
 of the dimensions of a vector, matrix, or higher-order object.  For
@@ -19735,6 +19932,7 @@ its argument is a
 matrix.
 
 @kindex v f
+@kindex V f
 @pindex calc-vector-find
 @tindex find
 The @kbd{v f} (@code{calc-vector-find}) [@code{find}] command searches
@@ -19745,6 +19943,7 @@ Otherwise, the result is zero.  The numeric prefix argument, if given,
 allows you to select any starting index for the search.
 
 @kindex v a
+@kindex V a
 @pindex calc-arrange-vector
 @tindex arrange
 @cindex Arranging a matrix
@@ -19775,7 +19974,9 @@ matrix), and @kbd{v a 0} produces the flattened list
 @samp{[1, 2, @w{3, 4}]}.
 
 @cindex Sorting data
+@kindex v S
 @kindex V S
+@kindex I v S
 @kindex I V S
 @pindex calc-sort
 @tindex sort
@@ -19798,7 +19999,9 @@ The @kbd{I V S} [@code{rsort}] command sorts a vector into decreasing order.
 @cindex Inverse of permutation
 @cindex Index tables
 @cindex Rank tables
+@kindex v G
 @kindex V G
+@kindex I v G
 @kindex I V G
 @pindex calc-grade
 @tindex grade
@@ -19830,6 +20033,7 @@ by phone numbers.  Because the sort is stable, any two rows with equal
 phone numbers will remain sorted by name even after the second sort.
 
 @cindex Histograms
+@kindex v H
 @kindex V H
 @pindex calc-histogram
 @ignore
@@ -19847,6 +20051,7 @@ range are ignored.  (You can tell if elements have been ignored by noting
 that the counts in the result vector don't add up to the length of the
 input vector.)
 
+@kindex H v H
 @kindex H V H
 With the Hyperbolic flag, @kbd{H V H} pulls two vectors from the stack.
 The second-to-top vector is the list of numbers as before.  The top
@@ -19856,6 +20061,7 @@ the first weight is 10, then 10 will be added to bin 4 of the result
 vector.  Without the hyperbolic flag, every element has a weight of one.
 
 @kindex v t
+@kindex V t
 @pindex calc-transpose
 @tindex trn
 The @kbd{v t} (@code{calc-transpose}) [@code{trn}] command computes
@@ -19864,6 +20070,7 @@ is a plain vector, it is treated as a row vector and transposed into
 a one-column matrix.
 
 @kindex v v
+@kindex V v
 @pindex calc-reverse-vector
 @tindex rev
 The @kbd{v v} (@code{calc-reverse-vector}) [@code{rev}] command reverses
@@ -19873,6 +20080,7 @@ principle can be used to apply other vector commands to the columns of
 a matrix.)
 
 @kindex v m
+@kindex V m
 @pindex calc-mask-vector
 @tindex vmask
 The @kbd{v m} (@code{calc-mask-vector}) [@code{vmask}] command uses
@@ -19885,6 +20093,7 @@ to zeros in the mask vector deleted.  Thus, for example,
 @xref{Logical Operations}.
 
 @kindex v e
+@kindex V e
 @pindex calc-expand-vector
 @tindex vexp
 The @kbd{v e} (@code{calc-expand-vector}) [@code{vexp}] command
@@ -19898,6 +20107,7 @@ unreplaced in the result.  Thus @samp{vexp([2, 0, 3, 0, 7], [a, b])}
 produces @samp{[a, 0, b, 0, 7]}.
 
 @kindex H v e
+@kindex H V e
 With the Hyperbolic flag, @kbd{H v e} takes a filler value from the
 top of the stack; the mask and target vectors come from the third and
 second elements of the stack.  This filler is used where the mask is
@@ -19930,6 +20140,7 @@ vectors or matrices: @code{change-sign}, @code{conj}, @code{arg},
 @code{re}, @code{im}, @code{polar}, @code{rect}, @code{clean},
 @code{float}, @code{frac}.  @xref{Function Index}.
 
+@kindex v J
 @kindex V J
 @pindex calc-conj-transpose
 @tindex ctrn
@@ -19953,25 +20164,28 @@ a point in two- or three-dimensional space, this is the distance
 from that point to the origin.
 
 @kindex v n
+@kindex V n
 @pindex calc-rnorm
 @tindex rnorm
-The @kbd{v n} (@code{calc-rnorm}) [@code{rnorm}] command computes
-the row norm, or infinity-norm, of a vector or matrix.  For a plain
-vector, this is the maximum of the absolute values of the elements.
-For a matrix, this is the maximum of the row-absolute-value-sums,
-i.e., of the sums of the absolute values of the elements along the
-various rows.
+The @kbd{v n} (@code{calc-rnorm}) [@code{rnorm}] command computes the
+infinity-norm of a vector, or the row norm of a matrix.  For a plain
+vector, this is the maximum of the absolute values of the elements.  For
+a matrix, this is the maximum of the row-absolute-value-sums, i.e., of
+the sums of the absolute values of the elements along the various rows.
 
+@kindex v N
 @kindex V N
 @pindex calc-cnorm
 @tindex cnorm
 The @kbd{V N} (@code{calc-cnorm}) [@code{cnorm}] command computes
-the column norm, or one-norm, of a vector or matrix.  For a plain
+the one-norm of a vector, or column norm of a matrix.  For a plain
 vector, this is the sum of the absolute values of the elements.
 For a matrix, this is the maximum of the column-absolute-value-sums.
 General @expr{k}-norms for @expr{k} other than one or infinity are
-not provided.
+not provided.  However, the 2-norm (or Frobenius norm) is provided for
+vectors by the @kbd{A} (@code{calc-abs}) command.
 
+@kindex v C
 @kindex V C
 @pindex calc-cross
 @tindex cross
@@ -20000,12 +20214,14 @@ command simply computes @expr{1/x}.  This is okay, because the
 @samp{/} operator also does a matrix inversion when dividing one
 by a matrix.
 
+@kindex v D
 @kindex V D
 @pindex calc-mdet
 @tindex det
 The @kbd{V D} (@code{calc-mdet}) [@code{det}] command computes the
 determinant of a square matrix.
 
+@kindex v L
 @kindex V L
 @pindex calc-mlud
 @tindex lud
@@ -20016,6 +20232,7 @@ The first is a permutation matrix that arises from pivoting in the
 algorithm, the second is lower-triangular with ones on the diagonal,
 and the third is upper-triangular.
 
+@kindex v T
 @kindex V T
 @pindex calc-mtrace
 @tindex tr
@@ -20023,6 +20240,13 @@ The @kbd{V T} (@code{calc-mtrace}) [@code{tr}] command computes the
 trace of a square matrix.  This is defined as the sum of the diagonal
 elements of the matrix.
 
+@kindex v K
+@kindex V K
+@pindex calc-kron
+@tindex kron
+The @kbd{V K} (@code{calc-kron}) [@code{kron}] command computes
+the Kronecker product of two matrices.
+
 @node Set Operations, Statistical Operations, Vector and Matrix Arithmetic, Matrix Functions
 @section Set Operations using Vectors
 
@@ -20057,6 +20281,7 @@ single interval, the interval itself is returned instead.
 a certain value is a member of a given set.  To test if the set @expr{A}
 is a subset of the set @expr{B}, use @samp{vdiff(A, B) = []}.
 
+@kindex v +
 @kindex V +
 @pindex calc-remove-duplicates
 @tindex rdup
@@ -20069,6 +20294,7 @@ necessary.  You rarely need to use @kbd{V +} explicitly, since all the
 other set-based commands apply @kbd{V +} to their inputs before using
 them.
 
+@kindex v V
 @kindex V V
 @pindex calc-set-union
 @tindex vunion
@@ -20078,6 +20304,7 @@ only if it is in either (or both) of the input sets.  (You could
 accomplish the same thing by concatenating the sets with @kbd{|},
 then using @kbd{V +}.)
 
+@kindex v ^
 @kindex V ^
 @pindex calc-set-intersect
 @tindex vint
@@ -20094,6 +20321,7 @@ and
 @texline intersection@tie{}(@math{A \cap B}).
 @infoline intersection.
 
+@kindex v -
 @kindex V -
 @pindex calc-set-difference
 @tindex vdiff
@@ -20108,6 +20336,7 @@ Obviously this is only practical if the set of all possible values in
 your problem is small enough to list in a Calc vector (or simple
 enough to express in a few intervals).
 
+@kindex v X
 @kindex V X
 @pindex calc-set-xor
 @tindex vxor
@@ -20117,6 +20346,7 @@ An object is in the symmetric difference of two sets if and only
 if it is in one, but @emph{not} both, of the sets.  Objects that
 occur in both sets ``cancel out.''
 
+@kindex v ~
 @kindex V ~
 @pindex calc-set-complement
 @tindex vcompl
@@ -20126,6 +20356,7 @@ Thus @samp{vcompl(x)} is equivalent to @samp{vdiff([-inf .. inf], x)}.
 For example, @samp{vcompl([2, (3 .. 4]])} evaluates to
 @samp{[[-inf .. 2), (2 .. 3], (4 .. inf]]}.
 
+@kindex v F
 @kindex V F
 @pindex calc-set-floor
 @tindex vfloor
@@ -20138,6 +20369,7 @@ complement of the set @samp{[2, 6, 7, 8]} is messy, but if you wanted
 the complement with respect to the set of integers you could type
 @kbd{V ~ V F} to get @samp{[[-inf .. 1], [3 .. 5], [9 .. inf]]}.
 
+@kindex v E
 @kindex V E
 @pindex calc-set-enumerate
 @tindex venum
@@ -20147,6 +20379,7 @@ the set are expanded out to lists of all integers encompassed by
 the intervals.  This only works for finite sets (i.e., sets which
 do not involve @samp{-inf} or @samp{inf}).
 
+@kindex v :
 @kindex V :
 @pindex calc-set-span
 @tindex vspan
@@ -20156,6 +20389,7 @@ The lower limit will be the smallest element in the set; the upper
 limit will be the largest element.  For an empty set, @samp{vspan([])}
 returns the empty interval @w{@samp{[0 .. 0)}}.
 
+@kindex v #
 @kindex V #
 @pindex calc-set-cardinality
 @tindex vcard
@@ -20575,6 +20809,7 @@ $$ r_{x\!y} = { \sigma_{x\!y}^2 \over \sigma_x^2 \sigma_y^2 } $$
 The commands in this section allow for more general operations on the
 elements of vectors.
 
+@kindex v A
 @kindex V A
 @pindex calc-apply
 @tindex apply
@@ -20752,6 +20987,7 @@ about it.)
 @subsection Mapping
 
 @noindent
+@kindex v M
 @kindex V M
 @pindex calc-map
 @tindex map
@@ -20848,6 +21084,7 @@ variable's stored value using a @kbd{V M}-like operator.
 @subsection Reducing
 
 @noindent
+@kindex v R
 @kindex V R
 @pindex calc-reduce
 @tindex reduce
@@ -20860,6 +21097,7 @@ the remaining elements.  Reducing @code{max} computes the maximum element
 and so on.  In general, reducing @code{f} over the vector @samp{[a, b, c, d]}
 produces @samp{f(f(f(a, b), c), d)}.
 
+@kindex I v R
 @kindex I V R
 @tindex rreduce
 The @kbd{I V R} [@code{rreduce}] command is similar to @kbd{V R} except
@@ -20869,6 +21107,7 @@ but @kbd{I V R -} on the same vector produces @samp{a - (b - (c - d))},
 or @samp{a - b + c - d}.  This ``alternating sum'' occurs frequently
 in power series expansions.
 
+@kindex v U
 @kindex V U
 @tindex accum
 The @kbd{V U} (@code{calc-accumulate}) [@code{accum}] command does an
@@ -20878,6 +21117,7 @@ a vector of all the intermediate results.  Accumulating @code{+} over
 the vector @samp{[a, b, c, d]} produces the vector
 @samp{[a, a + b, a + b + c, a + b + c + d]}.
 
+@kindex I v U
 @kindex I V U
 @tindex raccum
 The @kbd{I V U} [@code{raccum}] command does a right-to-left accumulation.
@@ -20925,6 +21165,7 @@ rows of the matrix.  @xref{Grabbing From Buffers}.
 @subsection Nesting and Fixed Points
 
 @noindent
+@kindex H v R
 @kindex H V R
 @tindex nest
 The @kbd{H V R} [@code{nest}] command applies a function to a given
@@ -20935,6 +21176,7 @@ is 3, the result is @samp{f(f(f(a)))}.  The number @samp{n} may be
 negative if Calc knows an inverse for the function @samp{f}; for
 example, @samp{nest(sin, a, -2)} returns @samp{arcsin(arcsin(a))}.
 
+@kindex H v U
 @kindex H V U
 @tindex anest
 The @kbd{H V U} [@code{anest}] command is an accumulating version of
@@ -20943,6 +21185,7 @@ The @kbd{H V U} [@code{anest}] command is an accumulating version of
 @samp{F} is the inverse of @samp{f}, then the result is of the
 form @samp{[a, F(a), F(F(a)), F(F(F(a)))]}.
 
+@kindex H I v R
 @kindex H I V R
 @tindex fixp
 @cindex Fixed points
@@ -20951,6 +21194,7 @@ that it takes only an @samp{a} value from the stack; the function is
 applied until it reaches a ``fixed point,'' i.e., until the result
 no longer changes.
 
+@kindex H I v U
 @kindex H I V U
 @tindex afixp
 The @kbd{H I V U} [@code{afixp}] command is an accumulating @code{fixp}.
@@ -21000,6 +21244,7 @@ when 20 steps have been taken, whichever is sooner.
 @node Generalized Products,  , Nesting and Fixed Points, Reducing and Mapping
 @subsection Generalized Products
 
+@kindex v O
 @kindex V O
 @pindex calc-outer-product
 @tindex outer
@@ -21011,6 +21256,7 @@ and @samp{[x, y, z]} on the stack produces a multiplication table:
 the result matrix is obtained by applying the operator to element @var{r}
 of the lefthand vector and element @var{c} of the righthand vector.
 
+@kindex v I
 @kindex V I
 @pindex calc-inner-product
 @tindex inner
@@ -21043,10 +21289,13 @@ in the same way (@pxref{Display Modes}).  Matrix display is also
 influenced by the @kbd{d O} (@code{calc-flat-language}) mode;
 @pxref{Normal Language Modes}.
 
+@kindex v <
 @kindex V <
 @pindex calc-matrix-left-justify
+@kindex v =
 @kindex V =
 @pindex calc-matrix-center-justify
+@kindex v >
 @kindex V >
 @pindex calc-matrix-right-justify
 The commands @kbd{v <} (@code{calc-matrix-left-justify}), @kbd{v >}
@@ -21054,10 +21303,13 @@ The commands @kbd{v <} (@code{calc-matrix-left-justify}), @kbd{v >}
 (@code{calc-matrix-center-justify}) control whether matrix elements
 are justified to the left, right, or center of their columns.
 
+@kindex v [
 @kindex V [
 @pindex calc-vector-brackets
+@kindex v @{
 @kindex V @{
 @pindex calc-vector-braces
+@kindex v (
 @kindex V (
 @pindex calc-vector-parens
 The @kbd{v [} (@code{calc-vector-brackets}) command turns the square
@@ -21072,15 +21324,21 @@ display mode, either brackets or braces may be used to enter vectors,
 and parentheses may never be used for this purpose.
 
 @kindex V ]
+@kindex v ]
+@kindex V )
+@kindex v )
+@kindex V @}
+@kindex v @}
 @pindex calc-matrix-brackets
 The @kbd{v ]} (@code{calc-matrix-brackets}) command controls the
-``big'' style display of matrices.  It prompts for a string of code
-letters; currently implemented letters are @code{R}, which enables
-brackets on each row of the matrix; @code{O}, which enables outer
-brackets in opposite corners of the matrix; and @code{C}, which
-enables commas or semicolons at the ends of all rows but the last.
-The default format is @samp{RO}.  (Before Calc 2.00, the format
-was fixed at @samp{ROC}.)  Here are some example matrices:
+``big'' style display of matrices, for matrices which have more than
+one row.  It prompts for a string of code letters; currently
+implemented letters are @code{R}, which enables brackets on each row
+of the matrix; @code{O}, which enables outer brackets in opposite
+corners of the matrix; and @code{C}, which enables commas or
+semicolons at the ends of all rows but the last.  The default format
+is @samp{RO}.  (Before Calc 2.00, the format was fixed at @samp{ROC}.)
+Here are some example matrices:
 
 @example
 @group
@@ -21119,6 +21377,7 @@ Note that of the formats shown here, @samp{RO}, @samp{ROC}, and
 @samp{OC} are all recognized as matrices during reading, while
 the others are useful for display only.
 
+@kindex v ,
 @kindex V ,
 @pindex calc-vector-commas
 The @kbd{v ,} (@code{calc-vector-commas}) command turns commas on and
@@ -21134,6 +21393,7 @@ case as @samp{[(a b)]}.  You can disable these extra parentheses
 ambiguity) by adding the letter @code{P} to the control string you
 give to @kbd{v ]} (as described above).
 
+@kindex v .
 @kindex V .
 @pindex calc-full-vectors
 The @kbd{v .} (@code{calc-full-vectors}) command turns abbreviated
@@ -21155,6 +21415,7 @@ unable to recover those vectors.  If you are working with very
 large vectors, this mode will improve the speed of all operations
 that involve the trail.
 
+@kindex v /
 @kindex V /
 @pindex calc-break-vectors
 The @kbd{v /} (@code{calc-break-vectors}) command turns multi-line
@@ -21814,24 +22075,33 @@ formula using algebraic entry, then multiplies both sides of the
 selected quotient or equation by that formula.  It simplifies each
 side with @kbd{a s} (@code{calc-simplify}) before re-forming the
 quotient or equation.  You can suppress this simplification by
-providing any numeric prefix argument.  There is also a @kbd{j /}
+providing a prefix argument: @kbd{C-u j *}.  There is also a @kbd{j /}
 (@code{calc-sel-div-both-sides}) which is similar to @kbd{j *} but
 dividing instead of multiplying by the factor you enter.
 
-As a special feature, if the numerator of the quotient is 1, then
-the denominator is expanded at the top level using the distributive
-law (i.e., using the @kbd{C-u -1 a x} command).  Suppose the
-formula on the stack is @samp{1 / (sqrt(a) + 1)}, and you wish
-to eliminate the square root in the denominator by multiplying both
-sides by @samp{sqrt(a) - 1}.  Calc's default simplifications would
-change the result @samp{(sqrt(a) - 1) / (sqrt(a) - 1) (sqrt(a) + 1)}
-right back to the original form by cancellation; Calc expands the
-denominator to @samp{sqrt(a) (sqrt(a) - 1) + sqrt(a) - 1} to prevent
-this.  (You would now want to use an @kbd{a x} command to expand
-the rest of the way, whereupon the denominator would cancel out to
-the desired form, @samp{a - 1}.)  When the numerator is not 1, this
-initial expansion is not necessary because Calc's default
-simplifications will not notice the potential cancellation.
+If the selection is a quotient with numerator 1, then Calc's default
+simplifications would normally cancel the new factors.  To prevent
+this, when the @kbd{j *} command is used on a selection whose numerator is
+1 or -1, the denominator is expanded at the top level using the
+distributive law (as if using the @kbd{C-u 1 a x} command).  Suppose the
+formula on the stack is @samp{1 / (a + 1)} and you wish to multiplying the
+top and bottom by @samp{a - 1}.  Calc's default simplifications would
+normally change the result @samp{(a - 1) /(a + 1) (a - 1)} back
+to the original form by cancellation; when @kbd{j *} is used, Calc
+expands the denominator to  @samp{a (a - 1) + a - 1} to prevent this.
+
+If you wish the @kbd{j *} command to completely expand the denominator
+of a quotient you can call it with a zero prefix: @kbd{C-u 0 j *}.  For
+example, if the formula on the stack is @samp{1 / (sqrt(a) + 1)}, you may
+wish to eliminate the square root in the denominator by multiplying
+the top and bottom by @samp{sqrt(a) - 1}.  If you did this simply by using
+a simple @kbd{j *} command, you would get 
+@samp{(sqrt(a)-1)/ (sqrt(a) (sqrt(a) - 1) + sqrt(a) - 1)}.  Instead,
+you would probably want to use @kbd{C-u 0 j *}, which would expand the
+bottom and give you the desired result @samp{(sqrt(a)-1)/(a-1)}.  More
+generally, if @kbd{j *} is called with an argument of a positive
+integer @var{n}, then the denominator of the expression will be
+expanded @var{n} times (as if with the @kbd{C-u @var{n} a x} command).
 
 If the selection is an inequality, @kbd{j *} and @kbd{j /} will
 accept any factor, but will warn unless they can prove the factor
@@ -22063,6 +22333,8 @@ turn the default simplifications off first (with @kbd{m O}).
 
 @noindent
 @kindex a s
+@kindex I a s
+@kindex H a s
 @pindex calc-simplify
 @tindex simplify
 The @kbd{a s} (@code{calc-simplify}) [@code{simplify}] command applies
@@ -22086,6 +22358,23 @@ and rewrite rules.  @xref{Rearranging with Selections}.
 simplification occurs automatically.  Normally only the ``default
 simplifications'' occur.
 
+There are some simplifications that, while sometimes useful, are never
+done automatically.  For example, the @kbd{I} prefix can be given to
+@kbd{a s}; the @kbd{I a s} command will change any trigonometric
+function to the appropriate combination of @samp{sin}s and @samp{cos}s
+before simplifying.  This can be useful in simplifying even mildly
+complicated trigonometric expressions.  For example, while @kbd{a s}
+can reduce @samp{sin(x) csc(x)} to @samp{1}, it will not simplify
+@samp{sin(x)^2 csc(x)}.  The command @kbd{I a s} can be used to
+simplify this latter expression; it will transform @samp{sin(x)^2
+csc(x)} into @samp{sin(x)}.  However, @kbd{I a s} will also perform
+some ``simplifications'' which may not be desired; for example, it
+will transform @samp{tan(x)^2} into @samp{sin(x)^2 / cos(x)^2}.  The
+Hyperbolic prefix @kbd{H} can be used similarly; the @kbd{H a s} will
+replace any hyperbolic functions in the formula with the appropriate
+combinations of @samp{sinh}s and @samp{cosh}s before simplifying.
+
+
 @menu
 * Default Simplifications::
 * Algebraic Simplifications::
@@ -27783,7 +28072,11 @@ typing @kbd{u d rod} defines the new unit @samp{rod} to be equivalent to
 16.5 feet.  The unit conversion and simplification commands will now
 treat @code{rod} just like any other unit of length.  You will also be
 prompted for an optional English description of the unit, which will
-appear in the Units Table.
+appear in the Units Table.  If you wish the definition of this unit to
+be displayed in a special way in the Units Table buffer (such as with an
+asterisk to indicate an approximate value), then you can call this
+command with an argument, @kbd{C-u u d}; you will then also be prompted
+for a string that will be used to display the definition.
 
 @kindex u u
 @pindex calc-undefine-unit
@@ -28087,8 +28380,7 @@ latter will produce an error message.
 
 @kindex r 0-9
 The @kbd{r} prefix may be followed by a digit, so that @kbd{r 9} is
-equivalent to @kbd{s r 9}.  (The @kbd{r} prefix is otherwise unused
-in the current version of Calc.)
+equivalent to @kbd{s r 9}.
 
 @node Operations on Variables, Let Command, Recalling Variables, Store and Recall
 @section Other Operations on Variables
@@ -28427,14 +28719,15 @@ However, it is free software.   It can be obtained from
 
 @vindex calc-gnuplot-name
 If you have GNUPLOT installed on your system but Calc is unable to
-find it, you may need to set the @code{calc-gnuplot-name} variable
-in your Calc init file or @file{.emacs}.  You may also need to set some Lisp
-variables to show Calc how to run GNUPLOT on your system; these
-are described under @kbd{g D} and @kbd{g O} below.  If you are
-using the X window system, Calc will configure GNUPLOT for you
-automatically.  If you have GNUPLOT 3.0 or later and you are not using X,
-Calc will configure GNUPLOT to display graphs using simple character
-graphics that will work on any terminal.
+find it, you may need to set the @code{calc-gnuplot-name} variable in
+your Calc init file or @file{.emacs}.  You may also need to set some
+Lisp variables to show Calc how to run GNUPLOT on your system; these
+are described under @kbd{g D} and @kbd{g O} below.  If you are using
+the X window system or MS-Windows, Calc will configure GNUPLOT for you
+automatically.  If you have GNUPLOT 3.0 or later and you are using a
+Unix or GNU system without X, Calc will configure GNUPLOT to display
+graphs using simple character graphics that will work on any
+Posix-compatible terminal.
 
 @menu
 * Basic Graphics::
@@ -28941,9 +29234,10 @@ not override it with a plain @kbd{g D} command.  If you enter a
 blank line this command shows you the current default.  The special
 name @code{default} signifies that Calc should choose @code{x11} if
 the X window system is in use (as indicated by the presence of a
-@code{DISPLAY} environment variable), or otherwise @code{dumb} under
-GNUPLOT 3.0 and later, or @code{postscript} under GNUPLOT 2.0.
-This is the initial default value.
+@code{DISPLAY} environment variable), @code{windows} on MS-Windows, or
+otherwise @code{dumb} under GNUPLOT 3.0 and later, or
+@code{postscript} under GNUPLOT 2.0.  This is the initial default
+value.
 
 The @code{dumb} device is an interface to ``dumb terminals,'' i.e.,
 terminals with no special graphics facilities.  It writes a crude
@@ -28975,14 +29269,14 @@ plot on any text-only printer.
 
 @kindex g O
 @pindex calc-graph-output
-The @kbd{g O} (@code{calc-graph-output}) command sets the name of
-the output file used by GNUPLOT.  For some devices, notably @code{x11},
-there is no output file and this information is not used.  Many other
-``devices'' are really file formats like @code{postscript}; in these
-cases the output in the desired format goes into the file you name
-with @kbd{g O}.  Type @kbd{g O stdout @key{RET}} to set GNUPLOT to write
-to its standard output stream, i.e., to @samp{*Gnuplot Trail*}.
-This is the default setting.
+The @kbd{g O} (@code{calc-graph-output}) command sets the name of the
+output file used by GNUPLOT.  For some devices, notably @code{x11} and
+@code{windows}, there is no output file and this information is not
+used.  Many other ``devices'' are really file formats like
+@code{postscript}; in these cases the output in the desired format
+goes into the file you name with @kbd{g O}.  Type @kbd{g O stdout
+@key{RET}} to set GNUPLOT to write to its standard output stream,
+i.e., to @samp{*Gnuplot Trail*}.  This is the default setting.
 
 Another special output name is @code{tty}, which means that GNUPLOT
 is going to write graphics commands directly to its standard output,
@@ -29044,14 +29338,21 @@ command for specifying the position and size of the X window.
 The normal value is @code{default}, which generally means your
 window manager will let you place the window interactively.
 Entering @samp{800x500+0+0} would create an 800-by-500 pixel
-window in the upper-left corner of the screen.
+window in the upper-left corner of the screen.  This command has no
+effect if the current device is @code{windows}.
 
 The buffer called @samp{*Gnuplot Trail*} holds a transcript of the
 session with GNUPLOT.  This shows the commands Calc has ``typed'' to
 GNUPLOT and the responses it has received.  Calc tries to notice when an
 error message has appeared here and display the buffer for you when
 this happens.  You can check this buffer yourself if you suspect
-something has gone wrong.
+something has gone wrong@footnote{
+On MS-Windows, due to the peculiarities of how the Windows version of
+GNUPLOT (called @command{wgnuplot}) works, the GNUPLOT responses are
+not communicated back to Calc.  Instead, you need to look them up in
+the GNUPLOT command window that is displayed as in normal interactive
+usage of GNUPLOT.
+}.
 
 @kindex g C
 @pindex calc-graph-command
@@ -29071,7 +29372,9 @@ and @samp{*Gnuplot Trail*} buffers, respectively, in another window.
 This happens automatically when Calc thinks there is something you
 will want to see in either of these buffers.  If you type @kbd{g v}
 or @kbd{g V} when the relevant buffer is already displayed, the
-buffer is hidden again.
+buffer is hidden again.  (Note that on MS-Windows, the @samp{*Gnuplot
+Trail*} buffer will usually show nothing of interest, because
+GNUPLOT's responses are not communicated back to Calc.)
 
 One reason to use @kbd{g v} is to add your own commands to the
 @samp{*Gnuplot Commands*} buffer.  Press @kbd{g v}, then use
@@ -29119,6 +29422,8 @@ work with Calc from a regular editing buffer.  @xref{Embedded Mode}.
 @menu
 * Killing From Stack::
 * Yanking Into Stack::
+* Saving Into Registers::
+* Inserting From Registers::
 * Grabbing From Buffers::
 * Yanking Into Buffers::
 * X Cut and Paste::
@@ -29136,24 +29441,28 @@ work with Calc from a regular editing buffer.  @xref{Embedded Mode}.
 @pindex calc-kill-region
 @kindex M-w
 @pindex calc-copy-region-as-kill
+@kindex M-C-w
 @cindex Kill ring
-@dfn{Kill} commands are Emacs commands that insert text into the
-``kill ring,'' from which it can later be ``yanked'' by a @kbd{C-y}
-command.  Three common kill commands in normal Emacs are @kbd{C-k}, which
-kills one line, @kbd{C-w}, which kills the region between mark and point,
-and @kbd{M-w}, which puts the region into the kill ring without actually
-deleting it.  All of these commands work in the Calculator, too.  Also,
-@kbd{M-k} has been provided to complete the set; it puts the current line
-into the kill ring without deleting anything.
+@dfn{Kill} commands are Emacs commands that insert text into the ``kill
+ring,'' from which it can later be ``yanked'' by a @kbd{C-y} command.
+Three common kill commands in normal Emacs are @kbd{C-k}, which kills
+one line, @kbd{C-w}, which kills the region between mark and point, and
+@kbd{M-w}, which puts the region into the kill ring without actually
+deleting it.  All of these commands work in the Calculator, too,
+although in the Calculator they operate on whole stack entries, so they
+``round up'' the specified region to encompass full lines.  (To copy
+only parts of lines, the @kbd{M-C-w} command in the Calculator will copy
+the region to the kill ring without any ``rounding up'', just like the
+@kbd{M-w} command in normal Emacs.)  Also, @kbd{M-k} has been provided
+to complete the set; it puts the current line into the kill ring without
+deleting anything.
 
 The kill commands are unusual in that they pay attention to the location
-of the cursor in the Calculator buffer.  If the cursor is on or below the
-bottom line, the kill commands operate on the top of the stack.  Otherwise,
-they operate on whatever stack element the cursor is on.  Calc's kill
-commands always operate on whole stack entries.  (They act the same as their
-standard Emacs cousins except they ``round up'' the specified region to
-encompass full lines.)  The text is copied into the kill ring exactly as
-it appears on the screen, including line numbers if they are enabled.
+of the cursor in the Calculator buffer.  If the cursor is on or below
+the bottom line, the kill commands operate on the top of the stack.
+Otherwise, they operate on whatever stack element the cursor is on.  The
+text is copied into the kill ring exactly as it appears on the screen,
+including line numbers if they are enabled.
 
 A numeric prefix argument to @kbd{C-k} or @kbd{M-k} affects the number
 of lines killed.  A positive argument kills the current line and @expr{n-1}
@@ -29164,7 +29473,7 @@ with no argument copies only the number itself into the kill ring, whereas
 @kbd{C-k} with a prefix argument of 1 copies the number with its trailing
 newline.
 
-@node Yanking Into Stack, Grabbing From Buffers, Killing From Stack, Kill and Yank
+@node Yanking Into Stack, Saving Into Registers, Killing From Stack, Kill and Yank
 @section Yanking into the Stack
 
 @noindent
@@ -29183,7 +29492,53 @@ number in its displayed form, 3.142.  (Since the default display modes
 show all objects to their full precision, this feature normally makes no
 difference.)
 
-@node Grabbing From Buffers, Yanking Into Buffers, Yanking Into Stack, Kill and Yank
+@node Saving Into Registers, Inserting From Registers, Yanking Into Stack, Kill and Yank
+@section Saving into Registers
+
+@noindent
+@kindex r s
+@pindex calc-copy-to-register
+@pindex calc-prepend-to-register
+@pindex calc-append-to-register
+@cindex Registers
+An alternative to killing and yanking stack entries is using 
+registers in Calc.  Saving stack entries in registers is like
+saving text in normal Emacs registers; although, like Calc's kill
+commands, register commands always operate on whole stack
+entries.
+
+Registers in Calc are places to store stack entries for later use;
+each register is indexed by a single character.  To store the current
+region (rounded up, of course, to include full stack entries) into a
+register, use the command @kbd{r s} (@code{calc-copy-to-register}).
+You will then be prompted for a register to use, the next character
+you type will be the index for the register.  To store the region in
+register @var{r}, the full command will be @kbd{r s @var{r}}.  With an
+argument, @kbd{C-u r s @var{r}}, the region being copied to the
+register will be deleted from the Calc buffer.
+
+It is possible to add additional stack entries to a register.  The
+command @kbd{M-x calc-append-to-register} will prompt for a register,
+then add the stack entries in the region to the end of the register
+contents. The command @kbd{M-x calc-prepend-to-register} will
+similarly prompt for a register and add  the stack entries in the
+region to the beginning of the register contents.  Both commands take
+@kbd{C-u} arguments, which will cause the region to be deleted after being
+added to the register.
+
+@node Inserting From Registers, Grabbing From Buffers, Saving Into Registers, Kill and Yank
+@section Inserting from Registers
+@noindent
+@kindex r i
+@pindex calc-insert-register
+The command @kbd{r i} (@code{calc-insert-register}) will prompt for a
+register, then insert the contents of that register into the
+Calculator.  If the contents of the register were placed there from
+within Calc, then the full internal structure of the contents will be
+inserted into the Calculator, otherwise whatever text is in the
+register is reparsed and then inserted into the Calculator.
+
+@node Grabbing From Buffers, Yanking Into Buffers, Inserting From Registers, Kill and Yank
 @section Grabbing from Other Buffers
 
 @noindent
@@ -29440,7 +29795,7 @@ original buffer.
 
 @smallexample
 @group
-|----+-----Calc 2.1------+----1
+|----+----+--Calc---+----+----1
 |FLR |CEIL|RND |TRNC|CLN2|FLT |
 |----+----+----+----+----+----|
 | LN |EXP |    |ABS |IDIV|MOD |
@@ -30599,11 +30954,10 @@ other one, except it now uses @samp{\'} (``end-of-buffer'') and
 of describing a blank line that is more appropriate for this
 case).
 
-@vindex calc-embedded-open-word
-@vindex calc-embedded-close-word
-The @code{calc-embedded-open-word} and @code{calc-embedded-close-word}
-variables are similar expressions used when you type @kbd{C-x * w}
-instead of @kbd{C-x * e} to enable Embedded mode.
+@vindex calc-embedded-word-regexp
+The @code{calc-embedded-word-regexp} variable holds a regular expression
+used to define an expression to look for (a ``word'') when you type
+@kbd{C-x * w} to enable Embedded mode.
 
 @vindex calc-embedded-open-plain
 The @code{calc-embedded-open-plain} variable is a string which
@@ -31614,7 +31968,7 @@ the function with code that looks roughly like this:
 @smallexample
 (let ((calc-command-flags nil))
   (unwind-protect
-      (save-excursion
+      (save-current-buffer
         (calc-select-buffer)
         @emph{body of function}
         @emph{renumber stack}
@@ -34701,7 +35055,7 @@ and @code{calc-embedded-open-close-mode-alist}.
 @defvarx calc-embedded-open-close-formula-alist
 See @ref{Customizing Embedded Mode}.@*
 The variables @code{calc-embedded-open-formula} and
-@code{calc-embedded-open-formula} control the region that Calc will
+@code{calc-embedded-close-formula} control the region that Calc will
 activate as a formula when Embedded mode is entered with @kbd{C-x * e}.
 They are regular expressions; 
 Calc normally scans backward and forward in the buffer for the
@@ -34734,26 +35088,21 @@ It consists of a list of lists of the form
 @code{nil}.
 @end defvar
 
-@defvar  calc-embedded-open-word
-@defvarx calc-embedded-close-word
-@defvarx calc-embedded-open-close-word-alist
+@defvar  calc-embedded-word-regexp
+@defvarx calc-embedded-word-regexp-alist
 See @ref{Customizing Embedded Mode}.@*
-The variables @code{calc-embedded-open-word} and
-@code{calc-embedded-close-word} control the region that Calc will
-activate when Embedded mode is entered with @kbd{C-x * w}.  They are
-regular expressions.
-
-The default values of @code{calc-embedded-open-word} and
-@code{calc-embedded-close-word} are @code{"^\\|[^-+0-9.eE]"} and 
-@code{"$\\|[^-+0-9.eE]"} respectively.
-
-The variable @code{calc-embedded-open-close-word-alist} is used to
-set @code{calc-embedded-open-word} and
-@code{calc-embedded-close-word} to different regular
-expressions depending on the major mode of the editing buffer.
+The variable @code{calc-embedded-word-regexp} determines the expression
+that Calc will activate when Embedded mode is entered with @kbd{C-x *
+w}.  It is a regular expressions.
+
+The default value of @code{calc-embedded-word-regexp} is
+@code{"[-+]?[0-9]+\\(\\.[0-9]+\\)?\\([eE][-+]?[0-9]+\\)?"}.
+
+The variable @code{calc-embedded-word-regexp-alist} is used to
+set @code{calc-embedded-word-regexp} to a different regular
+expression depending on the major mode of the editing buffer.
 It consists of a list of lists of the form 
-@code{(@var{MAJOR-MODE}  @var{OPEN-WORD-REGEXP}
-@var{CLOSE-WORD-REGEXP})}, and its default value is
+@code{(@var{MAJOR-MODE}  @var{WORD-REGEXP})}, and its default value is
 @code{nil}.
 @end defvar
 
@@ -34882,6 +35231,15 @@ as @samp{a/(b*c)}. If @code{calc-multiplication-has-precedence} is
 of @code{calc-multiplication-has-precedence} is @code{t}.
 @end defvar
 
+@defvar calc-undo-length
+The variable @code{calc-undo-length} determines the number of undo
+steps that Calc will keep track of when @code{calc-quit} is called.
+If @code{calc-undo-length} is a non-negative integer, then this is the
+number of undo steps that will be preserved; if
+@code{calc-undo-length} has any other value, then all undo steps will
+be preserved.  The default value of @code{calc-undo-length} is @expr{100}.
+@end defvar
+
 @node Reporting Bugs, Summary, Customizing Calc, Top
 @appendix Reporting Bugs
 
@@ -34911,14 +35269,14 @@ to work on these, please send a message (using @kbd{M-x report-calc-bug})
 so any efforts can be coordinated.
 
 The latest version of Calc is available from Savannah, in the Emacs
-CVS tree.  See @uref{http://savannah.gnu.org/projects/emacs}.
+repository.  See @uref{http://savannah.gnu.org/projects/emacs}.
 
 @c [summary]
 @node Summary, Key Index, Reporting Bugs, Top
 @appendix Calc Summary
 
 @noindent
-This section includes a complete list of Calc 2.1 keystroke commands.
+This section includes a complete list of Calc keystroke commands.
 Each line lists the stack entries used by the command (top-of-stack
 last), the keystrokes themselves, the prompts asked by the command,
 and the result of the command (also with top-of-stack last).
@@ -35031,14 +35389,14 @@ keystrokes are not listed in this summary.
 @r{      a@:      M-%   @:             @:        @:percent@:(a)  a%}
 
 @c
-@r{  ... a@:      @key{RET}   @:             @:     1  @:@:... a a}
-@r{  ... a@:      @key{SPC}   @:             @:     1  @:@:... a a}
-@r{... a b@:      @key{TAB}   @:             @:     3  @:@:... b a}
-@r{. a b c@:      M-@key{TAB} @:             @:     3  @:@:... b c a}
-@r{... a b@:      @key{LFD}   @:             @:     1  @:@:... a b a}
-@r{  ... a@:      @key{DEL}   @:             @:     1  @:@:...}
-@r{... a b@:      M-@key{DEL} @:             @:     1  @:@:... b}
-@r{       @:      M-@key{RET} @:             @:     4  @:calc-last-args@:}
+@r{  ... a@:      @summarykey{RET}   @:             @:     1  @:@:... a a}
+@r{  ... a@:      @summarykey{SPC}   @:             @:     1  @:@:... a a}
+@r{... a b@:      @summarykey{TAB}   @:             @:     3  @:@:... b a}
+@r{. a b c@:      M-@summarykey{TAB} @:             @:     3  @:@:... b c a}
+@r{... a b@:      @summarykey{LFD}   @:             @:     1  @:@:... a b a}
+@r{  ... a@:      @summarykey{DEL}   @:             @:     1  @:@:...}
+@r{... a b@:      M-@summarykey{DEL} @:             @:     1  @:@:... b}
+@r{       @:      M-@summarykey{RET} @:             @:     4  @:calc-last-args@:}
 @r{      a@:      `     @:editing      @:  1,30  @:calc-edit@:}
 
 @c
@@ -35270,8 +35628,8 @@ keystrokes are not listed in this summary.
 @r{       @:      d [   @:             @:     4  @:calc-truncate-up@:}
 @r{       @:      d ]   @:             @:     4  @:calc-truncate-down@:}
 @r{       @:      d "   @:             @: 12,50  @:calc-display-strings@:}
-@r{       @:      d @key{SPC} @:             @:        @:calc-refresh@:}
-@r{       @:      d @key{RET} @:             @:     1  @:calc-refresh-top@:}
+@r{       @:      d @summarykey{SPC} @:             @:        @:calc-refresh@:}
+@r{       @:      d @summarykey{RET} @:             @:     1  @:calc-refresh-top@:}
 
 @c
 @r{       @:      d 0   @:             @:    50  @:calc-decimal-radix@:}
@@ -35408,8 +35766,8 @@ keystrokes are not listed in this summary.
 
 @c
 @r{       @:      j 1-9 @:             @:        @:calc-select-part@:}
-@r{       @:      j @key{RET} @:             @:    27  @:calc-copy-selection@:}
-@r{       @:      j @key{DEL} @:             @:    27  @:calc-del-selection@:}
+@r{       @:      j @summarykey{RET} @:             @:    27  @:calc-copy-selection@:}
+@r{       @:      j @summarykey{DEL} @:             @:    27  @:calc-del-selection@:}
 @r{       @:      j '   @:formula      @:    27  @:calc-enter-selection@:}
 @r{       @:      j `   @:editing      @: 27,30  @:calc-edit-selection@:}
 @r{       @:      j "   @:             @:  7,27  @:calc-sel-expand-formula@:}
@@ -35518,6 +35876,10 @@ keystrokes are not listed in this summary.
 @r{       @:      m S   @:             @:    12  @:calc-shift-prefix@:}
 @r{       @:      m U   @:             @:    12  @:calc-units-simplify-mode@:}
 
+@c
+@r{       @:      r s   @:register     @:    27  @:calc-copy-to-register@:}
+@r{       @:      r i   @:register     @:        @:calc-insert-register@:}
+
 @c
 @r{       @:      s c   @:var1, var2   @:    29  @:calc-copy-variable@:}
 @r{       @:      s d   @:var, decl    @:        @:calc-declare-variable@:}
@@ -35720,6 +36082,7 @@ keystrokes are not listed in this summary.
 @r{    v w@:    H V H   @:n            @:    31  @:histogram@:(v,w,n)}
 @r{  v1 v2@:      V I   @:mop aop      @:    22  @:inner@:(mop,aop,v1,v2)}
 @r{      m@:      V J   @:             @:     1  @:ctrn@:(m)}
+@r{  m1 m2@:      V K   @:             @:        @:kron@:(m1,m2)}
 @r{      m@:      V L   @:             @:     1  @:lud@:(m)}
 @r{      v@:      V M   @:op           @: 22,23  @:map@:(op,v)}
 @r{      v@:      V N   @:             @:     1  @:cnorm@:(v)}