aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Belanger2004-12-27 05:11:37 +0000
committerJay Belanger2004-12-27 05:11:37 +0000
commit4f38ed98eb490a3ee9d1c017b9f95fe13b95dae8 (patch)
tree8027bec6a6b8d9d8d11a8a03f52ce4fdddac50ae
parent8cdb7a173da588c23453e9af386ed3c53b00ef7d (diff)
downloademacs-4f38ed98eb490a3ee9d1c017b9f95fe13b95dae8.tar.gz
emacs-4f38ed98eb490a3ee9d1c017b9f95fe13b95dae8.zip
(Variables, Time Zones, Storing Variables, Other Operations On Variables):
Mention that var- prefix for variable names is only in Lisp.
-rw-r--r--man/calc.texi51
1 files changed, 25 insertions, 26 deletions
diff --git a/man/calc.texi b/man/calc.texi
index 8260ed10350..c4affa649f3 100644
--- a/man/calc.texi
+++ b/man/calc.texi
@@ -11712,21 +11712,23 @@ calculator, and a variable in a programming language. (In fact, a Calc
11712variable is really just an Emacs Lisp variable that contains a Calc number 11712variable is really just an Emacs Lisp variable that contains a Calc number
11713or formula.) A variable's name is normally composed of letters and digits. 11713or formula.) A variable's name is normally composed of letters and digits.
11714Calc also allows apostrophes and @code{#} signs in variable names. 11714Calc also allows apostrophes and @code{#} signs in variable names.
11715The Calc variable @code{foo} corresponds to the Emacs Lisp variable 11715(The Calc variable @code{foo} corresponds to the Emacs Lisp variable
11716@code{var-foo}. Commands like @kbd{s s} (@code{calc-store}) that operate 11716@code{var-foo}, but unless you access the variable from within Emacs
11717on variables can be made to use any arbitrary Lisp variable simply by 11717Lisp, you don't need to worry about it.)
11718backspacing over the @samp{var-} prefix in the minibuffer.
11719 11718
11720In a command that takes a variable name, you can either type the full 11719In a command that takes a variable name, you can either type the full
11721name of a variable, or type a single digit to use one of the special 11720name of a variable, or type a single digit to use one of the special
11722convenience variables @code{var-q0} through @code{var-q9}. For example, 11721convenience variables @code{q0} through @code{q9}. For example,
11723@kbd{3 s s 2} stores the number 3 in variable @code{var-q2}, and 11722@kbd{3 s s 2} stores the number 3 in variable @code{q2}, and
11724@w{@kbd{3 s s foo @key{RET}}} stores that number in variable 11723@w{@kbd{3 s s foo @key{RET}}} stores that number in variable
11725@code{var-foo}. 11724@code{foo}.
11726 11725
11727To push a variable itself (as opposed to the variable's value) on the 11726To push a variable itself (as opposed to the variable's value) on the
11728stack, enter its name as an algebraic expression using the apostrophe 11727stack, enter its name as an algebraic expression using the apostrophe
11729(@key{'}) key. Variable names in algebraic formulas implicitly have 11728(@key{'}) key.
11729
11730xxx
11731 Variable names in algebraic formulas implicitly have
11730@samp{var-} prefixed to their names. The @samp{#} character in variable 11732@samp{var-} prefixed to their names. The @samp{#} character in variable
11731names used in algebraic formulas corresponds to a dash @samp{-} in the 11733names used in algebraic formulas corresponds to a dash @samp{-} in the
11732Lisp variable name. If the name contains any dashes, the prefix @samp{var-} 11734Lisp variable name. If the name contains any dashes, the prefix @samp{var-}
@@ -14139,7 +14141,7 @@ mode is the same as @samp{a_i} in Normal mode. Assignments
14139turn into the @code{assign} function, which Calc normally displays 14141turn into the @code{assign} function, which Calc normally displays
14140using the @samp{:=} symbol. 14142using the @samp{:=} symbol.
14141 14143
14142The variables @code{var-pi} and @code{var-e} would be displayed @samp{pi} 14144The variables @code{pi} and @code{e} would be displayed @samp{pi}
14143and @samp{e} in Normal mode, but in C mode they are displayed as 14145and @samp{e} in Normal mode, but in C mode they are displayed as
14144@samp{M_PI} and @samp{M_E}, corresponding to the names of constants 14146@samp{M_PI} and @samp{M_E}, corresponding to the names of constants
14145typically provided in the @file{<math.h>} header. Functions whose 14147typically provided in the @file{<math.h>} header. Functions whose
@@ -17220,7 +17222,9 @@ the corresponding generalized time zone (like @code{PGT}).
17220 17222
17221If your system does not have a suitable @samp{date} command, you 17223If your system does not have a suitable @samp{date} command, you
17222may wish to put a @samp{(setq var-TimeZone ...)} in your Emacs 17224may wish to put a @samp{(setq var-TimeZone ...)} in your Emacs
17223initialization file to set the time zone. The easiest way to do 17225initialization file to set the time zone. (Since you are interacting
17226with the variable @code{TimeZone} directly from Emacs Lisp, the
17227@code{var-} prefix needs to be present.) The easiest way to do
17224this is to edit the @code{TimeZone} variable using Calc's @kbd{s T} 17228this is to edit the @code{TimeZone} variable using Calc's @kbd{s T}
17225command, then use the @kbd{s p} (@code{calc-permanent-variable}) 17229command, then use the @kbd{s p} (@code{calc-permanent-variable})
17226command to save the value of @code{TimeZone} permanently. 17230command to save the value of @code{TimeZone} permanently.
@@ -27847,14 +27851,8 @@ to variables use the @kbd{s} prefix key.
27847The @kbd{s s} (@code{calc-store}) command stores the value at the top of 27851The @kbd{s s} (@code{calc-store}) command stores the value at the top of
27848the stack into a specified variable. It prompts you to enter the 27852the stack into a specified variable. It prompts you to enter the
27849name of the variable. If you press a single digit, the value is stored 27853name of the variable. If you press a single digit, the value is stored
27850immediately in one of the ``quick'' variables @code{var-q0} through 27854immediately in one of the ``quick'' variables @code{q0} through
27851@code{var-q9}. Or you can enter any variable name. The prefix @samp{var-} 27855@code{q9}. Or you can enter any variable name.
27852is supplied for you; when a name appears in a formula (as in @samp{a+q2})
27853the prefix @samp{var-} is also supplied there, so normally you can simply
27854forget about @samp{var-} everywhere. Its only purpose is to enable you to
27855use Calc variables without fear of accidentally clobbering some variable in
27856another Emacs package. If you really want to store in an arbitrary Lisp
27857variable, just backspace over the @samp{var-}.
27858 27856
27859@kindex s t 27857@kindex s t
27860@pindex calc-store-into 27858@pindex calc-store-into
@@ -28038,10 +28036,10 @@ you change the value of one of these variables, or of one of the other
28038special variables @code{inf}, @code{uinf}, and @code{nan} (which are 28036special variables @code{inf}, @code{uinf}, and @code{nan} (which are
28039normally void). 28037normally void).
28040 28038
28041Note that @code{var-pi} doesn't actually have 3.14159265359 stored 28039Note that @code{pi} doesn't actually have 3.14159265359 stored
28042in it, but rather a special magic value that evaluates to @cpi{} 28040in it, but rather a special magic value that evaluates to @cpi{}
28043at the current precision. Likewise @code{var-e}, @code{var-i}, and 28041at the current precision. Likewise @code{e}, @code{i}, and
28044@code{var-phi} evaluate according to the current precision or polar mode. 28042@code{phi} evaluate according to the current precision or polar mode.
28045If you recall a value from @code{pi} and store it back, this magic 28043If you recall a value from @code{pi} and store it back, this magic
28046property will be lost. 28044property will be lost.
28047 28045
@@ -28052,9 +28050,9 @@ value of one variable to another. It differs from a simple @kbd{s r}
28052followed by an @kbd{s t} in two important ways. First, the value never 28050followed by an @kbd{s t} in two important ways. First, the value never
28053goes on the stack and thus is never rounded, evaluated, or simplified 28051goes on the stack and thus is never rounded, evaluated, or simplified
28054in any way; it is not even rounded down to the current precision. 28052in any way; it is not even rounded down to the current precision.
28055Second, the ``magic'' contents of a variable like @code{var-e} can 28053Second, the ``magic'' contents of a variable like @code{e} can
28056be copied into another variable with this command, perhaps because 28054be copied into another variable with this command, perhaps because
28057you need to unstore @code{var-e} right now but you wish to put it 28055you need to unstore @code{e} right now but you wish to put it
28058back when you're done. The @kbd{s c} command is the only way to 28056back when you're done. The @kbd{s c} command is the only way to
28059manipulate these magic values intact. 28057manipulate these magic values intact.
28060 28058
@@ -28216,7 +28214,7 @@ by hand. (@xref{General Mode Commands}, for a way to tell Calc to
28216use a different file instead of @file{.emacs}.) 28214use a different file instead of @file{.emacs}.)
28217 28215
28218If you do not specify the name of a variable to save (i.e., 28216If you do not specify the name of a variable to save (i.e.,
28219@kbd{s p @key{RET}}), all @samp{var-} variables with defined values 28217@kbd{s p @key{RET}}), all Calc variables with defined values
28220are saved except for the special constants @code{pi}, @code{e}, 28218are saved except for the special constants @code{pi}, @code{e},
28221@code{i}, @code{phi}, and @code{gamma}; the variables @code{TimeZone} 28219@code{i}, @code{phi}, and @code{gamma}; the variables @code{TimeZone}
28222and @code{PlotRejects}; 28220and @code{PlotRejects};
@@ -28228,8 +28226,9 @@ explicitly naming them in an @kbd{s p} command.)
28228@kindex s i 28226@kindex s i
28229@pindex calc-insert-variables 28227@pindex calc-insert-variables
28230The @kbd{s i} (@code{calc-insert-variables}) command writes 28228The @kbd{s i} (@code{calc-insert-variables}) command writes
28231the values of all @samp{var-} variables into a specified buffer. 28229the values of all Calc variables into a specified buffer.
28232The variables are written in the form of Lisp @code{setq} commands 28230The variables are written with the prefix @code{var-} in the form of
28231Lisp @code{setq} commands
28233which store the values in string form. You can place these commands 28232which store the values in string form. You can place these commands
28234in your @file{.emacs} buffer if you wish, though in this case it 28233in your @file{.emacs} buffer if you wish, though in this case it
28235would be easier to use @kbd{s p @key{RET}}. (Note that @kbd{s i} 28234would be easier to use @kbd{s p @key{RET}}. (Note that @kbd{s i}