diff options
| author | Jay Belanger | 2004-12-27 05:11:37 +0000 |
|---|---|---|
| committer | Jay Belanger | 2004-12-27 05:11:37 +0000 |
| commit | 4f38ed98eb490a3ee9d1c017b9f95fe13b95dae8 (patch) | |
| tree | 8027bec6a6b8d9d8d11a8a03f52ce4fdddac50ae | |
| parent | 8cdb7a173da588c23453e9af386ed3c53b00ef7d (diff) | |
| download | emacs-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.texi | 51 |
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 | |||
| 11712 | variable is really just an Emacs Lisp variable that contains a Calc number | 11712 | variable is really just an Emacs Lisp variable that contains a Calc number |
| 11713 | or formula.) A variable's name is normally composed of letters and digits. | 11713 | or formula.) A variable's name is normally composed of letters and digits. |
| 11714 | Calc also allows apostrophes and @code{#} signs in variable names. | 11714 | Calc also allows apostrophes and @code{#} signs in variable names. |
| 11715 | The 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 |
| 11717 | on variables can be made to use any arbitrary Lisp variable simply by | 11717 | Lisp, you don't need to worry about it.) |
| 11718 | backspacing over the @samp{var-} prefix in the minibuffer. | ||
| 11719 | 11718 | ||
| 11720 | In a command that takes a variable name, you can either type the full | 11719 | In a command that takes a variable name, you can either type the full |
| 11721 | name of a variable, or type a single digit to use one of the special | 11720 | name of a variable, or type a single digit to use one of the special |
| 11722 | convenience variables @code{var-q0} through @code{var-q9}. For example, | 11721 | convenience 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 | ||
| 11727 | To push a variable itself (as opposed to the variable's value) on the | 11726 | To push a variable itself (as opposed to the variable's value) on the |
| 11728 | stack, enter its name as an algebraic expression using the apostrophe | 11727 | stack, enter its name as an algebraic expression using the apostrophe |
| 11729 | (@key{'}) key. Variable names in algebraic formulas implicitly have | 11728 | (@key{'}) key. |
| 11729 | |||
| 11730 | xxx | ||
| 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 |
| 11731 | names used in algebraic formulas corresponds to a dash @samp{-} in the | 11733 | names used in algebraic formulas corresponds to a dash @samp{-} in the |
| 11732 | Lisp variable name. If the name contains any dashes, the prefix @samp{var-} | 11734 | Lisp 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 | |||
| 14139 | turn into the @code{assign} function, which Calc normally displays | 14141 | turn into the @code{assign} function, which Calc normally displays |
| 14140 | using the @samp{:=} symbol. | 14142 | using the @samp{:=} symbol. |
| 14141 | 14143 | ||
| 14142 | The variables @code{var-pi} and @code{var-e} would be displayed @samp{pi} | 14144 | The variables @code{pi} and @code{e} would be displayed @samp{pi} |
| 14143 | and @samp{e} in Normal mode, but in C mode they are displayed as | 14145 | and @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 |
| 14145 | typically provided in the @file{<math.h>} header. Functions whose | 14147 | typically provided in the @file{<math.h>} header. Functions whose |
| @@ -17220,7 +17222,9 @@ the corresponding generalized time zone (like @code{PGT}). | |||
| 17220 | 17222 | ||
| 17221 | If your system does not have a suitable @samp{date} command, you | 17223 | If your system does not have a suitable @samp{date} command, you |
| 17222 | may wish to put a @samp{(setq var-TimeZone ...)} in your Emacs | 17224 | may wish to put a @samp{(setq var-TimeZone ...)} in your Emacs |
| 17223 | initialization file to set the time zone. The easiest way to do | 17225 | initialization file to set the time zone. (Since you are interacting |
| 17226 | with the variable @code{TimeZone} directly from Emacs Lisp, the | ||
| 17227 | @code{var-} prefix needs to be present.) The easiest way to do | ||
| 17224 | this is to edit the @code{TimeZone} variable using Calc's @kbd{s T} | 17228 | this is to edit the @code{TimeZone} variable using Calc's @kbd{s T} |
| 17225 | command, then use the @kbd{s p} (@code{calc-permanent-variable}) | 17229 | command, then use the @kbd{s p} (@code{calc-permanent-variable}) |
| 17226 | command to save the value of @code{TimeZone} permanently. | 17230 | command to save the value of @code{TimeZone} permanently. |
| @@ -27847,14 +27851,8 @@ to variables use the @kbd{s} prefix key. | |||
| 27847 | The @kbd{s s} (@code{calc-store}) command stores the value at the top of | 27851 | The @kbd{s s} (@code{calc-store}) command stores the value at the top of |
| 27848 | the stack into a specified variable. It prompts you to enter the | 27852 | the stack into a specified variable. It prompts you to enter the |
| 27849 | name of the variable. If you press a single digit, the value is stored | 27853 | name of the variable. If you press a single digit, the value is stored |
| 27850 | immediately in one of the ``quick'' variables @code{var-q0} through | 27854 | immediately 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. |
| 27852 | is supplied for you; when a name appears in a formula (as in @samp{a+q2}) | ||
| 27853 | the prefix @samp{var-} is also supplied there, so normally you can simply | ||
| 27854 | forget about @samp{var-} everywhere. Its only purpose is to enable you to | ||
| 27855 | use Calc variables without fear of accidentally clobbering some variable in | ||
| 27856 | another Emacs package. If you really want to store in an arbitrary Lisp | ||
| 27857 | variable, 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 | |||
| 28038 | special variables @code{inf}, @code{uinf}, and @code{nan} (which are | 28036 | special variables @code{inf}, @code{uinf}, and @code{nan} (which are |
| 28039 | normally void). | 28037 | normally void). |
| 28040 | 28038 | ||
| 28041 | Note that @code{var-pi} doesn't actually have 3.14159265359 stored | 28039 | Note that @code{pi} doesn't actually have 3.14159265359 stored |
| 28042 | in it, but rather a special magic value that evaluates to @cpi{} | 28040 | in it, but rather a special magic value that evaluates to @cpi{} |
| 28043 | at the current precision. Likewise @code{var-e}, @code{var-i}, and | 28041 | at 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. |
| 28045 | If you recall a value from @code{pi} and store it back, this magic | 28043 | If you recall a value from @code{pi} and store it back, this magic |
| 28046 | property will be lost. | 28044 | property will be lost. |
| 28047 | 28045 | ||
| @@ -28052,9 +28050,9 @@ value of one variable to another. It differs from a simple @kbd{s r} | |||
| 28052 | followed by an @kbd{s t} in two important ways. First, the value never | 28050 | followed by an @kbd{s t} in two important ways. First, the value never |
| 28053 | goes on the stack and thus is never rounded, evaluated, or simplified | 28051 | goes on the stack and thus is never rounded, evaluated, or simplified |
| 28054 | in any way; it is not even rounded down to the current precision. | 28052 | in any way; it is not even rounded down to the current precision. |
| 28055 | Second, the ``magic'' contents of a variable like @code{var-e} can | 28053 | Second, the ``magic'' contents of a variable like @code{e} can |
| 28056 | be copied into another variable with this command, perhaps because | 28054 | be copied into another variable with this command, perhaps because |
| 28057 | you need to unstore @code{var-e} right now but you wish to put it | 28055 | you need to unstore @code{e} right now but you wish to put it |
| 28058 | back when you're done. The @kbd{s c} command is the only way to | 28056 | back when you're done. The @kbd{s c} command is the only way to |
| 28059 | manipulate these magic values intact. | 28057 | manipulate these magic values intact. |
| 28060 | 28058 | ||
| @@ -28216,7 +28214,7 @@ by hand. (@xref{General Mode Commands}, for a way to tell Calc to | |||
| 28216 | use a different file instead of @file{.emacs}.) | 28214 | use a different file instead of @file{.emacs}.) |
| 28217 | 28215 | ||
| 28218 | If you do not specify the name of a variable to save (i.e., | 28216 | If 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 |
| 28220 | are saved except for the special constants @code{pi}, @code{e}, | 28218 | are 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} |
| 28222 | and @code{PlotRejects}; | 28220 | and @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 |
| 28230 | The @kbd{s i} (@code{calc-insert-variables}) command writes | 28228 | The @kbd{s i} (@code{calc-insert-variables}) command writes |
| 28231 | the values of all @samp{var-} variables into a specified buffer. | 28229 | the values of all Calc variables into a specified buffer. |
| 28232 | The variables are written in the form of Lisp @code{setq} commands | 28230 | The variables are written with the prefix @code{var-} in the form of |
| 28231 | Lisp @code{setq} commands | ||
| 28233 | which store the values in string form. You can place these commands | 28232 | which store the values in string form. You can place these commands |
| 28234 | in your @file{.emacs} buffer if you wish, though in this case it | 28233 | in your @file{.emacs} buffer if you wish, though in this case it |
| 28235 | would be easier to use @kbd{s p @key{RET}}. (Note that @kbd{s i} | 28234 | would be easier to use @kbd{s p @key{RET}}. (Note that @kbd{s i} |