Mercurial > emacs
comparison man/calc.texi @ 59425:e33735d47392
Changed references to .emacs to Calc init file.
author | Jay Belanger <jay.p.belanger@gmail.com> |
---|---|
date | Sat, 08 Jan 2005 20:45:53 +0000 |
parents | 08f6c11de799 |
children | 6db9f450786b |
comparison
equal
deleted
inserted
replaced
59424:1c4ad61afb54 | 59425:e33735d47392 |
---|---|
12245 @kindex m m | 12245 @kindex m m |
12246 @pindex calc-save-modes | 12246 @pindex calc-save-modes |
12247 @cindex Continuous memory | 12247 @cindex Continuous memory |
12248 @cindex Saving mode settings | 12248 @cindex Saving mode settings |
12249 @cindex Permanent mode settings | 12249 @cindex Permanent mode settings |
12250 @cindex @file{.emacs} file, mode settings | 12250 @cindex Calc init file, mode settings |
12251 You can save all of the current mode settings in your @file{.emacs} file | 12251 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 | 12252 (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 | 12253 @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} | 12254 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 | 12255 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. | 12256 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. | 12257 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. | 12258 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. | 12259 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. | |
12260 | 12262 |
12261 @kindex m R | 12263 @kindex m R |
12262 @pindex calc-mode-record-mode | 12264 @pindex calc-mode-record-mode |
12263 The @kbd{m R} (@code{calc-mode-record-mode}) command tells Calc to | 12265 The @kbd{m R} (@code{calc-mode-record-mode}) command tells Calc to |
12264 record the new mode settings (as if by pressing @kbd{m m}) every | 12266 record the new mode settings (as if by pressing @kbd{m m}) every |
15870 | 15872 |
15871 @item Break | 15873 @item Break |
15872 Selections show deep structure (@kbd{j b}; @pxref{Making Selections}). | 15874 Selections show deep structure (@kbd{j b}; @pxref{Making Selections}). |
15873 | 15875 |
15874 @item Save | 15876 @item Save |
15875 Record modes in @file{~/.emacs} (@kbd{m R}; @pxref{General Mode Commands}). | 15877 Record modes in @file{~/.calc.el} (@kbd{m R}; @pxref{General Mode Commands}). |
15876 | 15878 |
15877 @item Local | 15879 @item Local |
15878 Record modes in Embedded buffer (@kbd{m R}). | 15880 Record modes in Embedded buffer (@kbd{m R}). |
15879 | 15881 |
15880 @item LocEdit | 15882 @item LocEdit |
27757 Temperature units are treated specially inside the Calculator; it is not | 27759 Temperature units are treated specially inside the Calculator; it is not |
27758 possible to create user-defined temperature units. | 27760 possible to create user-defined temperature units. |
27759 | 27761 |
27760 @kindex u p | 27762 @kindex u p |
27761 @pindex calc-permanent-units | 27763 @pindex calc-permanent-units |
27762 @cindex @file{.emacs} file, user-defined units | 27764 @cindex Calc init file, user-defined units |
27763 The @kbd{u p} (@code{calc-permanent-units}) command stores the user-defined | 27765 The @kbd{u p} (@code{calc-permanent-units}) command stores the user-defined |
27764 units in your @file{.emacs} file, so that the units will still be | 27766 units in your Calc init file (the file given by the variable |
27765 available in subsequent Emacs sessions. If there was already a set of | 27767 @code{calc-settings-file}, typically @file{~/.calc.el}), so that the |
27766 user-defined units in your @file{.emacs} file, it is replaced by the | 27768 units will still be available in subsequent Emacs sessions. If there |
27767 new set. (@xref{General Mode Commands}, for a way to tell Calc to use | 27769 was already a set of user-defined units in your Calc init file, it |
27768 a different file instead of @file{.emacs}.) | 27770 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.) | |
27769 | 27772 |
27770 @node Store and Recall, Graphics, Units, Top | 27773 @node Store and Recall, Graphics, Units, Top |
27771 @chapter Storing and Recalling | 27774 @chapter Storing and Recalling |
27772 | 27775 |
27773 @noindent | 27776 @noindent |
28148 | 28151 |
28149 @kindex s p | 28152 @kindex s p |
28150 @pindex calc-permanent-variable | 28153 @pindex calc-permanent-variable |
28151 @cindex Storing variables | 28154 @cindex Storing variables |
28152 @cindex Permanent variables | 28155 @cindex Permanent variables |
28153 @cindex @file{.emacs} file, variables | 28156 @cindex Calc init file, variables |
28154 The @kbd{s p} (@code{calc-permanent-variable}) command saves a | 28157 The @kbd{s p} (@code{calc-permanent-variable}) command saves a |
28155 variable's value permanently in your @file{.emacs} file, so that its | 28158 variable's value permanently in your Calc init file (the file given by |
28156 value will still be available in future Emacs sessions. You can | 28159 the variable @code{calc-settings-file}, typically @file{~/.calc.el}), so |
28157 re-execute @w{@kbd{s p}} later on to update the saved value, but the | 28160 that its value will still be available in future Emacs sessions. You |
28158 only way to remove a saved variable is to edit your @file{.emacs} file | 28161 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 | |
28159 by hand. (@xref{General Mode Commands}, for a way to tell Calc to | 28163 by hand. (@xref{General Mode Commands}, for a way to tell Calc to |
28160 use a different file instead of @file{.emacs}.) | 28164 use a different file for the Calc init file.) |
28161 | 28165 |
28162 If you do not specify the name of a variable to save (i.e., | 28166 If you do not specify the name of a variable to save (i.e., |
28163 @kbd{s p @key{RET}}), all Calc variables with defined values | 28167 @kbd{s p @key{RET}}), all Calc variables with defined values |
28164 are saved except for the special constants @code{pi}, @code{e}, | 28168 are saved except for the special constants @code{pi}, @code{e}, |
28165 @code{i}, @code{phi}, and @code{gamma}; the variables @code{TimeZone} | 28169 @code{i}, @code{phi}, and @code{gamma}; the variables @code{TimeZone} |
28174 The @kbd{s i} (@code{calc-insert-variables}) command writes | 28178 The @kbd{s i} (@code{calc-insert-variables}) command writes |
28175 the values of all Calc variables into a specified buffer. | 28179 the values of all Calc variables into a specified buffer. |
28176 The variables are written with the prefix @code{var-} in the form of | 28180 The variables are written with the prefix @code{var-} in the form of |
28177 Lisp @code{setq} commands | 28181 Lisp @code{setq} commands |
28178 which store the values in string form. You can place these commands | 28182 which store the values in string form. You can place these commands |
28179 in your @file{.emacs} buffer if you wish, though in this case it | 28183 in your Calc init file (or @file{.emacs}) if you wish, though in this case it |
28180 would be easier to use @kbd{s p @key{RET}}. (Note that @kbd{s i} | 28184 would be easier to use @kbd{s p @key{RET}}. (Note that @kbd{s i} |
28181 omits the same set of variables as @w{@kbd{s p @key{RET}}}; the difference | 28185 omits the same set of variables as @w{@kbd{s p @key{RET}}}; the difference |
28182 is that @kbd{s i} will store the variables in any buffer, and it also | 28186 is that @kbd{s i} will store the variables in any buffer, and it also |
28183 stores in a more human-readable format.) | 28187 stores in a more human-readable format.) |
28184 | 28188 |
28361 Software Foundation's machine @samp{prep.ai.mit.edu}.) | 28365 Software Foundation's machine @samp{prep.ai.mit.edu}.) |
28362 | 28366 |
28363 @vindex calc-gnuplot-name | 28367 @vindex calc-gnuplot-name |
28364 If you have GNUPLOT installed on your system but Calc is unable to | 28368 If you have GNUPLOT installed on your system but Calc is unable to |
28365 find it, you may need to set the @code{calc-gnuplot-name} variable | 28369 find it, you may need to set the @code{calc-gnuplot-name} variable |
28366 in your @file{.emacs} file. You may also need to set some Lisp | 28370 in your Calc init file or @file{.emacs}. You may also need to set some Lisp |
28367 variables to show Calc how to run GNUPLOT on your system; these | 28371 variables to show Calc how to run GNUPLOT on your system; these |
28368 are described under @kbd{g D} and @kbd{g O} below. If you are | 28372 are described under @kbd{g D} and @kbd{g O} below. If you are |
28369 using the X window system, Calc will configure GNUPLOT for you | 28373 using the X window system, Calc will configure GNUPLOT for you |
28370 automatically. If you have GNUPLOT 3.0 and you are not using X, | 28374 automatically. If you have GNUPLOT 3.0 and you are not using X, |
28371 Calc will configure GNUPLOT to display graphs using simple character | 28375 Calc will configure GNUPLOT to display graphs using simple character |
30416 We would have to go down to the other formula and press @kbd{M-# u} | 30420 We would have to go down to the other formula and press @kbd{M-# u} |
30417 on it in order to get it to notice the new annotation. | 30421 on it in order to get it to notice the new annotation. |
30418 | 30422 |
30419 Two more mode-recording modes selectable by @kbd{m R} are @code{Save} | 30423 Two more mode-recording modes selectable by @kbd{m R} are @code{Save} |
30420 (which works even outside of Embedded mode), in which mode settings | 30424 (which works even outside of Embedded mode), in which mode settings |
30421 are recorded permanently in your Emacs startup file @file{~/.emacs} | 30425 are recorded permanently in your Calc init file (the file given by the |
30426 variable @code{calc-settings-file}, typically @file{~/.calc.el}) | |
30422 rather than by annotating the current document, and no-recording | 30427 rather than by annotating the current document, and no-recording |
30423 mode (where there is no symbol like @code{Save} or @code{Local} in | 30428 mode (where there is no symbol like @code{Save} or @code{Local} in |
30424 the mode line), in which mode-changing commands do not leave any | 30429 the mode line), in which mode-changing commands do not leave any |
30425 annotations at all. | 30430 annotations at all. |
30426 | 30431 |
30432 | 30437 |
30433 @noindent | 30438 @noindent |
30434 You can modify Embedded mode's behavior by setting various Lisp | 30439 You can modify Embedded mode's behavior by setting various Lisp |
30435 variables described here. Use @kbd{M-x set-variable} or | 30440 variables described here. Use @kbd{M-x set-variable} or |
30436 @kbd{M-x edit-options} to adjust a variable on the fly, or | 30441 @kbd{M-x edit-options} to adjust a variable on the fly, or |
30437 put a suitable @code{setq} statement in your @file{~/.emacs} | 30442 put a suitable @code{setq} statement in your Calc init file (or |
30438 file to set a variable permanently. (Another possibility would | 30443 @file{~/.emacs}) to set a variable permanently. (Another possibility would |
30439 be to use a file-local variable annotation at the end of the | 30444 be to use a file-local variable annotation at the end of the |
30440 file; @pxref{File Variables, , Local Variables in Files, emacs, the | 30445 file; @pxref{File Variables, , Local Variables in Files, emacs, the |
30441 Emacs manual}.) | 30446 Emacs manual}.) |
30442 | 30447 |
30443 While none of these variables will be buffer-local by default, you | 30448 While none of these variables will be buffer-local by default, you |
30671 | 30676 |
30672 @kindex Z P | 30677 @kindex Z P |
30673 @pindex calc-user-define-permanent | 30678 @pindex calc-user-define-permanent |
30674 @cindex Storing user definitions | 30679 @cindex Storing user definitions |
30675 @cindex Permanent user definitions | 30680 @cindex Permanent user definitions |
30676 @cindex @file{.emacs} file, user-defined commands | 30681 @cindex Calc init file, user-defined commands |
30677 The @kbd{Z P} (@code{calc-user-define-permanent}) command makes a key | 30682 The @kbd{Z P} (@code{calc-user-define-permanent}) command makes a key |
30678 binding permanent so that it will remain in effect even in future Emacs | 30683 binding permanent so that it will remain in effect even in future Emacs |
30679 sessions. (It does this by adding a suitable bit of Lisp code into | 30684 sessions. (It does this by adding a suitable bit of Lisp code into |
30680 your @file{.emacs} file.) For example, @kbd{Z P s} would register | 30685 your Calc init file; that is, the file given by the variable |
30681 our @code{sincos} command permanently. If you later wish to unregister | 30686 @code{calc-settings-file}, typically @file{~/.calc.el}.) For example, |
30682 this command you must edit your @file{.emacs} file by hand. | 30687 @kbd{Z P s} would register our @code{sincos} command permanently. If |
30683 (@xref{General Mode Commands}, for a way to tell Calc to use a | 30688 you later wish to unregister this command you must edit your Calc init |
30684 different file instead of @file{.emacs}.) | 30689 file by hand. (@xref{General Mode Commands}, for a way to tell Calc to |
30690 use a different file for the Calc init file.) | |
30685 | 30691 |
30686 The @kbd{Z P} command also saves the user definition, if any, for the | 30692 The @kbd{Z P} command also saves the user definition, if any, for the |
30687 command bound to the key. After @kbd{Z F} and @kbd{Z C}, a given user | 30693 command bound to the key. After @kbd{Z F} and @kbd{Z C}, a given user |
30688 key could invoke a command, which in turn calls an algebraic function, | 30694 key could invoke a command, which in turn calls an algebraic function, |
30689 which might have one or more special display formats. A single @kbd{Z P} | 30695 which might have one or more special display formats. A single @kbd{Z P} |
31394 | 31400 |
31395 @example | 31401 @example |
31396 :"n * myfact(n-1)" | 31402 :"n * myfact(n-1)" |
31397 @end example | 31403 @end example |
31398 | 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. | |
31399 If a file named @file{.emacs} exists in your home directory, Emacs reads | 31408 If a file named @file{.emacs} exists in your home directory, Emacs reads |
31400 and executes the Lisp forms in this file as it starts up. While it may | 31409 and executes the Lisp forms in this file as it starts up. While it may |
31401 seem like a good idea to put your favorite @code{defmath} commands here, | 31410 seem reasonable to put your favorite @code{defmath} commands there, |
31402 this has the unfortunate side-effect that parts of the Calculator must be | 31411 this has the unfortunate side-effect that parts of the Calculator must be |
31403 loaded in to process the @code{defmath} commands whether or not you will | 31412 loaded in to process the @code{defmath} commands whether or not you will |
31404 actually use the Calculator! A better effect can be had by writing | 31413 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 | |
31405 | 31416 |
31406 @example | 31417 @example |
31407 (put 'calc-define 'thing '(progn | 31418 (put 'calc-define 'thing '(progn |
31408 (defmath ... ) | 31419 (defmath ... ) |
31409 (defmath ... ) | 31420 (defmath ... ) |
34352 @end defvar | 34363 @end defvar |
34353 | 34364 |
34354 @defvar calc-mode-save-hook | 34365 @defvar calc-mode-save-hook |
34355 This hook is called by the @code{calc-save-modes} command, | 34366 This hook is called by the @code{calc-save-modes} command, |
34356 after Calc's own mode features have been inserted into the | 34367 after Calc's own mode features have been inserted into the |
34357 @file{.emacs} buffer and just before the ``End of mode settings'' | 34368 Calc init file and just before the ``End of mode settings'' |
34358 message is inserted. | 34369 message is inserted. |
34359 @end defvar | 34370 @end defvar |
34360 | 34371 |
34361 @defvar calc-reset-hook | 34372 @defvar calc-reset-hook |
34362 This hook is called after @kbd{M-# 0} (@code{calc-reset}) has | 34373 This hook is called after @kbd{M-# 0} (@code{calc-reset}) has |
35843 The variables in this list that do not contain dashes are accessible | 35854 The variables in this list that do not contain dashes are accessible |
35844 as Calc variables. Add a @samp{var-} prefix to get the name of the | 35855 as Calc variables. Add a @samp{var-} prefix to get the name of the |
35845 corresponding Lisp variable. | 35856 corresponding Lisp variable. |
35846 | 35857 |
35847 The remaining variables are Lisp variables suitable for @code{setq}ing | 35858 The remaining variables are Lisp variables suitable for @code{setq}ing |
35848 in your @file{.emacs} file. | 35859 in your Calc init file or @file{.emacs} file. |
35849 | 35860 |
35850 @printindex vr | 35861 @printindex vr |
35851 | 35862 |
35852 @node Lisp Function Index, , Variable Index, Top | 35863 @node Lisp Function Index, , Variable Index, Top |
35853 @unnumbered Index of Lisp Math Functions | 35864 @unnumbered Index of Lisp Math Functions |