www.delorie.com/gnu/docs/calc/calc_298.html   search  
 
Buy the book!


GNU Emacs Calc 2.02 Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.3 Other Operations on Variables

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 M-# M-# to finish, the variable will be made void. See section 6.2 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)', where x will someday become some expression involving y; if you let Calc evaluate the rule while you are defining it, Calc will replace `deriv(x,y)' with 0 because the formula x does 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:

s A
Edit AlgSimpRules. See section 11.3.2 Algebraic Simplifications.
s D
Edit Decls. See section 7.6 Declarations.
s E
Edit EvalRules. See section 11.3.1 Default Simplifications.
s F
Edit FitRules. See section 11.8 Curve Fitting.
s G
Edit GenCount. See section 11.6 Solving Equations.
s H
Edit Holidays. See section 8.5.3 Business Days.
s I
Edit IntegLimit. See section 11.5 Calculus.
s L
Edit LineStyles. See section 14. Graphics.
s P
Edit PointStyles. See section 14. Graphics.
s R
Edit PlotRejects. See section 14. Graphics.
s T
Edit TimeZone. See section 8.5.4 Time Zones.
s U
Edit Units. See section 12.4 User-Defined Units.
s X
Edit ExtSimpRules. See section 11.3.3 "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 `.emacs' file, 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 `.emacs' file by hand. (See section 7.1 General Mode Commands, for a way to tell Calc to use a different file instead of `.emacs'.)

If you do not specify the name of a variable to save (i.e., s p RET), all `var-' variables with defined values are saved except for the special constants pi, e, i, phi, and gamma; the variables TimeZone and PlotRejects; FitRules, DistribRules, and other built-in rewrite rules; and 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 `var-' variables into a specified buffer. The variables are written in the form of Lisp setq commands which store the values in string form. You can place these commands in your `.emacs' buffer 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.)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003