aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man/calc.texi261
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}
10613loaded right away. This will cause Emacs to take up a lot more 10613loaded right away. This will cause Emacs to take up a lot more
10614memory than it would otherwise, but it's guaranteed to fix the problem. 10614memory than it would otherwise, but it's guaranteed to fix the problem.
10615 10615
10616If you seem to run into this problem no matter what you do, or if
10617even the @kbd{M-# L} command crashes, Calc may have been improperly
10618installed. @xref{Installation}, for details of the installation
10619process.
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
12306use in the future for commands like @kbd{m m}. The default settings 12301use in the future for commands like @kbd{m m}. The default settings
12307file name is @file{~/.calc.el}. You can see the current file name by 12302file name is @file{~/.calc.el}. You can see the current file name by
12308giving a blank response to the @kbd{m F} prompt. See also the 12303giving a blank response to the @kbd{m F} prompt. See also the
12309discussion of the @code{calc-settings-file} variable; @pxref{Installation}. 12304discussion of the @code{calc-settings-file} variable; @pxref{Customizable Variables}.
12310 12305
12311If the file name you give is your user init file (typically 12306If 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
29112If you are installing Calc you may wish to configure the default and 29107You may wish to configure the default and
29113printer devices and output files for the whole system. The relevant 29108printer devices and output files for the whole system. The relevant
29114Lisp variables are @code{calc-gnuplot-default-device} and @code{-output}, 29109Lisp variables are @code{calc-gnuplot-default-device} and @code{-output},
29115and @code{calc-gnuplot-print-device} and @code{-output}. The output 29110and @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.
29124Or, these variables may contain Lisp expressions which are evaluated 29119Or, these variables may contain Lisp expressions which are evaluated
29125to display or print the output. 29120to 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},
29913and eqn for @code{nroff-mode}. These can be overridden with Calc's mode 29909and eqn for @code{nroff-mode} (@pxref{Customizable Variables}).
29910These can be overridden with Calc's mode
29914changing commands (@pxref{Mode Settings in Embedded Mode}). If no 29911changing commands (@pxref{Mode Settings in Embedded Mode}). If no
29915suitable language is available, Calc will continue with its current language. 29912suitable 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
30614You can modify Embedded mode's behavior by setting various Lisp 30611You can modify Embedded mode's behavior by setting various Lisp
30615variables described here. Use @kbd{M-x set-variable} or 30612variables 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}
30617put a suitable @code{setq} statement in your Calc init file (or 30614or @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
30619be to use a file-local variable annotation at the end of the 30616be to use a file-local variable annotation at the end of the
30620file; @pxref{File Variables, , Local Variables in Files, emacs, the 30617file; @pxref{File Variables, , Local Variables in Files, emacs, the
30621Emacs manual}.) 30618Emacs manual}.)
@@ -30760,7 +30757,7 @@ is simply a newline, @code{"\n"}. If you change this, it is a
30760good idea still to end with a newline so that mode annotations 30757good idea still to end with a newline so that mode annotations
30761will appear on lines by themselves. 30758will 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
34610list and also call @code{make-local-variable} itself. 34607list 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
34613GNU Calc is controlled by many variables, most of which can be reset
34614from within Calc. Some variables are less involved with actual
34615calculation, and can be set outside of Calc using Emacs's
34616customization facilities. These variables are listed below.
34617Typing @kbd{M-x customize-variable RET @var{variable-name} RET}
34618will bring up a buffer in which the variable's value can be redefined.
34619Typing @kbd{M-x customize-group RET calc RET} will bring up a buffer which
34620contains all of Calc's customizable variables. (These variables can
34621also be reset by putting the appropriate lines in your .emacs file;
34622@xref{Init File, ,Init File, emacs, The GNU Emacs Manual}.)
34623
34624Some of the customizable variables are regular expressions. A regular
34625expression is basically a pattern that Calc can search for.
34626See @ref{Regexp Search,, Regular Expression Search, emacs, The GNU Emacs Manual}
34627to see how regular expressions work.
34615 34628
34616@noindent 34629@table @code
34617As of Calc 2.02g, Calc is integrated with GNU Emacs, and thus requires
34618no 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
34623Calc's graphing commands use the GNUPLOT program. If you have GNUPLOT 34634The variable @code{calc-settings-file} holds the file name in
34624but you must type some command other than @file{gnuplot} to get it, 34635which commands like @kbd{m m} and @kbd{Z P} store ``permanent''
34625you should add a command to set the Lisp variable @code{calc-gnuplot-name} 34636definitions.
34626to the appropriate file name. You may also need to change the variables 34637If @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
34628order to get correct displays and hardcopies, respectively, of your 34639@code{nil}, then Calc will automatically load your settings file (if it
34629plots. 34640exists) the first time Calc is invoked.
34641
34642The default value for this variable is @code{"~/.calc.el"}.
34643
34644@item calc-gnuplot-name
34645
34646See @ref{Graphics}.@*
34647The variable @code{calc-gnuplot-name} should be the name of the
34648GNUPLOT program (a string). If you have GNUPLOT installed on your
34649system but Calc is unable to find it, you may need to set this
34650variable. (@pxref{Customizable Variables})
34651You may also need to set some Lisp variables to show Calc how to run
34652GNUPLOT on your system, see @ref{Devices, ,Graphical Devices} . The default value
34653of @code{calc-gnuplot-name} is @code{"gnuplot"}.
34654
34655@item calc-gnuplot-plot-command
34656@itemx calc-gnuplot-print-command
34657
34658See @ref{Devices, ,Graphical Devices}.@*
34659The variables @code{calc-gnuplot-plot-command} and
34660@code{calc-gnuplot-print-command} represent system commands to
34661display 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.
34664Or, these variables may contain Lisp expressions which are evaluated
34665to display or print the output.
34630 34666
34631@ifinfo 34667The default value of @code{calc-gnuplot-plot-command} is @code{nil},
34668and the default value of @code{calc-gnuplot-print-command} is
34669@code{"lp %s"}.
34670
34671@item calc-language-alist
34672
34673See @ref{Basic Embedded Mode}.@*
34674The variable @code{calc-language-alist} controls the languages that
34675Calc will associate with major modes. When Calc embedded mode is
34676enabled, it will try to use the current major mode to
34677determine what language should be used. (This can be overridden using
34678Calc's mode changing commands, @xref{Mode Settings in Embedded Mode}.)
34679The variable @code{calc-language-alist} consists of a list of pairs of
34680the form @code{(@var{KEY} . @var{VALUE})}; for example,
34681@code{(latex-mode . latex)} is one such pair. If Calc embedded is
34682activated in a buffer whose major mode is @var{KEY}, it will set itself
34683to use the language @var{VALUE}.
34684
34685The 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 34701See @ref{Customizing Embedded Mode}.@*
34640@vindex calc-settings-file 34702The variable @code{calc-embedded-announce-formula} helps determine
34641Another variable you might want to set is @code{calc-settings-file}, 34703what formulas @kbd{M-# a} will activate in a buffer. It is a
34642which holds the file name in which commands like @kbd{m m} and @kbd{Z P} 34704regular expression, and when activating embedded formulas with
34643store ``permanent'' definitions. The default value for this variable 34705@kbd{M-# a}, it will tell Calc that what follows is a formula to be
34644is @code{"~/.calc.el"}. If @code{calc-settings-file} is not your user 34706activated. (Calc also uses other patterns to find formulas, such as
34645init file (typically @file{~/.emacs}) and if the variable 34707@samp{=>} and @samp{:=}.)
34646@code{calc-loaded-settings-file} is @code{nil}, then Calc will
34647automatically load your settings file (if it exists) the first time
34648Calc is invoked.
34649 34708
34650@ifinfo 34709The default pattern is @code{"%Embed\n\\(% .*\n\\)*"}, which checks
34651@example 34710for @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 34716See @ref{Customizing Embedded Mode}.@*
34658To test your installation of Calc, start a new Emacs and type @kbd{M-# c} 34717The variables @code{calc-embedded-open-formula} and
34659to make sure the autoloads and key bindings work. Type @kbd{M-# i} 34718@code{calc-embedded-open-formula} control the region that Calc will
34660to make sure Calc can find its Info documentation. Press @kbd{q} to 34719activate as a formula when Embedded mode is entered with @kbd{M-# e}.
34661exit the Info system and @kbd{M-# c} to re-enter the Calculator. 34720They are regular expressions;
34662Type @kbd{20 S} to compute the sine of 20 degrees; this will test the 34721Calc normally scans backward and forward in the buffer for the
34663autoloading of the extensions modules. The result should be 34722nearest text matching these regular expressions to be the ``formula
346640.342020143326. Finally, press @kbd{M-# c} again to make sure the 34723delimiters''.
34665Calculator can exit. 34724
34725The simplest delimiters are blank lines. Other delimiters that
34726Embedded mode understands by default are:
34727@enumerate
34728@item
34729The @TeX{} and La@TeX{} math delimiters @samp{$ $}, @samp{$$ $$},
34730@samp{\[ \]}, and @samp{\( \)};
34731@item
34732Lines beginning with @samp{\begin} and @samp{\end} (except matrix delimiters);
34733@item
34734Lines beginning with @samp{@@} (Texinfo delimiters).
34735@item
34736Lines beginning with @samp{.EQ} and @samp{.EN} (@dfn{eqn} delimiters);
34737@item
34738Lines containing a single @samp{%} or @samp{.\"} symbol and nothing else.
34739@end enumerate
34666 34740
34667You may also wish to test the GNUPLOT interface; to plot a sine wave, 34741@item calc-embedded-open-word
34668type @kbd{' [0 ..@: 360], sin(x) @key{RET} g f}. Type @kbd{g q} when you 34742@itemx calc-embedded-close-word
34669are done viewing the plot.
34670 34743
34671Calc is now ready to use. If you wish to go through the Calc Tutorial, 34744See @ref{Customizing Embedded Mode}.@*
34672press @kbd{M-# t} to begin. 34745The variables @code{calc-embedded-open-word} and
34673@example 34746@code{calc-embedded-close-word} control the region that Calc will
34747activate when Embedded mode is entered with @kbd{M-# w}. They are
34748regular expressions.
34674 34749
34675@end example 34750The 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
34757See @ref{Customizing Embedded Mode}.@*
34758The variables @code{calc-embedded-open-plain} and
34759@code{calc-embedded-open-plain} are used to delimit ``plain''
34760formulas. Note that these are actual strings, not regular
34761expressions, because Calc must be able to write these string into a
34762buffer as well as to recognize them.
34763
34764The 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
34767the trailing newline here, the first line of a Big mode formula
34768that 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
34773See @ref{Customizing Embedded Mode}.@*
34774The variables @code{calc-embedded-open-new-formula} and
34775@code{calc-embedded-close-new-formula} are strings which are
34776inserted before and after a new formula when you type @kbd{M-# f}.
34777
34778The 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
34781this first newline to avoid introducing unnecessary blank lines in the
34782file. The default value of @code{calc-embedded-close-new-formula} is
34783also @code{"\n\n"}. The final newline is omitted by @w{@kbd{M-# f}}
34784if typed at the end of a line. (It follows that if @kbd{M-# f} is
34785typed on a blank line, both a leading opening newline and a trailing
34786closing newline are omitted.)
34787
34788@item calc-embedded-open-mode
34789@itemx calc-embedded-close-mode
34790
34791See @ref{Customizing Embedded Mode}.@*
34792The variables @code{calc-embedded-open-mode} and
34793@code{calc-embedded-close-mode} are strings which Calc will place before
34794and after any mode annotations that it inserts. Calc never scans for
34795these strings; Calc always looks for the annotation itself, so it is not
34796necessary to add them to user-written annotations.
34797
34798The default value of @code{calc-embedded-open-mode} is @code{"% "}
34799and the default value of @code{calc-embedded-close-mode} is
34800@code{"\n"}.
34801If you change the value of @code{calc-embedded-close-mode}, it is a good
34802idea still to end with a newline so that mode annotations will appear on
34803lines 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