12247 |
@cindex Continuous memory |
@cindex Continuous memory |
12248 |
@cindex Saving mode settings |
@cindex Saving mode settings |
12249 |
@cindex Permanent mode settings |
@cindex Permanent mode settings |
12250 |
@cindex @file{.emacs} file, mode settings |
@cindex Calc init file, mode settings |
12251 |
You can save all of the current mode settings in your @file{.emacs} file |
You can save all of the current mode settings in your Calc init file |
12252 |
with the @kbd{m m} (@code{calc-save-modes}) command. This will cause |
(the file given by the variable @code{calc-settings-file}, typically |
12253 |
Emacs to reestablish these modes each time it starts up. The modes saved |
@file{~/.calc.el}) with the @kbd{m m} (@code{calc-save-modes}) command. |
12254 |
in the file include everything controlled by the @kbd{m} and @kbd{d} |
This will cause Emacs to reestablish these modes each time it starts up. |
12255 |
prefix keys, the current precision and binary word size, whether or not |
The modes saved in the file include everything controlled by the @kbd{m} |
12256 |
the trail is displayed, the current height of the Calc window, and more. |
and @kbd{d} prefix keys, the current precision and binary word size, |
12257 |
The current interface (used when you type @kbd{M-# M-#}) is also saved. |
whether or not the trail is displayed, the current height of the Calc |
12258 |
If there were already saved mode settings in the file, they are replaced. |
window, and more. The current interface (used when you type @kbd{M-# |
12259 |
Otherwise, the new mode information is appended to the end of the file. |
M-#}) is also saved. If there were already saved mode settings in the |
12260 |
|
file, they are replaced. Otherwise, the new mode information is |
12261 |
|
appended to the end of the file. |
12262 |
|
|
12263 |
@kindex m R |
@kindex m R |
12264 |
@pindex calc-mode-record-mode |
@pindex calc-mode-record-mode |
15874 |
Selections show deep structure (@kbd{j b}; @pxref{Making Selections}). |
Selections show deep structure (@kbd{j b}; @pxref{Making Selections}). |
15875 |
|
|
15876 |
@item Save |
@item Save |
15877 |
Record modes in @file{~/.emacs} (@kbd{m R}; @pxref{General Mode Commands}). |
Record modes in @file{~/.calc.el} (@kbd{m R}; @pxref{General Mode Commands}). |
15878 |
|
|
15879 |
@item Local |
@item Local |
15880 |
Record modes in Embedded buffer (@kbd{m R}). |
Record modes in Embedded buffer (@kbd{m R}). |
27761 |
|
|
27762 |
@kindex u p |
@kindex u p |
27763 |
@pindex calc-permanent-units |
@pindex calc-permanent-units |
27764 |
@cindex @file{.emacs} file, user-defined units |
@cindex Calc init file, user-defined units |
27765 |
The @kbd{u p} (@code{calc-permanent-units}) command stores the user-defined |
The @kbd{u p} (@code{calc-permanent-units}) command stores the user-defined |
27766 |
units in your @file{.emacs} file, so that the units will still be |
units in your Calc init file (the file given by the variable |
27767 |
available in subsequent Emacs sessions. If there was already a set of |
@code{calc-settings-file}, typically @file{~/.calc.el}), so that the |
27768 |
user-defined units in your @file{.emacs} file, it is replaced by the |
units will still be available in subsequent Emacs sessions. If there |
27769 |
new set. (@xref{General Mode Commands}, for a way to tell Calc to use |
was already a set of user-defined units in your Calc init file, it |
27770 |
a different file instead of @file{.emacs}.) |
is replaced by the new set. (@xref{General Mode Commands}, for a way to |
27771 |
|
tell Calc to use a different file for the Calc init file.) |
27772 |
|
|
27773 |
@node Store and Recall, Graphics, Units, Top |
@node Store and Recall, Graphics, Units, Top |
27774 |
@chapter Storing and Recalling |
@chapter Storing and Recalling |
28153 |
@pindex calc-permanent-variable |
@pindex calc-permanent-variable |
28154 |
@cindex Storing variables |
@cindex Storing variables |
28155 |
@cindex Permanent variables |
@cindex Permanent variables |
28156 |
@cindex @file{.emacs} file, variables |
@cindex Calc init file, variables |
28157 |
The @kbd{s p} (@code{calc-permanent-variable}) command saves a |
The @kbd{s p} (@code{calc-permanent-variable}) command saves a |
28158 |
variable's value permanently in your @file{.emacs} file, so that its |
variable's value permanently in your Calc init file (the file given by |
28159 |
value will still be available in future Emacs sessions. You can |
the variable @code{calc-settings-file}, typically @file{~/.calc.el}), so |
28160 |
re-execute @w{@kbd{s p}} later on to update the saved value, but the |
that its value will still be available in future Emacs sessions. You |
28161 |
only way to remove a saved variable is to edit your @file{.emacs} file |
can re-execute @w{@kbd{s p}} later on to update the saved value, but the |
28162 |
|
only way to remove a saved variable is to edit your calc init file |
28163 |
by hand. (@xref{General Mode Commands}, for a way to tell Calc to |
by hand. (@xref{General Mode Commands}, for a way to tell Calc to |
28164 |
use a different file instead of @file{.emacs}.) |
use a different file for the Calc init file.) |
28165 |
|
|
28166 |
If you do not specify the name of a variable to save (i.e., |
If you do not specify the name of a variable to save (i.e., |
28167 |
@kbd{s p @key{RET}}), all Calc variables with defined values |
@kbd{s p @key{RET}}), all Calc variables with defined values |
28180 |
The variables are written with the prefix @code{var-} in the form of |
The variables are written with the prefix @code{var-} in the form of |
28181 |
Lisp @code{setq} commands |
Lisp @code{setq} commands |
28182 |
which store the values in string form. You can place these commands |
which store the values in string form. You can place these commands |
28183 |
in your @file{.emacs} buffer if you wish, though in this case it |
in your Calc init file (or @file{.emacs}) if you wish, though in this case it |
28184 |
would be easier to use @kbd{s p @key{RET}}. (Note that @kbd{s i} |
would be easier to use @kbd{s p @key{RET}}. (Note that @kbd{s i} |
28185 |
omits the same set of variables as @w{@kbd{s p @key{RET}}}; the difference |
omits the same set of variables as @w{@kbd{s p @key{RET}}}; the difference |
28186 |
is that @kbd{s i} will store the variables in any buffer, and it also |
is that @kbd{s i} will store the variables in any buffer, and it also |
28367 |
@vindex calc-gnuplot-name |
@vindex calc-gnuplot-name |
28368 |
If you have GNUPLOT installed on your system but Calc is unable to |
If you have GNUPLOT installed on your system but Calc is unable to |
28369 |
find it, you may need to set the @code{calc-gnuplot-name} variable |
find it, you may need to set the @code{calc-gnuplot-name} variable |
28370 |
in your @file{.emacs} file. You may also need to set some Lisp |
in your Calc init file or @file{.emacs}. You may also need to set some Lisp |
28371 |
variables to show Calc how to run GNUPLOT on your system; these |
variables to show Calc how to run GNUPLOT on your system; these |
28372 |
are described under @kbd{g D} and @kbd{g O} below. If you are |
are described under @kbd{g D} and @kbd{g O} below. If you are |
28373 |
using the X window system, Calc will configure GNUPLOT for you |
using the X window system, Calc will configure GNUPLOT for you |
30422 |
|
|
30423 |
Two more mode-recording modes selectable by @kbd{m R} are @code{Save} |
Two more mode-recording modes selectable by @kbd{m R} are @code{Save} |
30424 |
(which works even outside of Embedded mode), in which mode settings |
(which works even outside of Embedded mode), in which mode settings |
30425 |
are recorded permanently in your Emacs startup file @file{~/.emacs} |
are recorded permanently in your Calc init file (the file given by the |
30426 |
|
variable @code{calc-settings-file}, typically @file{~/.calc.el}) |
30427 |
rather than by annotating the current document, and no-recording |
rather than by annotating the current document, and no-recording |
30428 |
mode (where there is no symbol like @code{Save} or @code{Local} in |
mode (where there is no symbol like @code{Save} or @code{Local} in |
30429 |
the mode line), in which mode-changing commands do not leave any |
the mode line), in which mode-changing commands do not leave any |
30439 |
You can modify Embedded mode's behavior by setting various Lisp |
You can modify Embedded mode's behavior by setting various Lisp |
30440 |
variables described here. Use @kbd{M-x set-variable} or |
variables described here. Use @kbd{M-x set-variable} or |
30441 |
@kbd{M-x edit-options} to adjust a variable on the fly, or |
@kbd{M-x edit-options} to adjust a variable on the fly, or |
30442 |
put a suitable @code{setq} statement in your @file{~/.emacs} |
put a suitable @code{setq} statement in your Calc init file (or |
30443 |
file to set a variable permanently. (Another possibility would |
@file{~/.emacs}) to set a variable permanently. (Another possibility would |
30444 |
be to use a file-local variable annotation at the end of the |
be to use a file-local variable annotation at the end of the |
30445 |
file; @pxref{File Variables, , Local Variables in Files, emacs, the |
file; @pxref{File Variables, , Local Variables in Files, emacs, the |
30446 |
Emacs manual}.) |
Emacs manual}.) |
30678 |
@pindex calc-user-define-permanent |
@pindex calc-user-define-permanent |
30679 |
@cindex Storing user definitions |
@cindex Storing user definitions |
30680 |
@cindex Permanent user definitions |
@cindex Permanent user definitions |
30681 |
@cindex @file{.emacs} file, user-defined commands |
@cindex Calc init file, user-defined commands |
30682 |
The @kbd{Z P} (@code{calc-user-define-permanent}) command makes a key |
The @kbd{Z P} (@code{calc-user-define-permanent}) command makes a key |
30683 |
binding permanent so that it will remain in effect even in future Emacs |
binding permanent so that it will remain in effect even in future Emacs |
30684 |
sessions. (It does this by adding a suitable bit of Lisp code into |
sessions. (It does this by adding a suitable bit of Lisp code into |
30685 |
your @file{.emacs} file.) For example, @kbd{Z P s} would register |
your Calc init file; that is, the file given by the variable |
30686 |
our @code{sincos} command permanently. If you later wish to unregister |
@code{calc-settings-file}, typically @file{~/.calc.el}.) For example, |
30687 |
this command you must edit your @file{.emacs} file by hand. |
@kbd{Z P s} would register our @code{sincos} command permanently. If |
30688 |
(@xref{General Mode Commands}, for a way to tell Calc to use a |
you later wish to unregister this command you must edit your Calc init |
30689 |
different file instead of @file{.emacs}.) |
file by hand. (@xref{General Mode Commands}, for a way to tell Calc to |
30690 |
|
use a different file for the Calc init file.) |
30691 |
|
|
30692 |
The @kbd{Z P} command also saves the user definition, if any, for the |
The @kbd{Z P} command also saves the user definition, if any, for the |
30693 |
command bound to the key. After @kbd{Z F} and @kbd{Z C}, a given user |
command bound to the key. After @kbd{Z F} and @kbd{Z C}, a given user |
31402 |
:"n * myfact(n-1)" |
:"n * myfact(n-1)" |
31403 |
@end example |
@end example |
31404 |
|
|
31405 |
|
A good place to put your @code{defmath} commands is your Calc init file |
31406 |
|
(the file given by @code{calc-settings-file}, typically |
31407 |
|
@file{~/.calc.el}), which will not be loaded until Calc starts. |
31408 |
If a file named @file{.emacs} exists in your home directory, Emacs reads |
If a file named @file{.emacs} exists in your home directory, Emacs reads |
31409 |
and executes the Lisp forms in this file as it starts up. While it may |
and executes the Lisp forms in this file as it starts up. While it may |
31410 |
seem like a good idea to put your favorite @code{defmath} commands here, |
seem reasonable to put your favorite @code{defmath} commands there, |
31411 |
this has the unfortunate side-effect that parts of the Calculator must be |
this has the unfortunate side-effect that parts of the Calculator must be |
31412 |
loaded in to process the @code{defmath} commands whether or not you will |
loaded in to process the @code{defmath} commands whether or not you will |
31413 |
actually use the Calculator! A better effect can be had by writing |
actually use the Calculator! If you want to put the @code{defmath} |
31414 |
|
commands there (for example, if you redefine @code{calc-settings-file} |
31415 |
|
to be @file{.emacs}), a better effect can be had by writing |
31416 |
|
|
31417 |
@example |
@example |
31418 |
(put 'calc-define 'thing '(progn |
(put 'calc-define 'thing '(progn |
34365 |
@defvar calc-mode-save-hook |
@defvar calc-mode-save-hook |
34366 |
This hook is called by the @code{calc-save-modes} command, |
This hook is called by the @code{calc-save-modes} command, |
34367 |
after Calc's own mode features have been inserted into the |
after Calc's own mode features have been inserted into the |
34368 |
@file{.emacs} buffer and just before the ``End of mode settings'' |
Calc init file and just before the ``End of mode settings'' |
34369 |
message is inserted. |
message is inserted. |
34370 |
@end defvar |
@end defvar |
34371 |
|
|
35856 |
corresponding Lisp variable. |
corresponding Lisp variable. |
35857 |
|
|
35858 |
The remaining variables are Lisp variables suitable for @code{setq}ing |
The remaining variables are Lisp variables suitable for @code{setq}ing |
35859 |
in your @file{.emacs} file. |
in your Calc init file or @file{.emacs} file. |
35860 |
|
|
35861 |
@printindex vr |
@printindex vr |
35862 |
|
|