Anonymous avatar Anonymous committed 5c813a1

Baseline 1.0 version of the calc package

Comments (0)

Files changed (53)

+_pkg.el
+auto-autoloads.el
+calc.info
+calc.info-1
+calc.info-10
+calc.info-11
+calc.info-12
+calc.info-13
+calc.info-14
+calc.info-15
+calc.info-16
+calc.info-17
+calc.info-18
+calc.info-19
+calc.info-2
+calc.info-20
+calc.info-21
+calc.info-22
+calc.info-23
+calc.info-24
+calc.info-25
+calc.info-26
+calc.info-27
+calc.info-28
+calc.info-29
+calc.info-3
+calc.info-30
+calc.info-31
+calc.info-32
+calc.info-33
+calc.info-34
+calc.info-4
+calc.info-5
+calc.info-6
+calc.info-7
+calc.info-8
+calc.info-9
+calccard.dvi
+calccard.log
+1998-02-10  Jens-Ulrik Holger Petersen  <petersen@kurims.kyoto-u.ac.jp>
+
+	* calc.el (calcDigit-backspace): Use `?\r'.
+
+	* calc-aent.el (calc-do-quick-calc): Use `?\n'.
+	(calcAlg-blink-matching-open): Use `char-int'.
+
+	* calc-incom.el (calc-digit-dots): Use `? '.
+
+	* calc-keypd.el (calc-keypad-press): Use `?\r' and `?\a'.
+
+1998-02-06  SL Baur  <steve@altair.xemacs.org>
+
+	* calc.el (calcDigit-nondigit): Deebolify.
+
+1998-02-03  Karl M. Hegbloom  <karlheg@bittersweet.inetarena.com>
+
+	* calc.texinfo (Top): Warning: The command `@ichapter' is
+ 	obsolete; use `@chapter' instead. Fixed.
+
+
+
+Installation
+************
+
+Calc 2.02 comes as a set of GNU Emacs Lisp files, with names like
+`calc.el' and `calc-ext.el', and also as a `calc.texinfo' file which
+can be used to generate both on-line and printed documentation.
+
+   To install Calc, just follow these simple steps.  If you want more
+information, each step is discussed at length in the sections below.
+
+  1. Change (`cd') to the Calc "home" directory.  This directory was
+     created when you unbundled the Calc `.tar' or `.shar' file.
+
+  2. Type `make' to install Calc privately for your own use, or type
+     `make install' to install Calc system-wide.  This will compile all
+     the Calc component files, modify your `.emacs' or the system-wide
+     `lisp/default' file to install Calc as appropriate, and format
+     the on-line Calc manual.
+
+     Both variants are shorthand for the following three steps:
+
+        * `make compile' to run the byte-compiler.
+
+        * `make private' or `make public', corresponding to `make' and
+          `make install', respectively.  (If `make public' fails
+          because your system doesn't already have a `default' or
+          `default.el' file, use Emacs or the Unix `touch' command to
+          create a zero-sized one first.)
+
+        * `make info' to format the on-line Calc manual.  This first
+          tries to use the `makeinfo' program; if that program is not
+          present, it uses the Emacs `texinfo-format-buffer' command
+          instead.
+
+          The Unix `make' utility looks in the file `Makefile' in the
+     current directory to see what Unix commands correspond to the
+     various "targets" like `install' or `public'.  If your system
+     doesn't have `make', you will have to examine the `Makefile' and
+     type in the corresponding commands by hand.
+
+  3. If you ever move Calc to a new home directory, just give the
+     `make private' or `make public' command again in the new
+     directory.
+
+  4. Test your installation as described at the end of these
+     instructions.
+
+  5. (Optional.)  To print a hardcopy of the Calc manual (over 500
+     pages) or just the Calc Summary (about 20 pages), follow the
+     instructions under "Printed Documentation" below.
+
+Calc is now installed and ready to go!
+
+
+Upgrading from Calc 1.07
+=========================
+
+If you have Calc version 1.07 or earlier, you will find that Calc 2.00
+is organized quite differently.  For one, Calc 2.00 is now distributed
+already split into many parts; formerly this was done as part of the
+installation procedure.  Also, some new functions must be autoloaded
+and the `M-#' key must be bound to `calc-dispatch' instead of to
+`calc'.
+
+   The easiest way to upgrade is to delete your old Calc files and then
+install Calc 2.00 from scratch using the above instructions.  You
+should then go into your `.emacs' or `default' file and remove the old
+`autoload' and `global-set-key' commands for Calc, since `make
+public'/`make private' has added new, better ones.
+
+   See the `README' and `README.prev' files in the Calc distribution
+for more information about what has changed since version 1.07. 
+(`README.prev' describes changes before 2.00, and is present only in
+the FTP and tape versions of the distribution.)
+
+
+The `make public' Command
+==========================
+
+If you are not the regular Emacs administrator on your system, your
+account may not be allowed to execute the `make public' command, since
+the system-wide `default' file may be write-protected.  If this is the
+case, you will have to ask your Emacs installer to execute this
+command.  (Just `cd' to the Calc home directory and type `make
+public'.)
+
+   The `make private' command adds exactly the same set of commands to
+your `.emacs' file as `make public' adds to `default'.  If your Emacs
+installer is concerned about typing this command out of the blue, you
+can ask her/him instead to copy the necessary text from your `.emacs'
+file.  (It will be marked by a comment that says "Commands added by
+`calc-private-autoloads' on (date and time).")
+
+
+Compilation
+============
+
+Calc is written in a way that maximizes performance when its code has
+been byte-compiled; a side effect is that performance is seriously
+degraded if it *isn't* compiled.  Thus, it is essential to compile the
+Calculator before trying to use it.  The function `calc-compile' in
+the file `calc-maint.el' runs the Emacs byte-compiler on all the Calc
+source files.  (Specifically, it runs `M-x byte-compile-file' on all
+files in the current directory with names of the form `calc*.el', and
+also on the file `macedit.el'.)
+
+   If `calc-compile' finds that certain files have already been
+compiled and have not been changed since, then it will not bother to
+recompile those files.
+
+   The `calc-compile' command also pre-builds certain tables, such as
+the units table (see "The Units Table") and the built-in rewrite
+rules (see "Rearranging with Selections") which Calc would otherwise
+need to rebuild every time those features were used.
+
+   The `make compile' shell command is simply a convenient way to
+start an Emacs and give it a `calc-compile' command.
+
+
+Auto-loading
+=============
+
+To teach Emacs how to load in Calc when you type `M-#' for the first
+time, add these lines to your `.emacs' file (if you are installing
+Calc just for your own use), or the system's `lisp/default' file (if
+you are installing Calc publicly).  The `make private' and `make
+public' commands, respectively, take care of this.  (Note that `make'
+runs `make private', and `make install' runs `make public'.)
+
+     (autoload 'calc-dispatch          "calc" "Calculator Options" t)
+     (autoload 'full-calc              "calc" "Full-screen Calculator" t)
+     (autoload 'full-calc-keypad       "calc" "Full-screen X Calculator" t)
+     (autoload 'calc-eval              "calc" "Use Calculator from Lisp")
+     (autoload 'defmath                "calc" nil t t)
+     (autoload 'calc                   "calc" "Calculator Mode" t)
+     (autoload 'quick-calc             "calc" "Quick Calculator" t)
+     (autoload 'calc-keypad            "calc" "X windows Calculator" t)
+     (autoload 'calc-embedded          "calc" "Use Calc from any buffer" t)
+     (autoload 'calc-embedded-activate "calc" "Activate =>'s in buffer" t)
+     (autoload 'calc-grab-region       "calc" "Grab region of Calc data" t)
+     (autoload 'calc-grab-rectangle    "calc" "Grab rectangle of data" t)
+
+   Unless you have installed the Calc files in Emacs' main `lisp/'
+directory, you will also have to add a command that looks like the
+following to tell Emacs where to find them.  In this example, we have
+put the files in directory `/usr/gnu/src/calc-2.00'.
+
+     (setq load-path (append load-path (list "/usr/gnu/src/calc-2.00")))
+
+The `make public' and `make private' commands also do this (they use
+the then-current directory as the name to add to the path).  If you
+move Calc to a new location, just repeat the `make public' or `make
+private' command to have this new location added to the `load-path'.
+
+   The `autoload' command for `calc-dispatch' is what loads `calc.elc'
+when you type `M-#'.  It is the only `autoload' that is absolutely
+necessary for Calc to work.  The others are for commands and features
+that you may wish to use before typing `M-#' for the first time.  In
+particular, `full-calc' and `full-calc-keypad' are autoloaded to
+support "standalone" operation (see "Standalone Operation"),
+`calc-eval' and `defmath' are autoloaded to allow other Emacs Lisp
+programs to use Calc facilities (see "Calling Calc from Your
+Programs"), and `calc-embedded-activate' is autoloaded because some
+Embedded Mode files may call it as soon as they are read into Emacs
+(see "Assignments in Embedded Mode").
+
+
+Finding Component Files
+========================
+
+There is no need to write `autoload' commands that point to all the
+various Calc component files like `calc-misc.elc' and `calc-alg.elc'. 
+The main file, `calc.elc', contains all the necessary `autoload'
+commands for these files.
+
+   (Actually, to conserve space `calc.elc' only autoloads a few of the
+component files, plus `calc-ext.elc', which in turn autoloads the rest
+of the components.  This allows Calc to load a little faster in the
+beginning, but the net effect is the same.)
+
+   This autoloading mechanism assumes that all the component files can
+be found on the `load-path'.  The `make public' and `make private'
+commands take care of this, but Calc has a few other strategies in
+case you have installed it in an unusual way.
+
+   If, when Calc is loaded, it is unable to find its components on the
+`load-path' it is given, it checks the file name in the original
+`autoload' command for `calc-dispatch'.  If that name included
+directory information, Calc adds that directory to the `load-path':
+
+     (autoload 'calc-dispatch "calc-2.00/calc" "Calculator" t)
+
+Suppose the directory `/usr/gnu/src/emacs/lisp' is on the path, and
+the above `autoload' allows Emacs to find Calc under the name
+`/usr/gnu/src/emacs/lisp/calc-2.00/calc.elc'.  Then when Calc starts
+up it will add `/usr/gnu/src/emacs/lisp/calc-2.00' to the path so that
+it will later be able to find its component files.
+
+   If the above strategy does not locate the component files, Calc
+examines the variable `calc-autoload-directory'.  This is initially
+`nil', but you can store the name of Calc's home directory in it as a
+sure-fire way of getting Calc to find its components.
+
+
+Merging Source Files
+=====================
+
+If the `autoload' mechanism is not managing to load each part of Calc
+when it is needed, you can concatenate all the `.el' files into one
+big file.  The order should be `calc.el', then `calc-ext.el', then all
+the other files in any order.  Byte-compile the resulting big file. 
+This merged Calculator ought to work just like Calc normally does,
+though it will be *substantially* slower to load.
+
+
+Key Bindings
+=============
+
+Calc is normally bound to the `M-#' key.  To set up this key binding,
+include the following command in your `.emacs' or `lisp/default' file.
+ (This is done automatically by `make private' or `make public',
+respectively.)
+
+     (global-set-key "\e#" 'calc-dispatch)
+
+   Note that `calc-dispatch' actually works as a prefix for various
+two-key sequences.  If you have a convenient unused function key on
+your keyboard, you may wish to bind `calc-dispatch' to that as well. 
+You may even wish to bind other specific Calc functions like `calc' or
+`quick-calc' to other handy function keys.
+
+   Even if you bind `calc-dispatch' to other keys, it is best to bind
+it to `M-#' as well if you possibly can:  There are references to
+`M-#' all throughout the Calc manual which would confuse novice users
+if they didn't work as advertised.
+
+   Another key binding issue is the DEL key.  Some installations use a
+different key (such as backspace) for this purpose.  Calc normally
+scans the entire keymap and maps all keys defined like DEL to the
+`calc-pop' command.  However, this may be slow.  You can set the
+variable `calc-scan-for-dels' to `nil' to cause only the actual DEL
+key to be mapped to `calc-pop'; this will speed loading of Calc.
+
+
+The `macedit' Package
+======================
+
+The file `macedit.el' contains another useful Emacs extension called
+`edit-kbd-macro'.  It allows you to edit a keyboard macro in
+human-readable form.  The `Z E' command in Calc knows how to use it to
+edit user commands that have been defined by keyboard macros.  To
+autoload it, you will want to include the commands,
+
+     (autoload 'edit-kbd-macro      "macedit" "Edit Keyboard Macro" t)
+     (autoload 'edit-last-kbd-macro "macedit" "Edit Keyboard Macro" t)
+     (autoload 'read-kbd-macro      "macedit" "Read Keyboard Macro" t)
+
+The `make public' and `make private' commands do this.
+
+
+The GNUPLOT Program
+====================
+
+Calc's graphing commands use the GNUPLOT program.  If you have GNUPLOT
+but you must type some command other than `gnuplot' to get it, you
+should add a command to set the Lisp variable `calc-gnuplot-name' to
+the appropriate file name.  You may also need to change the variables
+`calc-gnuplot-plot-command' and `calc-gnuplot-print-command' in order
+to get correct displays and hardcopies, respectively, of your plots.
+
+
+On-Line Documentation
+======================
+
+The documentation for Calc (this manual) comes in a file called
+`calc.texinfo'.  To format this for use as an on-line manual, type
+`make info' (to use the `makeinfo' program), or `make texinfo' (to use
+the `texinfmt.el' program which runs inside of Emacs).  The former
+command is recommended if it works on your system; it is faster and
+produces nicer-looking output.
+
+   The `makeinfo' program will report inconsistencies involving the
+nodes "Copying" and "Interactive Tutorial"; these messages should be
+ignored.
+
+   The result will be a collection of files whose names begin with
+`calc.info'.  You may wish to add a reference to the first of these,
+`calc.info' itself, to your Info system's `dir' file.  (This is
+optional since the `M-# i' command can access `calc.info' whether or
+not it appears in the `dir' file.)
+
+   There is a Lisp variable called `calc-info-filename' which holds
+the name of the Info file containing Calc's on-line documentation. 
+Its default value is `"calc.info"', which will work correctly if the
+Info files are stored in Emacs' main `info/' directory, or if they are
+in any of the directories listed in the `load-path'.  If you keep them
+elsewhere, you will want to put a command of the form,
+
+     (setq calc-info-filename ".../calc.info")
+
+in your `.emacs' or `lisp/default' file, where `...' represents the
+directory containing the Info files.  This will not be necessary if
+you follow the normal installation procedures.
+
+   The `make info' and `make texinfo' commands compare the dates on
+the files `calc.texinfo' and `calc.info', and run the appropriate
+program only if the latter file is older or does not exist.
+
+
+Printed Documentation
+======================
+
+Because the Calc manual is so large, you should only make a printed
+copy if you really need it.  To print the manual, you will need the
+TeX typesetting program (this is a free program by Donald Knuth at
+Stanford University) as well as the `texindex' program and
+`texinfo.tex' file, both of which can be obtained from the FSF as part
+of the `texinfo2' package.
+
+   To print the Calc manual in one huge 550 page tome, type `make tex'. 
+This will take care of running the manual through TeX twice so that
+references to later parts of the manual will have correct page numbers. 
+(Don't worry if you get some "overfull box" warnings.)
+
+   The result will be a device-independent output file called
+`calc.dvi', which you must print in whatever way is right for your
+system.  On many systems, the command is
+
+     lpr -d calc.dvi
+
+   Marginal notes for each function and key sequence normally alternate
+between the left and right sides of the page, which is correct if the
+manual is going to be bound as double-sided pages.  Near the top of
+the file `calc.texinfo' you will find alternate definitions of the
+`\bumpoddpages' macro that put the marginal notes always on the same
+side, best if you plan to be binding single-sided pages.
+
+   Some people find the Calc manual to be too large to handle easily. 
+In fact, some versions of TeX have too little memory to print it.  So
+Calc includes a `calc-split-manual' command that splits `calc.texinfo'
+into two volumes, the Calc Tutorial and the Calc Reference.  The
+easiest way to use it is to type `make tex2' instead of `make tex'. 
+The result will be two smaller files, `calctut.dvi' and `calcref.dvi'.
+ The former contains the tutorial part of the manual; the latter
+contains the reference part.  Both volumes include copies of the
+"Getting Started" chapter and licensing information.
+
+   To save disk space, you may wish to delete `calctut.*' and
+`calcref.*' after you're done.  Don't delete `calc.texinfo', because
+you will need it to install future patches to Calc.  The `make tex2'
+command takes care of all of this for you.
+
+   The `make textut' command formats only the Calc Tutorial volume,
+producing `calctut.dvi' but not `calcref.dvi'.  Likewise, `make
+texref' formats only the Calc Reference volume.
+
+   Finally, there is a `calc-split-summary' command that splits off
+just the Calc Summary appendix suitable for printing by itself.  Type
+`make summary' instead of `make tex'.  The resulting `calcsum.dvi'
+file will print in less than 20 pages.  If the Key Index file
+`calc.ky' is present, left over from a previous `make tex' command,
+then `make summary' will insert a column of page numbers into the
+summary using that information.
+
+   The `make isummary' command is like `make summary', but it prints a
+summary that is designed to be substituted into the regular manual. 
+(The two summaries will be identical except for the additional column
+of page numbers.)  To make a complete manual, run `make tex' and `make
+isummary', print the two resulting `.dvi' files, then discard the
+Summary pages that came from `calc.dvi' and insert the ones from
+`calcsum.dvi' in their place.  Also, remember that the table of
+contents prints at the end of the manual but should generally be moved
+to the front (after the title and copyright pages).
+
+   If you don't have TeX, you can print the summary as a plain text
+file by going to the "Summary" node in Calc's Info file, then typing
+`M-x print-buffer' (see "Summary").
+
+
+Settings File
+==============
+
+Another variable you might want to set is `calc-settings-file', which
+holds the file name in which commands like `m m' and `Z P' store
+"permanent" definitions.  The default value for this variable is
+`"~/.emacs"'.  If `calc-settings-file' does not contain `".emacs"' as
+a substring, and if the variable `calc-loaded-settings-file' is `nil',
+then Calc will automatically load your settings file (if it exists)
+the first time Calc is invoked.
+
+
+Testing the Installation
+=========================
+
+To test your installation of Calc, start a new Emacs and type `M-# c'
+to make sure the autoloads and key bindings work.  Type `M-# i' to
+make sure Calc can find its Info documentation.  Press `q' to exit the
+Info system and `M-# c' to re-enter the Calculator.  Type `20 S' to
+compute the sine of 20 degrees; this will test the autoloading of the
+extensions modules.  The result should be 0.342020143326.  Finally,
+press `M-# c' again to make sure the Calculator can exit.
+
+   You may also wish to test the GNUPLOT interface; to plot a sine
+wave, type `' [0 .. 360], sin(x) RET g f'.  Type `g q' when you are
+done viewing the plot.
+
+   Calc is now ready to use.  If you wish to go through the Calc
+Tutorial, press `M-# t' to begin.
+
+
+(The above text is included in both the Calc documentation and the
+file INSTALL in the Calc distribution directory.)
+# Makefile for Calc.
+
+# This file is part of XEmacs.
+
+# XEmacs is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2, or (at your option) any
+# later version.
+
+# XEmacs is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with XEmacs; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+VERSION = 1.01
+AUTHOR_VERSION = 2.02f
+MAINTAINER = XEmacs Development Team <xemacs-beta@xemacs.org>
+PACKAGE = calc
+PKG_TYPE = regular
+REQUIRES =
+CATEGORY = oa
+
+ELCS = calc-macs.elc calc.elc calc-aent.elc calc-alg-2.elc calc-alg-3.elc \
+	calc-alg.elc calc-arith.elc calc-bin.elc calc-comb.elc calc-comp.elc \
+	calc-cplx.elc calc-embed.elc calc-ext.elc calc-fin.elc \
+	calc-forms.elc calc-frac.elc calc-funcs.elc calc-graph.elc \
+	calc-help.elc calc-incom.elc calc-keypd.elc calc-lang.elc \
+	calc-maint.elc calc-map.elc calc-mat.elc calc-math.elc calc-misc.elc \
+	calc-mode.elc calc-poly.elc calc-prog.elc calc-rewr.elc \
+	calc-rules.elc calc-sel-2.elc calc-sel.elc calc-stat.elc \
+	calc-store.elc calc-stuff.elc calc-trail.elc calc-undo.elc \
+	calc-units.elc calc-vec.elc calc-yank.elc macedit.elc
+
+INFO_FILES = $(PACKAGE).info*
+
+PRELOADS = -l ./calc-macs.el -l ./calc.el
+
+include ../../XEmacs.rules
+
+all:: $(ELCS) auto-autoloads.elc $(PACKAGE).info
+
+calc.info: calc.texinfo
+	xemacs -vanilla -batch -insert calc.texinfo -l texinfmt -f texinfo-format-buffer -f save-buffer
+
+srckit: srckit-std
+
+binkit: binkit-sourceinfo
+
+in-place: inplace-sourceinfo
+# Makefile for "Calc", the GNU Emacs Calculator.
+#  Copyright (C) 1991, 1992, 1993 Free Software Foundation.
+#  Author: Dave Gillespie.
+#  Author's address: daveg@synaptics.com.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation (any version).
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+
+# To install Calc for private use, type `make'.
+# To install Calc for public use, type `make install'.
+
+# How to read a Makefile:
+#   The command `make target' looks for `target:' in the Makefile.
+#   First, any sub-targets after the `:' are made.
+#   Then, the Unix commands on the following lines are executed.
+#   `$(SYMBOL)' expands according to the `SYMBOL =' definition below.
+
+
+# Programs.
+EMACS    = xemacs
+TEX      = tex
+TEXINDEX = texindex
+MAKEINFO = makeinfo
+MAKE	 = make
+ECHO	 = @echo
+REMOVE	 = -rm -f
+# (The leading `@' tells "make" not to echo the command itself during make;
+#  The leading `-' tells "make" to keep going if the command fails.)
+
+# Other macros.
+EFLAGS   = -batch -vanilla
+MAINT	 = -l calc-maint.elc
+
+# Control whether intermediate files are kept.
+PURGE	 = -rm -f
+#PURGE	 = echo Not deleting:
+
+
+
+# Do full Calc installation.  (Note that `make' == `make all'.)
+# These are written this way instead of `all: compile private info'
+# to make the steps more explicit while the `make' is in progress.
+all:
+	$(MAKE) compile
+	$(MAKE) private
+	$(MAKE) info
+	$(ECHO) "Calc is now installed."
+
+install:
+	$(MAKE) compile
+	$(MAKE) public
+	$(MAKE) info
+	$(ECHO) "Calc is now installed."
+
+
+# Compile Calc.
+compile: maint
+	$(EMACS) $(EFLAGS) $(MAINT) -f calc-compile
+
+
+# Add autoload and set-global-key commands to system default file.
+public: maint
+	$(EMACS) $(EFLAGS) $(MAINT) -f calc-public-autoloads
+
+
+# Add autoload and set-global-key commands to ~/.emacs file.
+private: maint
+	$(EMACS) $(EFLAGS) $(MAINT) -f calc-private-autoloads
+
+
+# Format the Calc manual for the Info system using makeinfo.
+info: calc.info
+calc.info: calc.texinfo
+	-$(MAKEINFO) calc.texinfo
+	$(ECHO) "Please ignore warnings for Copying, Getting Started, and Interactive Tutorial."
+	$(MAKE) -f Makefile.calc texinfo
+
+
+# Format the Calc manual for the Info system using texinfo.el.
+# (Use this only if you do not have makeinfo.)
+texinfo: calc.info-2
+calc.info-2: calc.texinfo
+	$(EMACS) $(EFLAGS) calc.texinfo -f texinfo-format-buffer -f save-buffer
+
+
+# Format the Calc manual as one printable volume using TeX.
+tex:
+	$(REMOVE) calc.aux
+	$(TEX) calc.texinfo
+	$(TEXINDEX) calc.[cfkptv]?
+	$(TEX) calc.texinfo
+	$(PURGE) calc.cp calc.fn calc.pg calc.tp calc.vr
+	$(PURGE) calc.cps calc.fns calc.kys calc.pgs calc.tps calc.vrs
+	$(PURGE) calc.toc
+# Note, calc.aux and calc.ky are left behind for the benefit of "make summary".
+
+# Format the Calc manual as two printable volumes (Tutorial and Reference).
+tex2: texsplit texvol1 texvol2
+
+# Format the Calc Tutorial volume only.
+textut: texsplit1 texvol1
+
+# Format the Calc Reference volume only.
+texref: texsplit2 texvol2
+
+texsplit: maint
+	$(EMACS) $(EFLAGS) $(MAINT) calc.texinfo -f calc-split-manual
+
+texsplit1: maint
+	$(EMACS) $(EFLAGS) $(MAINT) calc.texinfo -f calc-split-tutorial
+
+texsplit2: maint
+	$(EMACS) $(EFLAGS) $(MAINT) calc.texinfo -f calc-split-reference
+
+texvol1:
+	$(TEX) calctut.tex
+	$(TEXINDEX) calctut.??
+	$(TEX) calctut.tex
+	$(PURGE) calctut.tex calctut.?? calctut.??s calctut.aux calctut.toc
+
+texvol2:
+	$(TEX) calcref.tex
+	$(TEXINDEX) calcref.??
+	$(TEX) calcref.tex
+	$(PURGE) calcref.tex calcref.?? calcref.??s calcref.aux calcref.toc
+
+
+# Format the Calc summary separately using TeX.
+summary: texsum
+	$(TEX) calcsum.tex
+	$(PURGE) calcsum.?? calcsum.aux calcsum.toc
+
+texsum: maint
+	$(EMACS) $(EFLAGS) $(MAINT) calc.texinfo -f calc-split-summary
+
+isummary: texisum
+	$(TEX) calcsum.tex
+	$(PURGE) calcsum.?? calcsum.aux calcsum.toc
+
+texisum: maint
+	$(EMACS) $(EFLAGS) $(MAINT) calc.texinfo -f calc-inline-summary
+
+
+# All this because "-l calc-maint" doesn't work.
+maint: calc-maint.elc
+calc-maint.elc: calc-maint.el
+	cp calc-maint.el calc-maint.elc
+
+
+# Create an Emacs TAGS file
+tags: TAGS
+TAGS:
+	etags *.el
+
+
+# Delete .elc files and other reconstructible files.
+clean:  clean.elc clean.info clean.tex
+
+clean.elc:
+	$(REMOVE) calc-*.elc
+	$(REMOVE) macedit.elc
+
+clean.info:
+	$(REMOVE) calc.info*
+
+clean.tex:
+	$(REMOVE) calc.cp calc.fn calc.ky calc.pg calc.tp calc.vr
+	$(REMOVE) calc.cps calc.fns calc.kys calc.pgs calc.tps calc.vrs
+	$(REMOVE) calc.aux calc.log calc.toc calc.dvi
+	$(REMOVE) calcref.*
+	$(REMOVE) calctut.*
+	$(REMOVE) calcsum.*
+
+
+
+This directory contains version 2.02f of Calc, an advanced desk
+calculator for GNU Emacs.
+
+"Calc"  Copyright 1990, 1991, 1992, 1993  Free Software Foundation, Inc.
+
+Written and maintained by:   Dave Gillespie
+			     c/o Synaptics, Inc.
+			     2698 Orchard Parkway
+			     San Jose CA 95134
+			     daveg@synaptics.com, uunet!synaptx!daveg
+
+
+
+From the introduction to the manual:
+
+  "Calc" is an advanced calculator and mathematical tool that runs as
+  part of the GNU Emacs environment.  Very roughly based on the HP-28/48
+  series of calculators, its many features include:
+
+    * Choice of algebraic or RPN (stack-based) entry of calculations.
+
+    * Arbitrary precision integers and floating-point numbers.
+
+    * Arithmetic on rational numbers, complex numbers (rectangular and
+      polar), error forms with standard deviations, open and closed
+      intervals, vectors and matrices, dates and times, infinities,
+      sets, quantities with units, and algebraic formulas.
+
+    * Mathematical operations such as logarithms and trigonometric functions.
+
+    * Programmer's features (bitwise operations, non-decimal numbers).
+
+    * Financial functions such as future value and internal rate of return.
+
+    * Number theoretical features such as prime factorization and
+      arithmetic modulo M for any M.
+
+    * Algebraic manipulation features, including symbolic calculus.
+
+    * Moving data to and from regular editing buffers.
+
+    * "Embedded mode" for manipulating Calc formulas and data directly
+      inside any editing buffer.
+
+    * Graphics using GNUPLOT, a versatile (and free) plotting program.
+
+    * Easy programming using keyboard macros, algebraic formulas,
+      algebraic rewrite rules, or extended Emacs Lisp.
+
+
+
+
+To install Calc:
+
+  1. Type "uncompress calc-2.02.tar.Z"
+
+  2. Type "tar xvf calc-2.02.tar"
+
+1,2. Alternatively: "zcat calc-2.02.tar.Z | tar xvf -"
+
+  3. Note that the Calc tar file now creates a "calc-2.02" subdirectory
+     of the current directory in which to place its files.
+
+  4. Follow the instructions in the file "INSTALL".
+
+
+
+Calc is written entirely in Emacs Lisp, for maximum portability.
+You do not need to recompile Emacs to install and use Calc.
+
+You will need about six megabytes of disk space to install Calc
+and its Info documentation.
+
+See the file INSTALL for installation instructions.  The instructions
+may seem long, but on typical systems you will only need to follow the
+steps shown in the first section.
+
+Don't even try to run Calc in uncompiled (.el) form!  It's far too slow.
+
+
+I am anxious to hear about your experiences using Calc.  Send mail to
+"daveg@synaptics.com".  A bug report is most useful if you include the
+exact input and output that occurred, any modes in effect (such as the
+current precision), and so on.  If you find Calc is difficult to operate
+in any way, or if you have other suggestions, don't hesitate to let me
+know.  If you find errors (including simple typos) in the manual, let
+me know.  Even if you find no bugs at all I would love to hear your
+opinions.
+
+The latest Calc tar files and patches are always available for anonymous
+FTP on prep.ai.mit.edu.
+
+Thanks,
+
+								-- Dave
+
+
+
+
+
+Summary of changes to "Calc"
+------- -- ------- --  ----
+
+
+Version 2.02f:
+
+ * Fixed a bug which broke `I', `H', `K' prefix keys in recent Emacs.
+
+ * Fixed a bug in calc.texinfo which prevented "make tex2" from working.
+
+ * Updated `C-y' (calc-yank) to understand Emacs 19 generalized kill ring.
+
+ * Added a copy of "calccard.tex", the Calc quick reference card.
+
+
+Version 2.02e:
+
+ * Fixed an installation bug caused by recent changes to `write-region'.
+
+
+Version 2.02d:
+
+ * Fixed a minor installation problem with a Emacs 19.29 byte-compiler bug.
+
+ * Removed archaic "macedit" package (superseded by "edmacro").
+
+
+Version 2.02c:
+
+ * Patch to port Calc to Lucid Emacs 19; still works with GNU 18 and GNU 19.
+
+ * Fixed a bug that broke `C-x C-c' after Calc graphics had been used.
+
+
+Version 2.02b:
+
+ * Minor patch to port Calc to GNU Emacs 19.  Will be superseded by Calc 3.00.
+
+
+Version 2.02:
+
+ * Revamped the manual a bit; rearranged some sections.
+
+ * Added marginal notes for Key/Function Index refs in printed manual.
+
+ * Changed `M-# r' to deal more gracefully with blank lines.
+
+ * Made reductions like `V R +' and `M-# :' considerably faster.
+
+ * Improved parsing and display of cases like "[a + b]".
+
+ * Added `t +' and `t -' for doing business date arithmetic.
+
+ * Added "syntax tables," the opposite of compositions.
+
+ * Added another Rewrites Tutorial exercise.
+
+ * Added the "vmatches" function.
+
+ * Added the `Modes' variable and `m g' command.
+
+ * Improved `u s' to cancel, e.g., "11 mph hr / yd" to get a number.
+
+ * Added "quick units" commands "u 0" through "u 9".
+
+ * Moved `M-%' to calc.el to avoid autoloading problems.
+
+ * Added `M-=' during algebraic entry, acts like `RET ='.
+
+ * Made `LFD' prevent evaluation when finishing a calc-edit command.
+
+ * Changed calc-store commands to use `t .' mode for trail display.
+
+ * Improved integrator to understand forms involving "erf".
+
+ * Fixed parser to make sense of "[1....1e2]" input.
+
+ * Fixed FORTRAN parser to treat a(i,j) as a_i_j if a is declared matrix.
+
+ * Got rid of some version number stamps to reduce size of patches.
+
+ * Fixed a bug in defmath treating "<=" and ">=" predicates.
+
+ * Fixed a bug in which Calc crashed multiplying two date forms.
+
+ * Fixed a bug in line breaker that crashed for large, nested formulas.
+
+ * Fixed a bug using ` to edit string("foo").
+
+ * Fixed a bug where `M-# y' in Big mode copied stack level number.
+
+ * Fixed a bug where `g O' used wrong default directory, no completion.
+
+ * Fixed a bug where "foo_bar(i)" parsed in C mode but showed as foo#bar.
+
+ * Fixed several bugs where large calculations got "computation too long."
+
+
+Version 2.01:
+
+ * Added percentage commands `M-%', `b %', and `c %'.
+
+ * Changed Big mode to force radix-10 in superscripts.
+
+ * Improved display of fractions in various language modes.
+
+ * Changed `a n' to work properly with equations and inequalities.
+
+ * The problem with cross references to Index nodes in TeX has been fixed.
+
+ * Fixed a bug where recursive esc-maps make calc-ext/-aent unloadable.
+
+ * Fixed a bug in `M-# k', then `OFF' right away, with fresh Emacs.
+
+ * Fixed a bug in which "S_i_j" was formatted wrong after `j s'.
+
+ * Fixed a bug in which `h k u c' positioned cursor on wrong line.
+
+ * Fixed a bug where `z ?' crashed if `z %' was defined.
+
+ * Fixed a bug in `j O' (calc-select-once-maybe).
+
+ * Fixed "make private" not to ask "Delete excess versions" and crash.
+
+
+Version 2.00:
+
+ * First complete posting of Calc since 1.01.
+
+ * Most parts of Calc have seen changes since version 1.07.  See
+   section "New for Calc 2.00" in the manual for a summary.  In
+   the FTP version of the Calc distribution, the file README.prev
+   contains a detailed change history from 1.00 up to 2.00.
+
+
+
+Summary of changes to "Calc" Preceding 2.00
+------- -- ------- --  ----  --------- ----
+
+
+Version 2.00:
+
+ * Changed to compile calc-macs/-maint, to allow "cp *.elc new-dir".
+
+ * Improved calc-describe-bindings to avoid showing redundant ESC maps.
+
+
+Version 2.00 beta 3:
+
+ * Removed version numbers from most .el files to reduce size of patches.
+
+ * Added a "calc-version" command.
+
+ * Changed `M-# ? ?' to allow for modified describe-function.
+
+ * Changed date parser to accept "Sept" as an alternative for "Sep".
+
+ * Inhibited answers to exercise from showing up in table of contents.
+
+ * Changed Makefile to say "texindex calc.[cfkptv]?" to avoid "calc.el".
+
+ * Fixed up the Makefile in various other ways.
+
+ * Rearranged banner at top of `h h' command's output.
+
+ * Changed "make summary" to print "Calc Summary" on the title page.
+
+ * Added "IntegSimpRules".
+
+ * Added `M-# :', `M-# _', and `M-# Z' options.
+
+ * Changed `^' to evaluate "[-3..-1]^-2" properly.
+
+ * Improved `f g' to give symbolic answers for, e.g., 101:2 and -3:2.
+
+ * Fixed a bug where `h k RET' didn't find the right place on the page.
+
+ * Fixed a bug that formatted "x*(y ? a : b)" as "x y ? a : b".
+
+ * Fixed a bug where defmath translated (< x 0) as (math-posp x)!
+
+ * Fixed a bug that prevented quick-calc from working sometimes.
+
+ * Fixed the `z ?' bug again (maybe this time for good?).
+
+ * Fixed a bug in which `V ^' (vint) was just plain wrong, wrong, wrong!
+
+ * Scanned for and fixed remaining bugs relating to autoloading.
+
+
+Version 2.00 beta 2:
+
+ * Changed "make info" to try "make texinfo" if "makeinfo" not found.
+
+ * Changed to "New for Calc 2.00"; texinfo.tex chokes on apostrophes.
+
+ * Added List Tutorial Exercise 14 (just in case there weren't enough!).
+
+ * Added a discussion of the `Z F' command to the Programming Tutorial.
+
+ * Improved `H a f' not to lose info if input is partially pre-factored.
+
+ * Improved simplification of expressions like sqrt(3) + 3^3:2.
+
+ * Changed Big mode to omit "*" in expressions like 2 sqrt(3) 5^3:4.
+
+ * Replaced European date format D/M/Y with D.M.Y.
+
+ * Changed `a N' and `a X' to consider the endpoints of the interval.
+
+ * Fixed a bug where TeX mode made c*(1+a/b) look like a function call.
+
+ * Fixed a bug formatting top-level evalto's while using selections.
+
+ * Fixed a bug that caused `z ?' to crash.
+
+ * Fixed a bug where `Z F' broke for argument names "t" and "nil".
+
+ * Fixed several bugs relating to autoloading.
+
+
+Version 2.00 beta 1:
+
+ * Added "What's new in Calc 2.00" to the manual (summary of info below).
+
+ * Added support for many GNUPLOT 3.0 features.
+
+ * Tweaked the Makefile and calc-compile a bit more.
+
+ * Modified to work with Zawinski's/Furuseth's optimizing byte compiler.
+
+ * Modified Calc to garbage-collect less often (raised gc-cons-threshold).
+
+ * Changed quick-calc to avoid autoloading so many parts of Calc.
+
+ * Changed Calc subfiles to work properly if not byte-compiled.
+
+ * Renamed `M-# s' to `M-# j', made `M-# s' be equivalent to `h s'.
+
+ * Changed calc-quit to avoid reapportioning space among other windows.
+
+ * Added `M-DEL' (calc-pop-above) key, to DEL as LFD is to RET.
+
+ * Added `{' and `}' to scroll vertically, analogous to `<' and `>'.
+
+ * Added `m t' for "total" algebraic mode.
+
+ * Added `d , \' option to group digits with "\,".
+
+ * Improved support of "prime" accent in "eqn" language mode.
+
+ * Changed macedit's read-kbd-macro to accept a string argument in Lisp.
+
+ * Changed calc-check-defines to use a more concise run-hooks linkage.
+
+ * Changed auto-why mode not to say [w=more] if next msg is not urgent.
+
+ * Made `a d' able to differentiate "a?b:c" and "a_i" formulas.
+
+ * Changed probability dist. functions to work with `a f' and `a d'.
+
+ * Added special constants "phi" and "gamma".
+
+ * Added "poly" function, simpler cousin of "gpoly".
+
+ * Added "pdeg", "plead", "pcont", "pprim"; cleaned up "pdiv" and "pgcd".
+
+ * Added `a p' command for polynomial interpolation.
+
+ * Added `a I' command for numerical integration; made IntegLimit variable.
+
+ * Added `a f' to factor polynomials; moved old `a f' to `a "'.
+
+ * Added `a a' to do partial fraction decompositions.
+
+ * Improved `a i' to integrate many more kinds of formulas.
+
+ * Modified `a P' to find numerical roots of high-degree polynomials.
+
+ * Modified `c 0' through `c 9' to convert int-valued floats to integers.
+
+ * Made sinh, arctanh, etc., expandable into exps/logs by `a f'.
+
+ * Added more algebraic simplifications having to do with logs and exps.
+
+ * Changed `s s', `s t', `s x', `s l' to accept an equation at prompt.
+
+ * Changed `s i' not to store Decls if its value is the default, [].
+
+ * Changed `s i' to store in `d O' language mode if in Normal or Big mode.
+
+ * Rearranged `V M'/`V R' matrix mapping modes.
+
+ * Added <#1+#2> notation for lambda expressions.
+
+ * Extended `b l' and other binary shifts to have a 2-argument version.
+
+ * Changed `u c' and `u t' to give unitless result for unitless input.
+
+ * Changed sqrt(1-cos(x)^2)-to-sin(x) to be an unsafe simplification.
+
+ * Improved simplification of sqrts, e.g., sqrt(a^2 x + a^2 y).
+
+ * Changed solver to treat (x-a)(x-b)(x-c) more intelligently.
+
+ * Changed Pascal language mode to use "$FFFF" for hexadecimal numbers.
+
+ * Added support for non-decimal display of floats.
+
+ * Changed `p' to refresh stack display if current float format uses it.
+
+ * Changed Big mode to use subscript notation for log10(x), log(x,b), r#nnn.
+
+ * Changed Big mode to format deriv(u,x) and tderiv(u,x) as du/dx.
+
+ * Changed Big mode to format integ(1/x,x) as "dx/x" instead of "1/x dx".
+
+ * Added "tty" output type for graphics commands.
+
+ * Documented Calc's random number generation algorithm in the manual.
+
+ * Fixed a bug involving having "(setq calc-timing t)" in .emacs.
+
+ * Fixed a bug that incorrectly parsed "|x| - 1" in TeX mode.
+
+ * Fixed bugs and made improvements in `a R' when widening the guess.
+
+ * Fixed a bug that where `a S' didn't solve (x - a)^2 = (x - b)^2.
+
+ * Fixed a bug that sometimes crashed `a P' on systems of equations.
+
+ * Fixed a bug that prevented `b p' (calc-pack-bits) from working.
+
+ * Fixed some bugs in which certain functions didn't get autoloaded.
+
+ * Fixed a bug in which the date <1/1/13> was incorrectly parsed.
+
+ * Fixed a bug which prevented `j D' from expanding (a+b)/c.
+
+ * Fixed a bug in solver: bad inverses for sinh and cosh.
+
+ * Fixed a bug in math-possible-signs that failed for x*0.
+
+ * Fixed a bug where sqrt(-a) was rewritten sqrt(a)*i even if a<0.
+
+ * Fixed a bug in line breaker when first "word" of line was too long.
+
+ * Worked around a makeinfo bug that handled @end group/@group badly.
+
+
+Version 2.00 alpha 3:
+
+ * Changed logic for locating component .elc files to be even smarter.
+
+ * Changed "make install" to "make compile"; added different "make install".
+
+ * Improved "make compile" to check file dates and compile only when needed.
+
+ * Made output of "make compile" in batch mode more compact and readable.
+
+ * Replaced "Quick Overview" in manual with "Demonstration of Calc".
+
+ * Changed to use keymaps for dispatching M-# and h prefix keys.
+
+ * Added TAGS target to the Calc Makefile.
+
+ * Removed most doc strings from functions; new help commands are better.
+
+ * Got rid of some crufty "fset" calls that were cluttering the code.
+
+ * Split calc-grab-region into two functions, calc-grab-region/-rectangle.
+
+ * Swapped positions of stack and trail in full-calc-keypad display.
+
+ * Improved line-breaking algorithm for displaying long formulas.
+
+ * Improved display of control characters in vectors shown as strings.
+
+ * Changed `d o' to allow fraction format to specify desired denominator.
+
+ * Changed `M-# y' to respect overwrite mode in target buffer.
+
+ * Added `H' prefix to display-mode commands to suppress stack refresh.
+
+ * Changed "calc-why" mechanism to display urgent messages automatically.
+
+ * Handled taking derivatives of symbolic integrals and vice-versa.
+
+ * Handled integrating vectors of formulas.
+
+ * Incorporated Ewerlid's polynomial division and GCD functions into Calc.
+
+ * Improved algebraic operations on "mod" forms, esp. polynomials.
+
+ * Added some more financial functions (sln, syd, ddb).
+
+ * Added nest, anest, fixp, and afixp (`H V R' and `H V U') functions.
+
+ * Added `a .' (calc-remove-equal) command to take apart equations.
+
+ * Generalized dfact to work for negative odd integers; added !! syntax.
+
+ * Changed `k f' to factor 1, 0, and negative integers.
+
+ * Changed `u M', etc., to accept +/- and [ .. ] forms as distributions.
+
+ * Changed `g q' to remove *Gnuplot Commands/Trail* window if present.
+
+ * Added support for Francois Pinard's "dumb terminal" driver for GNUPLOT.
+
+ * Added ":: remember" feature for rewrite rules.
+
+ * Changed rewrites to let pattern "a*b" match "x/2" with a=x, b=1/2.
+
+ * Added ability to put function names like "simplify" in rewrite schedule.
+
+ * Added "Rewrites Tutorial" to the manual.
+
+ * Changed ` to bind RET as newline instead of finish if editing a vector.
+
+ * Added some new exercises to the List Tutorial.
+
+ * Changed `Z F', `V M', etc. not to remove stored vars from def arg list.
+
+ * Added parsing for /1, 2, 3/ notation for Fortran mode vectors.
+
+ * Added a "%%" syntax for comments in formulas being read.
+
+ * Fixed a bug in which failing `h k' removed an existing Info window.
+
+ * Fixed a bug in `j /' operating on subformulas like "a + b".
+
+ * Fixed a bug in which "inf = inf" undesirably evaluated to 1.
+
+ * Fixed a bug that simplified "0 = 1 + a + 2" to "0 = a".
+
+ * Fixed a bug that failed for rewrite patterns like "fib(1 ||| 2)".
+
+ * Fixed a bug that arose because rewrite programs are non-reentrant.
+
+
+Version 2.00 alpha 2:
+
+ * Changed LFD terminating algebraic entry to push in no-simplify mode.
+
+ * Changed so that `K -' interprets `-' as calc-minus, not neg prefix arg.
+
+ * Improved `h c' command to understand all Calc key sequences.
+
+ * Fixed problems with DistribRules, NegateRules, and FitRules.
+
+ * Fixed several bad node pointers in the manual.
+
+ * Fixed a bug in `h C-w' when used with makeinfo-formatted manuals.
+
+ * Fixed a bug in sqrt(-1) when Polar and HMS modes are enabled.
+
+ * Fixed/improved dscalar and deven functions; added dodd.
+
+ * Fixed a bug in polynomial handling that also affected sum(sin(k),k,1,n).
+
+ * Fixed various other glitches in the manual.
+
+
+Version 2.00 alpha 1:
+
+ * Calc's tar file now creates a calc-(version) directory to unpack into.
+
+ * Calc now comes with a Makefile; install with "make install".
+
+ * Calc now comes already split into many files; installation is much simpler.
+
+ * Changed base file name of the manual from "calc-info" to "calc.info".
+
+ * Key binding for `M-# w' was documented but not implemented.
+
+ * Bound M-# ' to be synonymous with `M-# f' (used to be `M-# q').
+
+ * Changed M-# M-# to use last interface of C or K; E no longer counts.
+
+ * Changed `i' (and `M-# i') not to return to Top node unnecessarily.
+
+ * Changed `h' to be a prefix key with various help commands.
+
+ * Changed `s' to be a prefix key with various store and recall commands.
+
+ * Keys `i', `r', and `l' are obsolete (moved to `h' and `s' prefixes).
+
+ * Rearranged `K', `X', and `M-RET' keys; `K' is now calc-keep-args.
+
+ * Changed quick-calc to display input formula as well as output if room.
+
+ * Changed quick-calc to interact with the editing buffer and kill ring.
+
+ * Created pack, unpack, unpackt function equivalents of `v p', `v u'.
+
+ * Changed to expand (a/b)^x to a^x/b^x only if b > 0 (not if a > 0).
+
+ * Changed math-possible-signs to understand sqrt function.
+
+ * Changed Z [, rewrites to consider any provably non-zero value as true.
+
+ * Changed normal language modes to accept ** as a synonym for ^.
+
+ * Added "maple" language mode.
+
+ * Changed, e.g., Mathematica "(2 + 3 I)^(1.23*10^20)" to include parens.
+
+ * Generalized math-compose-big properties for all language modes.
+
+ * Introduced "string" and other function for composing expressions.
+
+ * Changed many recursive vector routines to use loops instead.
+
+ * Added evalv, evalvn function equivalents to `=', `N'.
+
+ * Changed "expr =>" not to evaluate at all if in no-simplify mode.
+
+ * Redesigned user interface of `a F' (calc-curve-fit) command.
+
+ * Added "phase" feature to the rewrite rule system. 
+
+ * Added "&&&", "|||", "!!!" to the rewrite rule system.
+
+ * Introduced a new notation for rewrites:  LHS := RHS :: COND.
+
+ * Changed `a r' (but not `j r') to repeat 100 times by default.
+
+ * Integrated EvalRules more cleanly into the default simplifications.
+
+ * Added `H v l' [mdims] to measure the dimensions of a matrix.
+
+ * Changed `u c' to interpret "/units" as "1/units".
+
+ * Added `u a' to adjust unit prefix letters automatically.
+
+ * Changed `u s' to enable scalar mode while simplifying.
+
+ * Changed `c f' [pfloat] not to float integer powers or subscripts.
+
+ * Added a three-argument form for the "hms" function.
+
+ * Changed, e.g., sin(90) degrees to produce 1 instead of 1.0.
+
+ * Changed symbolic mode to prefer sqrt(int): abs([1 2 3]) => sqrt(14).
+
+ * Enhanced solver to handle, e.g., x + 1/x = a; exp(x) + exp(-x) = a.
+
+ * Enhanced simplifier to handle, e.g., exp(a+2) / e^a => e^2.
+
+ * Enhanced `a s' to simplify sqrt(x) - x^1:2 and exp(x) - e^x to 0.
+
+ * Added -(a + b) to -a - b as a default simplification.
+
+ * Added rules for differentiating sum() and prod() functions.
+
+ * Added a few more energy units (due to Przemek Klosowski).
+
+ * Added overflow/underflow checking for all floating-point arithmetic.
+
+ * Extended error forms to work with complex numbers.
+
+ * Generalized GCD to handle fractional arguments.
+
+ * Changed graphics routines to evaluate "x" values, e.g., [-pi .. pi].
+
+ * Added `g q', like `g K' but without viewing the Gnuplot Trail.
+
+ * Changed `g p' and `V M' to display better "Working..." messages.
+
+ * Modified `M-# g' to be more robust about grabbing formulas.
+
+ * Added `Y' prefix key reserved for user-written extensions.
+
+ * Added calc-load-hook and calc-ext-load-hook.
+
+ * Prevented calc-install from leaving large ~ files behind.
+
+ * Changed @bullet to @bullet{} in manual to conform to texinfo spec.
+
+ * Rearranged some chapters in the manual to be a bit more logical.
+
+ * Added calc-split-summary command.
+
+ * Fixed several bugs in embedded mode.
+
+ * Fixed a bug in calc-vector-covariance that required a prefix arg.
+
+ * Fixed a bug that prevented parsing "a=>" with no right-hand side.
+
+ * Fixed a bug which allowed incorrectly dividing a vector by a vector.
+
+ * Fixed a bug formatting sum(...)^2 in Big mode.
+
+ * Fixed a bug that prevented Calc from deleting old graphics temp files.
+
+ * Fixed some typos calling calc-inverse-func instead of calc-invert-func.
+
+ * Fixed bugs in the derivatives of conj, deg, and rad; added re, im.
+
+ * Fixed a bug where (r;theta) parsed as r exp(theta i) even in Deg mode.
+
+ * Fixed a bug which gave wrong answer for exp of a polar complex number.
+
+ * Fixed a bug in `Z F' that failed if formula used non-arg variables.
+
+ * Fixed a bad pointer to Info node "Assignments in Embedded Mode".
+
+ * Fixed several errors in the Calc Summary.
+
+
+Version 1.08 beta 1:
+
+ * Calc's copyright has been assigned to FSF, for inclusion in Emacs 19!
+
+ * Changed M-# to be a two-key sequence; use M-# M-# to start Calc now.
+
+ * Rewrote and expanded the introductory chapter of the manual.
+
+ * Added a key and function summary to the manual.
+
+ * Changed the manual to take better advantage of TeX's math formatting.
+
+ * Changed manual to be printable in @smallbook format.
+
+ * Added "calc-embedded" mode.
+
+ * Added "=>" [evalto] operator.
+
+ * Added facilities for date and date/time arithmetic.
+
+ * Added a set of financial functions (pv, fv, etc.).
+
+ * Added infinite quantities inf, uinf, and nan (plus infinite intervals).
+
+ * Added "EvalRules", "SimpRules", and "ExtSimpRules" variables.
+
+ * Added sum and product commands `a +', `a -', `a *', `a T'.
+
+ * Enhanced `a S' and `a P' to solve systems of equations.
+
+ * Enhanced solver to handle eqns like sin(x) = cos(2 x), sqrt(x) + x = 1.
+
+ * Added `a M' (calc-map-equation) command.
+
+ * Added new statistical functions: mean, standard deviation, etc.
+
+ * Added line, polynomial, and curve fitting commands (`a L' and `a F').
+
+ * Added support for composite units, e.g., "mi+ft+in".
+
+ * Enhanced "Big" mode to format square roots, choose, and powers better.
+
+ * Enhanced "Big" mode to display fractions in large notation.
+
+ * Added several alternate formats for matrix display.
+
+ * Changed TeX mode to write "(1 + x^2)" instead of "\left(1 + x^2\right)".
+
+ * Added support for relational operators in TeX and FORTRAN modes.
+
+ * Added recognition of accents like \dot, \tilde, \underline in TeX mode.
+
+ * Added "eqn" language mode.
+
+ * Added extra control over display justification with `d <', `d =', `d >'.
+
+ * Added calc-left-label and calc-right-label (`d {', `d }').
+
+ * Added "nn%" syntax for algebraic formulas; equivalent to "nn * .01".
+
+ * Added input syntaxes like a = b = c, a != b != c, a <= b < c.
+
+ * Changed "_" to mean subscripts; old use of "_" in vars is now "#".
+
+ * Introduced "matrix mode" and "scalar mode" (`m v').
+
+ * Introduced generic identity matrices (idn(1)).
+
+ * Added a method for declaring variables to be real, integer, > 0, etc.
+
+ * Added `Z S' command for editing stored value of a variable.
+
+ * Added "subst" algebraic function equivalent to the `a b' command.
+
+ * Added `a f' command, changed deriv/integ/solve-for to use it.
+
+ * Improved `a s' to simplify (x + y) (y + x) to (x + y)^2.
+
+ * Improved `a s' to simplify i^2 to -1.
+
+ * Improved `a s' to simplify, e.g., sin(pi/3) in Symbolic mode.
+
+ * Improved `a s' to simplify sqrt(8) to 2 sqrt(2), 1/sqrt(2) to sqrt(2)/2.
+
+ * Moved sin(arccos(x)) from `a e' to `a s'; not unsafe after all!
+
+ * Changed (x y)^z => x^z y^z to be a usually-unsafe simplification.
+
+ * Added thorough documentation of `a s' and `a e' to the manual.
+
+ * Improved `a c' to collect "f(a)" even if "a" also appears elsewhere.
+
+ * Introduced lin, linnt, islin, islinnt functions for linearity testing.
+
+ * Improved `a x' to use binomial theorem to give simpler answers.
+
+ * Improved `j D' to distribute powers of sums: (a + b)^n.
+
+ * Improved `j M' to merge products of powers (may need no-simplify mode).
+
+ * Changed to use defvar for DistribRules etc. so `Z V' works with them.
+
+ * Improved `j *' and `j /' to work properly in a few more cases.
+
+ * Improved `V R' to use identity value when reducing empty vectors.
+
+ * Improved `v p' and `v u' to support more complex packing operations.
+
+ * Disabled automatic simplification of sqrt(2)/2 to 1/sqrt(2).
+
+ * Bound SPC and RET to press, TAB to next-menu in *Calc Keypad* buffer.
+
+ * Added C-u ' to do algebraic entry with language mode forced to normal.
+
+ * Added "$1", "$2", etc. input notation for algebraic entry.
+
+ * Changed unary operators like `n', `&' to treat neg prefix args like RET.
+
+ * Changed ` (calc-edit) to show full precision regardless of float format.
+
+ * Enhanced quick-calc to display integers in several formats.
+
+ * Documented `g H' (calc-graph-hide) command (had been left from manual).
+
+ * Enhanced floor/ceil/trunc/round in several ways.
+
+ * Added rounde and roundu functions.
+
+ * Changed `c 1' through `c 9' to change small floats to 0.0; added `c 0'.
+
+ * Enhanced set operations to work on sets of intervals.
+
+ * Fixed erf(0), utpn(x,x,y), and arccosh(-1) to work properly.
+
+ * Changed complex arctan and arctanh to follow Steele 2nd edition.
+
+ * Expanded "Branch Cuts" section of the manual with some useful tables.
+
+ * Rearranged order of words in mode line to be a bit more logical.
+
+ * Changed `m N' (num-simplify) mode to evaluate constant vectors, too.
+
+ * Changed `a r'/`j r' to prompt twice for separate LHS/RHS if necessary.
+
+ * Enhanced `let(v,x)' in rewrites by allowing arbitrary patterns for v.
+
+ * Changed cursor positioning in second prompt for `a b' (calc-substitute).
+
+ * Changed `y' to omit line numbers more consistently.
+
+ * Changed `o' (calc-realign) to reset horizontal scrolling to zero, also.
+
+ * Added "pred" mode for calc-eval.
+
+ * Added "calc-report-bug" as an alias for "report-calc-bug".
+
+ * Added `Z T' and "calc-pass-errors" to aid debugging Calc-related code.
+
+ * Added "calc-load-everything" (`m X' or `M-# L') command.
+
+ * Enhanced calc-install to pre-build units table, CommuteRules, etc.
+
+ * Changed Calc to interact more gracefully with load-path.
+
+ * Changed Lisp Variable Index in manual to include user variables, too.
+
+ * Fixed a bug that prevented calc-install from working under VMS.
+
+ * Fixed a bug that sometimes crashed rewrites dealing with subtractions.
+
+ * Fixed a bug that prevented `a S' from solving "3 - x = 1 + x"!
+
+ * Fixed a bug in solver that crashed for certain cubics and quartics.
+
+ * Fixed a bug in calc-simplify that crashed for equations and ineqs.
+
+ * Fixed a bug which placed the "[" oddly in `d B' + `v /' mode.
+
+ * Fixed a bug where finishing calc-edit improperly obeyed language mode.
+
+ * Fixed a bug formatting (-1)^n in Big mode after selection commands.
+
+ * Fixed a bug that got ">=" and "<=" backwards in rewrite conditions.
+
+ * Fixed a bug that broke the `"x"' key in calc-keypad mode.
+
+ * Fixed a bug in which `MAP$' in calc-keypad didn't display "Working...".
+
+ * Fixed a bug where matrix division gave bad result for singular matrix.
+
+ * Fixed a bug which closed Calc window if calc-grab-region got an error.
+
+ * Fixed a bug where `a s' failed on formulas containing dimension errors.
+
+ * Fixed a bug that caused `m F' to hang.
+
+ * Fixed a bug in complex arithmetic that caused problems with solver.
+
+ * Fixed a bug which raised intervals to interval powers incorrectly.
+
+ * Fixed a bug in utpp/ltpp (order of arguments did not match the manual).
+
+ * Fixed a bug in which `t y' rounded yanked data with old precision.
+
+ * Fixed a bug in which "in(3, [3 .. 3))" returned true.
+
+ * Fixed a bug which simplified abs(abs(x)) incorrectly.
+
+ * Fixed a bug in which (a^2)^1:3 was unsafely simplified to a^2:3.
+
+ * Fixed a bug in rewrite system which missed pattern "2 sin(x) cos(x)".
+
+ * Fixed a bug in rewrite system which missed pattern "a - a cos(x)^2".
+
+ * Fixed obsolete trail tags gsmp, gneg, ginv to jsmp, jneg, jinv.
+
+ * Fixed some errors and made improvements in units table [Ulrich Mueller].
+
+
+Version 1.07:
+
+ * Added `m F' (calc-settings-file-name) command.
+
+ * Added calc-autoload-directory variable.
+
+ * Extended Z ` to accept a prefix argument.
+
+ * Added keystrokes (v h, v k) for head, tail, cons.
+
+ * Extended `v e' to accept a vector as the filler.
+
+ * Changed `V M', `V R' to accept mapping-mode keys in uppercase, too.
+
+ * Changed V M ' etc. to accept $, $$, ... as argument indicators.
+
+ * Changed `t y' to accept a prefix argument.
+
+ * Put in a cleaner and safer random number generator for `k r' et al.
+
+ * Fixed a bug which completely broke `a r' command!
+
+ * Fixed "0 * matrix" to generate a zero matrix instead of 0.
+
+ * Fixed a bug in `a R' which sometimes caused it to crash.
+
+ * Fixed a fatal typo in the TeX version of the manual.
+
+ * Fixed a bug that prevented C-k, C-w, M-w from working in Trail buffer.
+
+ * Fixed another bug in `Z P' command.
+
+ * Fixed a bug in `u s' which incorrectly simplified subtractions.
+
+ * Fixed an argument-name aliasing bug evaluating lambda( ) formulas.
+
+ * Fixed overfull hboxes in the manual.
+
+ * Fixed various other bugs in the manual.
+
+
+Version 1.06:
+
+ * Added "calc-keypad" mode for X window system users (try it!).
+
+ * Improved "calc-eval" for calling/operating Calc from user-written Lisp.
+
+ * Moved vector accumulate command to `V U' (old `H V R' still supported).
+
+ * Added right-to-left reductions: `I V R' and `I V U'.
+
+ * Added set operations on vectors: intersect, union, diff, xor.
+
+ * Added `I v s' to remove a subvector from a vector.
+
+ * Introduced `H |' to append two vectors with no magical special cases.
+
+ * Introduced rhead, rtail, and rcons for isolating last vector element.
+
+ * Changed `g p' to keep temp files around until data actually change.
+
+ * Improved `a S' to solve many higher-order polynomial equations.
+
+ * Added `a P' to produce a vector of all solutions to an equation.
+
+ * Enhanced `a v' and `j v' to allow top-level-only evaluation.
+
+ * Changed `j DEL' to delete a side of an eqn or ineq, leaving other side.
+
+ * Fixed binding for keys `j 1' through `j 9'.
+
+ * Introduced "let" marker in rewrite rules.
+
+ * Enhanced the "sign" function to provide a two-argument version.
+
+ * Changed "max-specpdl-size exceeded" error message to be user-friendly.
+
+ * Put "<Aborted>" in the trail in above case and when user presses C-g.
+
+ * Changed TeX mode to generate \ldots instead of \dots, recognize both.
+
+ * Changed "sin(0)" etc. (for integer 0) to generate "0" instead of "0.".
+
+ * Enhanced Programming Tutorial exercise 2.
+
+ * Fixed an error in the answer to Types Tutorial exercise 3.
+
+ * Fixed several bugs relating to head, tail, and cons functions.
+
+ * Fixed some other minor typos in the manual.
+
+ * Fixed several bugs in `Z P' (calc-user-define-permanent).
+
+ * Fixed several bugs that broke the `g P' command.
+
+
+Version 1.05:
+
+ * Created a calc-install command to ease installation.
+
+ * Added lots of exercises to the Tutorial section of the manual.
+
+ * Added ability to select and operate on sub-formulas.
+
+ * Substantially improved the algebraic rewrite-rule system.
+
+ * Added a set of graphing commands that use GNUPLOT.
+
+ * Added a command (`a R') for finding numerical roots to equations.
+
+ * Added several new math functions, such as erf and Bessel functions.
+
+ * Added key bindings for miscellaneous commands using the "f" prefix key.
+
+ * Added lots of new vector operations, many of them in the spirit of APL.
+
+ * Added more control over vector display, including an abbreviated mode.
+
+ * Improved keyboard macro editing; added read-kbd-macro to macedit.el.
+
+ * Introduced the `m S' (calc-shift-prefix) command.
+
+ * Enhanced the calc-edit command in several ways.
+
+ * Made it possible to hit ` (calc-edit) during numeric/algebraic entry.
+
+ * Enhanced the calc-solve-for command to handle inequalities.
+
+ * Enhanced calc-simplify to handle equations and inequalities.
+
+ * Taught log10 and log to look for exact integer or rational results.
+
+ * Added ability to take Nth roots directly.
+
+ * Added "increment" and "decrement" commands for integers and floats.
+
+ * Added "full-help" command, changed "h" key to invoke it.
+
+ * Added special help for Inverse and Hyperbolic prefixes.
+
+ * Added an optional prefix argument to `o' (calc-realign).
+
+ * Changed `t s' and `t r' to use RET as the search exit key.
+
+ * Made handling of operator keys for V M, V R, etc. more regular.
+
+ * Improved TeX mode; added support for \matrix format.
+
+ * Added a variant of `m a' mode that only affects ( and [ keys.
+
+ * Fixed "Mismatch" message for algebraic entry of semi-open intervals.
+
+ * Trimmed fat from calc.el to speed loading, moved more to calc-ext.el.
+
+ * Fixed a bug in which minibuffer entry rounded to out-of-date precision.
+
+ * Fixed a bug which crashed Calc 1.04 under Epoch.
+
+ * Fixed a bug which messed up Calc Trail's mode line, among other things.
+
+ * Fixed a bug which caused trail ">" to show only when in Trail buffer.
+
+ * Fixed a bug in which "calc" called "calc-grab-region" with too few args.
+
+ * Fixed bugs in both implementation and documentation of calc-perm.
+
+ * Fixed a bug in which calc-simplify-extended always used radians.
+
+ * Fixed a bug where calc-comma failed to override "polar" mode.
+
+ * Fixed a bug doing mixed arithmetic on rectangular+polar complex numbers.
+
+ * Fixed several bugs in transcendental functions with complex arguments.
+
+ * Fixed a bug in which `a s' simplified "x / .5" to ".5 x".
+
+ * Fixed numerous other bugs in various parts of Calc.
+
+ * Completed the "Hooks" section of the "Internals" chapter of the manual.
+
+
+Version 1.04:
+
+ * Included a copy of revision history (from README) in calc.el.
+
+ * Added the "calc-split" feature to split calc-ext.el into smaller bits.
+
+ * Changed calc-unpack to unpack floats and fractions, too.
+
+ * Added "mant", "xpon", and "scf" functions for decomposing floats.
+
+ * Fixed a bug in the "y" command with positive prefix arguments.
+
+ * Rearranged binary shift/rotate command keys to be a bit more convenient.
+
+ * Fixed a bug in which simplifying "(0/0) * 2" crashed with a Lisp error.
+
+ * Made `H F' [ffloor] and friends faster for very large arguments.
+
+ * Made calc-define-del more robust.
+
+ * Handled pasting of data into the Calculator using the mouse under X.
+
+ * Made overlay-arrow variables buffer-local to avoid interference.
+
+ * Fixed a problem in which Calc Trail buffer got stuck after a C-x C-w.
+
+
+Version 1.03:
+
+ * Changed math-choose to compute n-choose-m faster when m is large.
+
+ * Fixed some problems with TeX mode.
+
+ * Fixed a bug that prevented `b s' from working without a prefix argument.
+
+ * Added "calc-eval" function.
+
+ * Improved calc-grab-region.
+
+
+Version 1.02:
+
+ * Fixed a bug in Tutorial: telephone pole height/distance were switched!
+
+ * Fixed a few other things in the manual.
+
+ * Added "full-calc" command.
+
+ * Added "calc-insert-variables" (`Z I') command.
+
+ * Quick Calc now works even if you are already in the minibuffer.
+
+ * Fixed a bug in math-mul-bignum-digit which affected math-and, etc.
+
+ * Definition of "Hectares" was wrong in units table.
+
+ * Fixed a bug in calc-execute-kbd-macro concerning undo and refresh.
+
+ * Bound "calc-undo" to `C-x u' as well as `C-_' and `U'.
+
+Version 1.01:
+
+ * Added a tutorial section to the manual.
+
+ * Next and Prev for node Strings in the manual were reversed; fixed.
+
+ * Changed "'bignum" in calc-isqrt-bignum-iter to "'bigpos".
+
+ * Fixed a bug that prevented "$" from working during algebraic entry.
+
+ * Fixed a bug caused by an X (last-X) command following a K (macro) cmd.
+
+ * Fixed a bug in which K command incorrectly formatted stack in Big mode.
+
+ * Added space between unary operators and non-flat compositions.
+   (Otherwise, "-(a/b)" in Big mode blended the minus sign into the rule!)
+
+ * Fixed formatting of (-1)^n in Big mode.
+
+ * Fixed some problems relating to "not" operator in Pascal language mode.
+
+ * Fixed several bugs relating to V M ' and V M $ sequences.
+
+ * Fixed matrix-vector multiplication to produce a vector.
+
+ * Introduced Z ` ... Z ' commands; renamed old Z ' to Z #.
+
+ * Fixed various other bugs.
+
+ * Added calc-settings-file variable suggested by C. Witty.
+
+
+Version 1.00:
+
+ * First official release of Calc.
+
+ * If you used the Beta test version (0.01), you will find that this
+   version of Calc is over 50% larger than the original release.
+   General areas of improvement include much better algebra features;
+   operations on units; language modes; simplification modes; interval
+   arithmetic; vector mapping and reduction.  Other new commands include
+   calc-fraction and calc-grab-region.  The program has been split into
+   two parts for faster loading, and the manual is more complete.
+
+;; Calculator for GNU Emacs, part I [calc-aent.el]
+;; Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+;; Written by Dave Gillespie, daveg@synaptics.com.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY.  No author or distributor
+;; accepts responsibility to anyone for the consequences of using it
+;; or for whether it serves any particular purpose or works at all,
+;; unless he says so in writing.  Refer to the GNU Emacs General Public
+;; License for full details.
+
+;; Everyone is granted permission to copy, modify and redistribute
+;; GNU Emacs, but only under the conditions described in the
+;; GNU Emacs General Public License.   A copy of this license is
+;; supposed to have been given to you along with GNU Emacs so you
+;; can know your rights and responsibilities.  It should be in a
+;; file named COPYING.  Among other things, the copyright notice
+;; and this notice must be preserved on all copies.
+
+
+
+;; This file is autoloaded from calc.el.
+(require 'calc)
+
+(require 'calc-macs)
+
+(defun calc-Need-calc-aent () nil)
+
+
+(defun calc-do-quick-calc ()
+  (calc-check-defines)
+  (if (eq major-mode 'calc-mode)
+      (calc-algebraic-entry t)
+    (let (buf shortbuf)
+      (save-excursion
+	(calc-create-buffer)
+	(let* ((calc-command-flags nil)
+	       (calc-dollar-values calc-quick-prev-results)
+	       (calc-dollar-used 0)
+	       (enable-recursive-minibuffers t)
+	       (calc-language (if (memq calc-language '(nil big))
+				  'flat calc-language))
+	       (entry (calc-do-alg-entry "" "Quick calc: " t))
+	       (alg-exp (mapcar (function
+				 (lambda (x)
+				   (if (and (not calc-extensions-loaded)
+					    calc-previous-alg-entry
+					    (string-match
+					     "\\`[-0-9._+*/^() ]+\\'"
+					     calc-previous-alg-entry))
+				       (calc-normalize x)
+				     (calc-extensions)
+				     (math-evaluate-expr x))))
+				entry)))
+	  (if (and (= (length alg-exp) 1)
+		   (eq (car-safe (car alg-exp)) 'calcFunc-assign)
+		   (= (length (car alg-exp)) 3)
+		   (eq (car-safe (nth 1 (car alg-exp))) 'var))
+	      (progn
+		(calc-extensions)
+		(set (nth 2 (nth 1 (car alg-exp))) (nth 2 (car alg-exp)))
+		(calc-refresh-evaltos (nth 2 (nth 1 (car alg-exp))))
+		(setq alg-exp (list (nth 2 (car alg-exp))))))
+	  (setq calc-quick-prev-results alg-exp
+		buf (mapconcat (function (lambda (x)
+					   (math-format-value x 1000)))
+			       alg-exp
+			       " ")
+		shortbuf buf)
+	  (if (and (= (length alg-exp) 1)
+		   (memq (car-safe (car alg-exp)) '(nil bigpos bigneg))
+		   (< (length buf) 20)
+		   (= calc-number-radix 10))
+	      (setq buf (concat buf "  ("
+				(let ((calc-number-radix 16))
+				  (math-format-value (car alg-exp) 1000))
+				", "
+				(let ((calc-number-radix 8))
+				  (math-format-value (car alg-exp) 1000))
+				(if (and (integerp (car alg-exp))
+					 (> (car alg-exp) 0)
+					 (< (car alg-exp) 127))
+				    (format ", \"%c\"" (car alg-exp))
+				  "")
+				")")))
+	  (if (and (< (length buf) (screen-width)) (= (length entry) 1)
+		   calc-extensions-loaded)
+	      (let ((long (concat (math-format-value (car entry) 1000)
+				  " =>  " buf)))
+		(if (<= (length long) (- (screen-width) 8))
+		    (setq buf long))))
+	  (calc-handle-whys)
+	  (message "Result: %s" buf)))
+      (if (eq last-command-char ?\n)
+	  (insert shortbuf)
+	(setq kill-ring (cons shortbuf kill-ring))
+	(if (> (length kill-ring) kill-ring-max)
+	    (setcdr (nthcdr (1- kill-ring-max) kill-ring) nil))
+	(setq kill-ring-yank-pointer kill-ring))))
+)
+
+(defun calc-do-calc-eval (str separator args)
+  (calc-check-defines)
+  (catch 'calc-error
+    (save-excursion
+      (calc-create-buffer)
+      (cond
+       ((and (consp str) (not (symbolp (car str))))
+	(let ((calc-language nil)
+	      (math-expr-opers math-standard-opers)
+	      (calc-internal-prec 12)
+	      (calc-word-size 32)
+	      (calc-symbolic-mode nil)
+	      (calc-matrix-mode nil)
+	      (calc-angle-mode 'deg)
+	      (calc-number-radix 10)
+	      (calc-leading-zeros nil)
+	      (calc-group-digits nil)
+	      (calc-point-char ".")
+	      (calc-frac-format '(":" nil))
+	      (calc-prefer-frac nil)
+	      (calc-hms-format "%s@ %s' %s\"")
+	      (calc-date-format '((H ":" mm C SS pp " ")
+				  Www " " Mmm " " D ", " YYYY))
+	      (calc-float-format '(float 0))
+	      (calc-full-float-format '(float 0))
+	      (calc-complex-format nil)
+	      (calc-matrix-just nil)
+	      (calc-full-vectors t)
+	      (calc-break-vectors nil)
+	      (calc-vector-commas ",")
+	      (calc-vector-brackets "[]")
+	      (calc-matrix-brackets '(R O))
+	      (calc-complex-mode 'cplx)
+	      (calc-infinite-mode nil)
+	      (calc-display-strings nil)
+	      (calc-simplify-mode nil)
+	      (calc-display-working-message 'lots)
+	      (strp (cdr str)))
+	  (while strp
+	    (set (car strp) (nth 1 strp))
+	    (setq strp (cdr (cdr strp))))
+	  (calc-do-calc-eval (car str) separator args)))
+       ((eq separator 'eval)
+	(eval str))
+       ((eq separator 'macro)
+	(calc-extensions)
+	(let* ((calc-buffer (current-buffer))
+	       (calc-window (get-buffer-window calc-buffer))
+	       (save-window (selected-window)))
+	  (if calc-window
+	      (unwind-protect
+		  (progn
+		    (select-window calc-window)
+		    (calc-execute-kbd-macro str nil (car args)))
+		(and (window-point save-window)
+		     (select-window save-window)))
+	    (save-window-excursion
+	      (select-window (get-largest-window))
+	      (switch-to-buffer calc-buffer)
+	      (calc-execute-kbd-macro str nil (car args)))))
+	nil)
+       ((eq separator 'pop)
+	(or (not (integerp str))
+	    (= str 0)
+	    (calc-pop (min str (calc-stack-size))))
+	(calc-stack-size))
+       ((eq separator 'top)
+	(and (integerp str)
+	     (> str 0)
+	     (<= str (calc-stack-size))
+	     (math-format-value (calc-top-n str (car args)) 1000)))
+       ((eq separator 'rawtop)
+	(and (integerp str)
+	     (> str 0)
+	     (<= str (calc-stack-size))
+	     (calc-top-n str (car args))))
+       (t
+	(let* ((calc-command-flags nil)
+	       (calc-next-why nil)
+	       (calc-language (if (memq calc-language '(nil big))
+				  'flat calc-language))
+	       (calc-dollar-values (mapcar
+				    (function
+				     (lambda (x)
+				       (if (stringp x)
+					   (progn
+					     (setq x (math-read-exprs x))
+					     (if (eq (car-safe x)
+						     'error)
+						 (throw 'calc-error
+							(calc-eval-error
+							 (cdr x)))
+					       (car x)))
+					 x)))
+				    args))
+	       (calc-dollar-used 0)
+	       (res (if (stringp str)
+			(math-read-exprs str)
+		      (list str)))
+	       buf)
+	  (if (eq (car res) 'error)
+	      (calc-eval-error (cdr res))
+	    (setq res (mapcar 'calc-normalize res))
+	    (and (memq 'clear-message calc-command-flags)
+		 (message ""))
+	    (cond ((eq separator 'pred)
+		   (calc-extensions)
+		   (if (= (length res) 1)
+		       (math-is-true (car res))
+		     (calc-eval-error '(0 "Single value expected"))))
+		  ((eq separator 'raw)
+		   (if (= (length res) 1)
+		       (car res)
+		     (calc-eval-error '(0 "Single value expected"))))
+		  ((eq separator 'list)
+		   res)
+		  ((memq separator '(num rawnum))
+		   (if (= (length res) 1)
+		       (if (math-constp (car res))
+			   (if (eq separator 'num)
+			       (math-format-value (car res) 1000)
+			     (car res))
+			 (calc-eval-error
+			  (list 0
+				(if calc-next-why
+				    (calc-explain-why (car calc-next-why))
+				  "Number expected"))))
+		     (calc-eval-error '(0 "Single value expected"))))
+		  ((eq separator 'push)
+		   (calc-push-list res)
+		   nil)
+		  (t (while res
+		       (setq buf (concat buf
+					 (and buf (or separator ", "))
+					 (math-format-value (car res) 1000))
+			     res (cdr res)))
+		     buf))))))))
+)
+
+(defun calc-eval-error (msg)
+  (if (and (boundp 'calc-eval-error)
+	   calc-eval-error)
+      (if (eq calc-eval-error 'string)
+	  (nth 1 msg)
+	(error "%s" (nth 1 msg)))
+    msg)
+)
+
+
+;;;; Reading an expression in algebraic form.
+
+(defun calc-auto-algebraic-entry (&optional prefix)
+  (interactive "P")
+  (calc-algebraic-entry prefix t)
+)
+
+(defun calc-algebraic-entry (&optional prefix auto)
+  (interactive "P")
+  (calc-wrapper
+   (let ((calc-language (if prefix nil calc-language))
+	 (math-expr-opers (if prefix math-standard-opers math-expr-opers)))
+     (calc-alg-entry (and auto (char-to-string last-command-char)))))
+)
+
+(defun calc-alg-entry (&optional initial prompt)
+  (let* ((sel-mode nil)
+	 (calc-dollar-values (mapcar 'calc-get-stack-element
+				     (nthcdr calc-stack-top calc-stack)))
+	 (calc-dollar-used 0)
+	 (calc-plain-entry t)
+	 (alg-exp (calc-do-alg-entry initial prompt t)))
+    (if (stringp alg-exp)
+	(progn
+	  (calc-extensions)
+	  (calc-alg-edit alg-exp))
+      (let* ((calc-simplify-mode (if (eq last-command-char ?\C-j)
+				     'none
+				   calc-simplify-mode))
+	     (nvals (mapcar 'calc-normalize alg-exp)))
+	(while alg-exp
+	  (calc-record (if calc-extensions-loaded (car alg-exp) (car nvals))
+		       "alg'")
+	  (calc-pop-push-record-list calc-dollar-used
+				     (and (not (equal (car alg-exp)
+						      (car nvals)))
+					  calc-extensions-loaded
+					  "")
+				     (list (car nvals)))
+	  (setq alg-exp (cdr alg-exp)
+		nvals (cdr nvals)
+		calc-dollar-used 0)))
+      (calc-handle-whys)))
+)
+
+(defun calc-do-alg-entry (&optional initial prompt no-normalize)
+  (let* ((calc-buffer (current-buffer))
+	 (blink-paren-hook 'calcAlg-blink-matching-open)
+	 (alg-exp 'error))
+    (if (boundp 'calc-alg-ent-map)
+	()
+      (setq calc-alg-ent-map (copy-keymap minibuffer-local-map))
+      (define-key calc-alg-ent-map "'" 'calcAlg-previous)
+      (define-key calc-alg-ent-map "`" 'calcAlg-edit)
+      (define-key calc-alg-ent-map "\C-m" 'calcAlg-enter)
+      (define-key calc-alg-ent-map "\C-j" 'calcAlg-enter)
+      (or calc-emacs-type-19
+	  (let ((i 33))
+	    (setq calc-alg-ent-esc-map (copy-sequence esc-map))
+	    (while (< i 127)
+	      (aset calc-alg-ent-esc-map i 'calcAlg-escape)
+	      (setq i (1+ i))))))
+    (or calc-emacs-type-19
+	(define-key calc-alg-ent-map "\e" nil))
+    (if (eq calc-algebraic-mode 'total)
+	(define-key calc-alg-ent-map "\e" calc-alg-ent-esc-map)
+      (define-key calc-alg-ent-map "\ep" 'calcAlg-plus-minus)
+      (define-key calc-alg-ent-map "\em" 'calcAlg-mod)
+      (define-key calc-alg-ent-map "\e=" 'calcAlg-equals)
+      (define-key calc-alg-ent-map "\e\r" 'calcAlg-equals)
+      (define-key calc-alg-ent-map "\e%" 'self-insert-command))
+    (setq calc-aborted-prefix nil)
+    (let ((buf (read-from-minibuffer (or prompt "Algebraic: ")
+				     (or initial "")
+				     calc-alg-ent-map nil)))
+      (if (eq alg-exp 'error)
+	  (if (eq (car-safe (setq alg-exp (math-read-exprs buf))) 'error)
+	      (setq alg-exp nil)))
+      (setq calc-aborted-prefix "alg'")
+      (or no-normalize
+	  (and alg-exp (setq alg-exp (mapcar 'calc-normalize alg-exp))))
+      alg-exp))
+)
+
+(defun calcAlg-plus-minus ()
+  (interactive)
+  (if (calc-minibuffer-contains ".* \\'")
+      (insert "+/- ")
+    (insert " +/- "))
+)
+
+(defun calcAlg-mod ()
+  (interactive)
+  (if (not (calc-minibuffer-contains ".* \\'"))
+      (insert " "))
+  (if (calc-minibuffer-contains ".* mod +\\'")
+      (if calc-previous-modulo
+	  (insert (math-format-flat-expr calc-previous-modulo 0))
+	(beep))
+    (insert "mod "))
+)
+
+(defun calcAlg-previous ()
+  (interactive)
+  (if (calc-minibuffer-contains "\\`\\'")
+      (if calc-previous-alg-entry
+	  (insert calc-previous-alg-entry)
+	(beep))
+    (insert "'"))
+)
+
+(defun calcAlg-equals ()
+  (interactive)
+  (unwind-protect
+      (calcAlg-enter)
+    (if (consp alg-exp)
+	(progn (setq prefix-arg (length alg-exp))
+	       (calc-unread-command ?=))))
+)
+
+(defun calcAlg-escape ()
+  (interactive)
+  (calc-unread-command)
+  (save-excursion
+    (calc-select-buffer)
+    (use-local-map calc-mode-map))
+  (calcAlg-enter)
+)
+
+(defun calcAlg-edit ()
+  (interactive)
+  (if (or (not calc-plain-entry)
+	  (calc-minibuffer-contains
+	   "\\`\\([^\"]*\"[^\"]*\"\\)*[^\"]*\"[^\"]*\\'"))
+      (insert "`")
+    (setq alg-exp (buffer-string))
+    (and (> (length alg-exp) 0) (setq calc-previous-alg-entry alg-exp))
+    (exit-minibuffer))
+)
+(setq calc-plain-entry nil)
+
+(defun calcAlg-enter ()