diff options
| -rw-r--r-- | man/calc.texi | 261 |
1 files changed, 196 insertions, 65 deletions
diff --git a/man/calc.texi b/man/calc.texi index 07c33206f28..087cdbe6457 100644 --- a/man/calc.texi +++ b/man/calc.texi | |||
| @@ -165,7 +165,7 @@ longer Info tutorial.) | |||
| 165 | * Embedded Mode:: Working with formulas embedded in a file. | 165 | * Embedded Mode:: Working with formulas embedded in a file. |
| 166 | * Programming:: Calc as a programmable calculator. | 166 | * Programming:: Calc as a programmable calculator. |
| 167 | 167 | ||
| 168 | * Installation:: Installing Calc as a part of GNU Emacs. | 168 | * Customizable Variables:: Customizable Variables. |
| 169 | * Reporting Bugs:: How to report bugs and make suggestions. | 169 | * Reporting Bugs:: How to report bugs and make suggestions. |
| 170 | 170 | ||
| 171 | * Summary:: Summary of Calc commands and functions. | 171 | * Summary:: Summary of Calc commands and functions. |
| @@ -10613,11 +10613,6 @@ If this happens, the easiest workaround is to type @kbd{M-# L} | |||
| 10613 | loaded right away. This will cause Emacs to take up a lot more | 10613 | loaded right away. This will cause Emacs to take up a lot more |
| 10614 | memory than it would otherwise, but it's guaranteed to fix the problem. | 10614 | memory than it would otherwise, but it's guaranteed to fix the problem. |
| 10615 | 10615 | ||
| 10616 | If you seem to run into this problem no matter what you do, or if | ||
| 10617 | even the @kbd{M-# L} command crashes, Calc may have been improperly | ||
| 10618 | installed. @xref{Installation}, for details of the installation | ||
| 10619 | process. | ||
| 10620 | |||
| 10621 | @node Recursion Depth, Caches, Autoloading Problems, Troubleshooting Commands | 10616 | @node Recursion Depth, Caches, Autoloading Problems, Troubleshooting Commands |
| 10622 | @subsection Recursion Depth | 10617 | @subsection Recursion Depth |
| 10623 | 10618 | ||
| @@ -12306,7 +12301,7 @@ if this file exists, and this file becomes the one that Calc will | |||
| 12306 | use in the future for commands like @kbd{m m}. The default settings | 12301 | use in the future for commands like @kbd{m m}. The default settings |
| 12307 | file name is @file{~/.calc.el}. You can see the current file name by | 12302 | file name is @file{~/.calc.el}. You can see the current file name by |
| 12308 | giving a blank response to the @kbd{m F} prompt. See also the | 12303 | giving a blank response to the @kbd{m F} prompt. See also the |
| 12309 | discussion of the @code{calc-settings-file} variable; @pxref{Installation}. | 12304 | discussion of the @code{calc-settings-file} variable; @pxref{Customizable Variables}. |
| 12310 | 12305 | ||
| 12311 | If the file name you give is your user init file (typically | 12306 | If the file name you give is your user init file (typically |
| 12312 | @file{~/.emacs}), @kbd{m F} will not automatically load the new file. This | 12307 | @file{~/.emacs}), @kbd{m F} will not automatically load the new file. This |
| @@ -29109,7 +29104,7 @@ of the @samp{*Gnuplot Commands*} buffer. | |||
| 29109 | @vindex calc-gnuplot-print-command | 29104 | @vindex calc-gnuplot-print-command |
| 29110 | @vindex calc-gnuplot-print-device | 29105 | @vindex calc-gnuplot-print-device |
| 29111 | @vindex calc-gnuplot-print-output | 29106 | @vindex calc-gnuplot-print-output |
| 29112 | If you are installing Calc you may wish to configure the default and | 29107 | You may wish to configure the default and |
| 29113 | printer devices and output files for the whole system. The relevant | 29108 | printer devices and output files for the whole system. The relevant |
| 29114 | Lisp variables are @code{calc-gnuplot-default-device} and @code{-output}, | 29109 | Lisp variables are @code{calc-gnuplot-default-device} and @code{-output}, |
| 29115 | and @code{calc-gnuplot-print-device} and @code{-output}. The output | 29110 | and @code{calc-gnuplot-print-device} and @code{-output}. The output |
| @@ -29122,7 +29117,8 @@ display or print the output of GNUPLOT, respectively. These may be | |||
| 29122 | @code{nil} if no command is necessary, or strings which can include | 29117 | @code{nil} if no command is necessary, or strings which can include |
| 29123 | @samp{%s} to signify the name of the file to be displayed or printed. | 29118 | @samp{%s} to signify the name of the file to be displayed or printed. |
| 29124 | Or, these variables may contain Lisp expressions which are evaluated | 29119 | Or, these variables may contain Lisp expressions which are evaluated |
| 29125 | to display or print the output. | 29120 | to display or print the output. These variables are customizable |
| 29121 | (@pxref{Customizable Variables}). | ||
| 29126 | 29122 | ||
| 29127 | @kindex g x | 29123 | @kindex g x |
| 29128 | @pindex calc-graph-display | 29124 | @pindex calc-graph-display |
| @@ -29910,7 +29906,8 @@ Similarly, Calc will use @TeX{} language for @code{tex-mode}, | |||
| 29910 | @code{plain-tex-mode} and @code{context-mode}, C language for | 29906 | @code{plain-tex-mode} and @code{context-mode}, C language for |
| 29911 | @code{c-mode} and @code{c++-mode}, FORTRAN language for | 29907 | @code{c-mode} and @code{c++-mode}, FORTRAN language for |
| 29912 | @code{fortran-mode} and @code{f90-mode}, Pascal for @code{pascal-mode}, | 29908 | @code{fortran-mode} and @code{f90-mode}, Pascal for @code{pascal-mode}, |
| 29913 | and eqn for @code{nroff-mode}. These can be overridden with Calc's mode | 29909 | and eqn for @code{nroff-mode} (@pxref{Customizable Variables}). |
| 29910 | These can be overridden with Calc's mode | ||
| 29914 | changing commands (@pxref{Mode Settings in Embedded Mode}). If no | 29911 | changing commands (@pxref{Mode Settings in Embedded Mode}). If no |
| 29915 | suitable language is available, Calc will continue with its current language. | 29912 | suitable language is available, Calc will continue with its current language. |
| 29916 | 29913 | ||
| @@ -30612,10 +30609,10 @@ for @code{Save} have no effect. | |||
| 30612 | 30609 | ||
| 30613 | @noindent | 30610 | @noindent |
| 30614 | You can modify Embedded mode's behavior by setting various Lisp | 30611 | You can modify Embedded mode's behavior by setting various Lisp |
| 30615 | variables described here. Use @kbd{M-x set-variable} or | 30612 | variables described here. These variables are customizable |
| 30616 | @kbd{M-x edit-options} to adjust a variable on the fly, or | 30613 | (@pxref{Customizable Variables}), or you can use @kbd{M-x set-variable} |
| 30617 | put a suitable @code{setq} statement in your Calc init file (or | 30614 | or @kbd{M-x edit-options} to adjust a variable on the fly. |
| 30618 | @file{~/.emacs}) to set a variable permanently. (Another possibility would | 30615 | (Another possibility would |
| 30619 | be to use a file-local variable annotation at the end of the | 30616 | be to use a file-local variable annotation at the end of the |
| 30620 | file; @pxref{File Variables, , Local Variables in Files, emacs, the | 30617 | file; @pxref{File Variables, , Local Variables in Files, emacs, the |
| 30621 | Emacs manual}.) | 30618 | Emacs manual}.) |
| @@ -30760,7 +30757,7 @@ is simply a newline, @code{"\n"}. If you change this, it is a | |||
| 30760 | good idea still to end with a newline so that mode annotations | 30757 | good idea still to end with a newline so that mode annotations |
| 30761 | will appear on lines by themselves. | 30758 | will appear on lines by themselves. |
| 30762 | 30759 | ||
| 30763 | @node Programming, Installation, Embedded Mode, Top | 30760 | @node Programming, Customizable Variables, Embedded Mode, Top |
| 30764 | @chapter Programming | 30761 | @chapter Programming |
| 30765 | 30762 | ||
| 30766 | @noindent | 30763 | @noindent |
| @@ -34610,70 +34607,204 @@ used the first time, your hook should add a variable to the | |||
| 34610 | list and also call @code{make-local-variable} itself. | 34607 | list and also call @code{make-local-variable} itself. |
| 34611 | @end defvar | 34608 | @end defvar |
| 34612 | 34609 | ||
| 34613 | @node Installation, Reporting Bugs, Programming, Top | 34610 | @node Customizable Variables, Reporting Bugs, Programming, Top |
| 34614 | @appendix Installation | 34611 | @appendix Customizable Variables |
| 34612 | |||
| 34613 | GNU Calc is controlled by many variables, most of which can be reset | ||
| 34614 | from within Calc. Some variables are less involved with actual | ||
| 34615 | calculation, and can be set outside of Calc using Emacs's | ||
| 34616 | customization facilities. These variables are listed below. | ||
| 34617 | Typing @kbd{M-x customize-variable RET @var{variable-name} RET} | ||
| 34618 | will bring up a buffer in which the variable's value can be redefined. | ||
| 34619 | Typing @kbd{M-x customize-group RET calc RET} will bring up a buffer which | ||
| 34620 | contains all of Calc's customizable variables. (These variables can | ||
| 34621 | also be reset by putting the appropriate lines in your .emacs file; | ||
| 34622 | @xref{Init File, ,Init File, emacs, The GNU Emacs Manual}.) | ||
| 34623 | |||
| 34624 | Some of the customizable variables are regular expressions. A regular | ||
| 34625 | expression is basically a pattern that Calc can search for. | ||
| 34626 | See @ref{Regexp Search,, Regular Expression Search, emacs, The GNU Emacs Manual} | ||
| 34627 | to see how regular expressions work. | ||
| 34615 | 34628 | ||
| 34616 | @noindent | 34629 | @table @code |
| 34617 | As of Calc 2.02g, Calc is integrated with GNU Emacs, and thus requires | ||
| 34618 | no separate installation of its Lisp files and this manual. | ||
| 34619 | 34630 | ||
| 34620 | @appendixsec The GNUPLOT Program | 34631 | @item calc-settings-file |
| 34621 | 34632 | ||
| 34622 | @noindent | 34633 | @vindex calc-settings-file |
| 34623 | Calc's graphing commands use the GNUPLOT program. If you have GNUPLOT | 34634 | The variable @code{calc-settings-file} holds the file name in |
| 34624 | but you must type some command other than @file{gnuplot} to get it, | 34635 | which commands like @kbd{m m} and @kbd{Z P} store ``permanent'' |
| 34625 | you should add a command to set the Lisp variable @code{calc-gnuplot-name} | 34636 | definitions. |
| 34626 | to the appropriate file name. You may also need to change the variables | 34637 | If @code{calc-settings-file} is not your user init file (typically |
| 34627 | @code{calc-gnuplot-plot-command} and @code{calc-gnuplot-print-command} in | 34638 | @file{~/.emacs}) and if the variable @code{calc-loaded-settings-file} is |
| 34628 | order to get correct displays and hardcopies, respectively, of your | 34639 | @code{nil}, then Calc will automatically load your settings file (if it |
| 34629 | plots. | 34640 | exists) the first time Calc is invoked. |
| 34641 | |||
| 34642 | The default value for this variable is @code{"~/.calc.el"}. | ||
| 34643 | |||
| 34644 | @item calc-gnuplot-name | ||
| 34645 | |||
| 34646 | See @ref{Graphics}.@* | ||
| 34647 | The variable @code{calc-gnuplot-name} should be the name of the | ||
| 34648 | GNUPLOT program (a string). If you have GNUPLOT installed on your | ||
| 34649 | system but Calc is unable to find it, you may need to set this | ||
| 34650 | variable. (@pxref{Customizable Variables}) | ||
| 34651 | You may also need to set some Lisp variables to show Calc how to run | ||
| 34652 | GNUPLOT on your system, see @ref{Devices, ,Graphical Devices} . The default value | ||
| 34653 | of @code{calc-gnuplot-name} is @code{"gnuplot"}. | ||
| 34654 | |||
| 34655 | @item calc-gnuplot-plot-command | ||
| 34656 | @itemx calc-gnuplot-print-command | ||
| 34657 | |||
| 34658 | See @ref{Devices, ,Graphical Devices}.@* | ||
| 34659 | The variables @code{calc-gnuplot-plot-command} and | ||
| 34660 | @code{calc-gnuplot-print-command} represent system commands to | ||
| 34661 | display and print the output of GNUPLOT, respectively. These may be | ||
| 34662 | @code{nil} if no command is necessary, or strings which can include | ||
| 34663 | @samp{%s} to signify the name of the file to be displayed or printed. | ||
| 34664 | Or, these variables may contain Lisp expressions which are evaluated | ||
| 34665 | to display or print the output. | ||
| 34630 | 34666 | ||
| 34631 | @ifinfo | 34667 | The default value of @code{calc-gnuplot-plot-command} is @code{nil}, |
| 34668 | and the default value of @code{calc-gnuplot-print-command} is | ||
| 34669 | @code{"lp %s"}. | ||
| 34670 | |||
| 34671 | @item calc-language-alist | ||
| 34672 | |||
| 34673 | See @ref{Basic Embedded Mode}.@* | ||
| 34674 | The variable @code{calc-language-alist} controls the languages that | ||
| 34675 | Calc will associate with major modes. When Calc embedded mode is | ||
| 34676 | enabled, it will try to use the current major mode to | ||
| 34677 | determine what language should be used. (This can be overridden using | ||
| 34678 | Calc's mode changing commands, @xref{Mode Settings in Embedded Mode}.) | ||
| 34679 | The variable @code{calc-language-alist} consists of a list of pairs of | ||
| 34680 | the form @code{(@var{KEY} . @var{VALUE})}; for example, | ||
| 34681 | @code{(latex-mode . latex)} is one such pair. If Calc embedded is | ||
| 34682 | activated in a buffer whose major mode is @var{KEY}, it will set itself | ||
| 34683 | to use the language @var{VALUE}. | ||
| 34684 | |||
| 34685 | The default value of @code{calc-language-alist} is | ||
| 34632 | @example | 34686 | @example |
| 34633 | 34687 | ((latex-mode . latex) | |
| 34688 | (tex-mode . tex) | ||
| 34689 | (plain-tex-mode . tex) | ||
| 34690 | (context-mode . tex) | ||
| 34691 | (nroff-mode . eqn) | ||
| 34692 | (pascal-mode . pascal) | ||
| 34693 | (c-mode . c) | ||
| 34694 | (c++-mode . c) | ||
| 34695 | (fortran-mode . fortran) | ||
| 34696 | (f90-mode . fortran)) | ||
| 34634 | @end example | 34697 | @end example |
| 34635 | @end ifinfo | ||
| 34636 | 34698 | ||
| 34637 | @appendixsec Settings File | 34699 | @item calc-embedded-announce-formula |
| 34638 | 34700 | ||
| 34639 | @noindent | 34701 | See @ref{Customizing Embedded Mode}.@* |
| 34640 | @vindex calc-settings-file | 34702 | The variable @code{calc-embedded-announce-formula} helps determine |
| 34641 | Another variable you might want to set is @code{calc-settings-file}, | 34703 | what formulas @kbd{M-# a} will activate in a buffer. It is a |
| 34642 | which holds the file name in which commands like @kbd{m m} and @kbd{Z P} | 34704 | regular expression, and when activating embedded formulas with |
| 34643 | store ``permanent'' definitions. The default value for this variable | 34705 | @kbd{M-# a}, it will tell Calc that what follows is a formula to be |
| 34644 | is @code{"~/.calc.el"}. If @code{calc-settings-file} is not your user | 34706 | activated. (Calc also uses other patterns to find formulas, such as |
| 34645 | init file (typically @file{~/.emacs}) and if the variable | 34707 | @samp{=>} and @samp{:=}.) |
| 34646 | @code{calc-loaded-settings-file} is @code{nil}, then Calc will | ||
| 34647 | automatically load your settings file (if it exists) the first time | ||
| 34648 | Calc is invoked. | ||
| 34649 | 34708 | ||
| 34650 | @ifinfo | 34709 | The default pattern is @code{"%Embed\n\\(% .*\n\\)*"}, which checks |
| 34651 | @example | 34710 | for @samp{%Embed} followed by any number of lines beginning with |
| 34711 | @samp{%} and a space. | ||
| 34652 | 34712 | ||
| 34653 | @end example | 34713 | @item calc-embedded-open-formula |
| 34654 | @end ifinfo | 34714 | @itemx calc-embedded-close-formula |
| 34655 | @appendixsec Testing the Installation | ||
| 34656 | 34715 | ||
| 34657 | @noindent | 34716 | See @ref{Customizing Embedded Mode}.@* |
| 34658 | To test your installation of Calc, start a new Emacs and type @kbd{M-# c} | 34717 | The variables @code{calc-embedded-open-formula} and |
| 34659 | to make sure the autoloads and key bindings work. Type @kbd{M-# i} | 34718 | @code{calc-embedded-open-formula} control the region that Calc will |
| 34660 | to make sure Calc can find its Info documentation. Press @kbd{q} to | 34719 | activate as a formula when Embedded mode is entered with @kbd{M-# e}. |
| 34661 | exit the Info system and @kbd{M-# c} to re-enter the Calculator. | 34720 | They are regular expressions; |
| 34662 | Type @kbd{20 S} to compute the sine of 20 degrees; this will test the | 34721 | Calc normally scans backward and forward in the buffer for the |
| 34663 | autoloading of the extensions modules. The result should be | 34722 | nearest text matching these regular expressions to be the ``formula |
| 34664 | 0.342020143326. Finally, press @kbd{M-# c} again to make sure the | 34723 | delimiters''. |
| 34665 | Calculator can exit. | 34724 | |
| 34725 | The simplest delimiters are blank lines. Other delimiters that | ||
| 34726 | Embedded mode understands by default are: | ||
| 34727 | @enumerate | ||
| 34728 | @item | ||
| 34729 | The @TeX{} and La@TeX{} math delimiters @samp{$ $}, @samp{$$ $$}, | ||
| 34730 | @samp{\[ \]}, and @samp{\( \)}; | ||
| 34731 | @item | ||
| 34732 | Lines beginning with @samp{\begin} and @samp{\end} (except matrix delimiters); | ||
| 34733 | @item | ||
| 34734 | Lines beginning with @samp{@@} (Texinfo delimiters). | ||
| 34735 | @item | ||
| 34736 | Lines beginning with @samp{.EQ} and @samp{.EN} (@dfn{eqn} delimiters); | ||
| 34737 | @item | ||
| 34738 | Lines containing a single @samp{%} or @samp{.\"} symbol and nothing else. | ||
| 34739 | @end enumerate | ||
| 34666 | 34740 | ||
| 34667 | You may also wish to test the GNUPLOT interface; to plot a sine wave, | 34741 | @item calc-embedded-open-word |
| 34668 | type @kbd{' [0 ..@: 360], sin(x) @key{RET} g f}. Type @kbd{g q} when you | 34742 | @itemx calc-embedded-close-word |
| 34669 | are done viewing the plot. | ||
| 34670 | 34743 | ||
| 34671 | Calc is now ready to use. If you wish to go through the Calc Tutorial, | 34744 | See @ref{Customizing Embedded Mode}.@* |
| 34672 | press @kbd{M-# t} to begin. | 34745 | The variables @code{calc-embedded-open-word} and |
| 34673 | @example | 34746 | @code{calc-embedded-close-word} control the region that Calc will |
| 34747 | activate when Embedded mode is entered with @kbd{M-# w}. They are | ||
| 34748 | regular expressions. | ||
| 34674 | 34749 | ||
| 34675 | @end example | 34750 | The default values of @code{calc-embedded-open-word} and |
| 34676 | @node Reporting Bugs, Summary, Installation, Top | 34751 | @code{calc-embedded-close-word} are @code{"^\\|[^-+0-9.eE]"} and |
| 34752 | @code{"$\\|[^-+0-9.eE]"} respectively. | ||
| 34753 | |||
| 34754 | @item calc-embedded-open-plain | ||
| 34755 | @itemx calc-embedded-close-plain | ||
| 34756 | |||
| 34757 | See @ref{Customizing Embedded Mode}.@* | ||
| 34758 | The variables @code{calc-embedded-open-plain} and | ||
| 34759 | @code{calc-embedded-open-plain} are used to delimit ``plain'' | ||
| 34760 | formulas. Note that these are actual strings, not regular | ||
| 34761 | expressions, because Calc must be able to write these string into a | ||
| 34762 | buffer as well as to recognize them. | ||
| 34763 | |||
| 34764 | The default string for @code{calc-embedded-open-plain} is | ||
| 34765 | @code{"%%% "}, note the trailing space. The default string for | ||
| 34766 | @code{calc-embedded-close-plain} is @code{" %%%\n"}, without | ||
| 34767 | the trailing newline here, the first line of a Big mode formula | ||
| 34768 | that followed might be shifted over with respect to the other lines. | ||
| 34769 | |||
| 34770 | @item calc-embedded-open-new-formula | ||
| 34771 | @itemx calc-embedded-close-new-formula | ||
| 34772 | |||
| 34773 | See @ref{Customizing Embedded Mode}.@* | ||
| 34774 | The variables @code{calc-embedded-open-new-formula} and | ||
| 34775 | @code{calc-embedded-close-new-formula} are strings which are | ||
| 34776 | inserted before and after a new formula when you type @kbd{M-# f}. | ||
| 34777 | |||
| 34778 | The default value of @code{calc-embedded-open-new-formula} is | ||
| 34779 | @code{"\n\n"}. If this string begins with a newline character and the | ||
| 34780 | @kbd{M-# f} is typed at the beginning of a line, @kbd{M-# f} will skip | ||
| 34781 | this first newline to avoid introducing unnecessary blank lines in the | ||
| 34782 | file. The default value of @code{calc-embedded-close-new-formula} is | ||
| 34783 | also @code{"\n\n"}. The final newline is omitted by @w{@kbd{M-# f}} | ||
| 34784 | if typed at the end of a line. (It follows that if @kbd{M-# f} is | ||
| 34785 | typed on a blank line, both a leading opening newline and a trailing | ||
| 34786 | closing newline are omitted.) | ||
| 34787 | |||
| 34788 | @item calc-embedded-open-mode | ||
| 34789 | @itemx calc-embedded-close-mode | ||
| 34790 | |||
| 34791 | See @ref{Customizing Embedded Mode}.@* | ||
| 34792 | The variables @code{calc-embedded-open-mode} and | ||
| 34793 | @code{calc-embedded-close-mode} are strings which Calc will place before | ||
| 34794 | and after any mode annotations that it inserts. Calc never scans for | ||
| 34795 | these strings; Calc always looks for the annotation itself, so it is not | ||
| 34796 | necessary to add them to user-written annotations. | ||
| 34797 | |||
| 34798 | The default value of @code{calc-embedded-open-mode} is @code{"% "} | ||
| 34799 | and the default value of @code{calc-embedded-close-mode} is | ||
| 34800 | @code{"\n"}. | ||
| 34801 | If you change the value of @code{calc-embedded-close-mode}, it is a good | ||
| 34802 | idea still to end with a newline so that mode annotations will appear on | ||
| 34803 | lines by themselves. | ||
| 34804 | |||
| 34805 | @end table | ||
| 34806 | |||
| 34807 | @node Reporting Bugs, Summary, Customizable Variables, Top | ||
| 34677 | @appendix Reporting Bugs | 34808 | @appendix Reporting Bugs |
| 34678 | 34809 | ||
| 34679 | @noindent | 34810 | @noindent |