The s e (
calc-edit-variable) command edits the stored
value of a variable without ever putting that value on the stack
or simplifying or evaluating the value. It prompts for the name of
the variable to edit. If the variable has no stored value, the
editing buffer will start out empty. If the editing buffer is
empty when you press C-c C-c to finish, the variable will
be made void. See Editing Stack Entries, for a general
description of editing.
The s e command is especially useful for creating and editing
rewrite rules which are stored in variables. Sometimes these rules
contain formulas which must not be evaluated until the rules are
actually used. (For example, they may refer to ‘deriv(x,y)’,
x will someday become some expression involving
if you let Calc evaluate the rule while you are defining it, Calc will
replace ‘deriv(x,y)’ with 0 because the formula
not itself refer to
y.) By contrast, recalling the variable,
editing with `, and storing will evaluate the variable’s value
as a side effect of putting the value on the stack.
There are several special-purpose variable-editing commands that use the s prefix followed by a shifted letter:
AlgSimpRules. See Algebraic Simplifications.
Decls. See Declarations.
EvalRules. See Basic Simplifications.
FitRules. See Curve Fitting.
GenCount. See Solving Equations.
Holidays. See Business Days.
IntegLimit. See Calculus.
LineStyles. See Graphics.
PointStyles. See Graphics.
PlotRejects. See Graphics.
TimeZone. See Time Zones.
Units. See User-Defined Units.
ExtSimpRules. See Unsafe Simplifications.
These commands are just versions of s e that use fixed variable names rather than prompting for the variable name.
The s p (
calc-permanent-variable) command saves a
variable’s value permanently in your Calc init file (the file given by
calc-settings-file, typically ~/.emacs.d/calc.el), so
that its value will still be available in future Emacs sessions. You
can re-execute s p later on to update the saved value, but the
only way to remove a saved variable is to edit your calc init file
by hand. (See General Mode Commands, for a way to tell Calc to
use a different file for the Calc init file.)
If you do not specify the name of a variable to save (i.e.,
s p RET), all Calc variables with defined values
are saved except for the special constants
gamma; the variables
DistribRules, and other built-in rewrite
PlotDatan variables generated
by the graphics commands. (You can still save these variables by
explicitly naming them in an s p command.)
The s i (
calc-insert-variables) command writes
the values of all Calc variables into a specified buffer.
The variables are written with the prefix
var- in the form of
which store the values in string form. You can place these commands
in your Calc init file (or .emacs) if you wish, though in this case it
would be easier to use s p RET. (Note that s i
omits the same set of variables as s p RET; the difference
is that s i will store the variables in any buffer, and it also
stores in a more human-readable format.)