aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Belanger2005-11-28 22:15:24 +0000
committerJay Belanger2005-11-28 22:15:24 +0000
commit58547c3ecae5aa70e666a5813e1fc652fd1b376f (patch)
tree57572b97b4f5eb4804c52aaa869ed00c209e4bd9
parent346bffae0cdf7aaebafbed6108fd782f3f2c738f (diff)
downloademacs-58547c3ecae5aa70e666a5813e1fc652fd1b376f.tar.gz
emacs-58547c3ecae5aa70e666a5813e1fc652fd1b376f.zip
Changed references to `M-#' to new prefix.
-rw-r--r--man/calc.texi671
1 files changed, 334 insertions, 337 deletions
diff --git a/man/calc.texi b/man/calc.texi
index 726a7bc7a0c..5eab5322fca 100644
--- a/man/calc.texi
+++ b/man/calc.texi
@@ -167,7 +167,7 @@ longer Info tutorial.)
167* Embedded Mode:: Working with formulas embedded in a file. 167* Embedded Mode:: Working with formulas embedded in a file.
168* Programming:: Calc as a programmable calculator. 168* Programming:: Calc as a programmable calculator.
169 169
170* Customizable Variables:: Customizable Variables. 170* Customizing Calc:: Customizing Calc.
171* Reporting Bugs:: How to report bugs and make suggestions. 171* Reporting Bugs:: How to report bugs and make suggestions.
172 172
173* Summary:: Summary of Calc commands and functions. 173* Summary:: Summary of Calc commands and functions.
@@ -708,9 +708,9 @@ in the margin with its index entry.
708@c [fix-ref Help Commands] 708@c [fix-ref Help Commands]
709You can access this manual on-line at any time within Calc by 709You can access this manual on-line at any time within Calc by
710pressing the @kbd{h i} key sequence. Outside of the Calc window, 710pressing the @kbd{h i} key sequence. Outside of the Calc window,
711you can press @kbd{M-# i} to read the manual on-line. Also, you 711you can press @kbd{C-x * i} to read the manual on-line. Also, you
712can jump directly to the Tutorial by pressing @kbd{h t} or @kbd{M-# t}, 712can jump directly to the Tutorial by pressing @kbd{h t} or @kbd{C-x * t},
713or to the Summary by pressing @kbd{h s} or @kbd{M-# s}. Within Calc, 713or to the Summary by pressing @kbd{h s} or @kbd{C-x * s}. Within Calc,
714you can also go to the part of the manual describing any Calc key, 714you can also go to the part of the manual describing any Calc key,
715function, or variable using @w{@kbd{h k}}, @kbd{h f}, or @kbd{h v}, 715function, or variable using @w{@kbd{h k}}, @kbd{h f}, or @kbd{h v},
716respectively. @xref{Help Commands}. 716respectively. @xref{Help Commands}.
@@ -773,8 +773,8 @@ that you must press @key{RET} to proceed. For example, the @key{RET}
773is usually omitted in key sequences like @kbd{M-x calc-keypad @key{RET}}. 773is usually omitted in key sequences like @kbd{M-x calc-keypad @key{RET}}.
774 774
775Commands are generally shown like this: @kbd{p} (@code{calc-precision}) 775Commands are generally shown like this: @kbd{p} (@code{calc-precision})
776or @kbd{M-# k} (@code{calc-keypad}). This means that the command is 776or @kbd{C-x * k} (@code{calc-keypad}). This means that the command is
777normally used by pressing the @kbd{p} key or @kbd{M-# k} key sequence, 777normally used by pressing the @kbd{p} key or @kbd{C-x * k} key sequence,
778but it also has the full-name equivalent shown, e.g., @kbd{M-x calc-precision}. 778but it also has the full-name equivalent shown, e.g., @kbd{M-x calc-precision}.
779 779
780Commands that correspond to functions in algebraic notation 780Commands that correspond to functions in algebraic notation
@@ -797,7 +797,7 @@ everything you see here will be covered more thoroughly in the
797Tutorial. 797Tutorial.
798 798
799To begin, start Emacs if necessary (usually the command @code{emacs} 799To begin, start Emacs if necessary (usually the command @code{emacs}
800does this), and type @kbd{M-# c} (or @kbd{@key{ESC} # c}) to start the 800does this), and type @kbd{C-x * c} to start the
801Calculator. (You can also use @kbd{M-x calc} if this doesn't work. 801Calculator. (You can also use @kbd{M-x calc} if this doesn't work.
802@xref{Starting Calc}, for various ways of starting the Calculator.) 802@xref{Starting Calc}, for various ways of starting the Calculator.)
803 803
@@ -849,7 +849,7 @@ Type @kbd{' arcsinh($ - $$) @key{RET}} to subtract the second-most-recent
849result from the most-recent and compute the Inverse Hyperbolic sine. 849result from the most-recent and compute the Inverse Hyperbolic sine.
850 850
851@strong{Keypad mode.} If you are using the X window system, press 851@strong{Keypad mode.} If you are using the X window system, press
852@w{@kbd{M-# k}} to get Keypad mode. (If you don't use X, skip to 852@w{@kbd{C-x * k}} to get Keypad mode. (If you don't use X, skip to
853the next section.) 853the next section.)
854 854
855@noindent 855@noindent
@@ -869,12 +869,12 @@ Click on @key{-}, @key{INV}, @key{HYP}, and @key{SIN}.
869Click on @key{<-} to erase the result, then click @key{OFF} to turn 869Click on @key{<-} to erase the result, then click @key{OFF} to turn
870the Keypad Calculator off. 870the Keypad Calculator off.
871 871
872@strong{Grabbing data.} Type @kbd{M-# x} if necessary to exit Calc. 872@strong{Grabbing data.} Type @kbd{C-x * x} if necessary to exit Calc.
873Now select the following numbers as an Emacs region: ``Mark'' the 873Now select the following numbers as an Emacs region: ``Mark'' the
874front of the list by typing @kbd{C-@key{SPC}} or @kbd{C-@@} there, 874front of the list by typing @kbd{C-@key{SPC}} or @kbd{C-@@} there,
875then move to the other end of the list. (Either get this list from 875then move to the other end of the list. (Either get this list from
876the on-line copy of this manual, accessed by @w{@kbd{M-# i}}, or just 876the on-line copy of this manual, accessed by @w{@kbd{C-x * i}}, or just
877type these numbers into a scratch file.) Now type @kbd{M-# g} to 877type these numbers into a scratch file.) Now type @kbd{C-x * g} to
878``grab'' these numbers into Calc. 878``grab'' these numbers into Calc.
879 879
880@example 880@example
@@ -896,7 +896,7 @@ the product of the numbers.
896@noindent 896@noindent
897You can also grab data as a rectangular matrix. Place the cursor on 897You can also grab data as a rectangular matrix. Place the cursor on
898the upper-leftmost @samp{1} and set the mark, then move to just after 898the upper-leftmost @samp{1} and set the mark, then move to just after
899the lower-right @samp{8} and press @kbd{M-# r}. 899the lower-right @samp{8} and press @kbd{C-x * r}.
900 900
901@noindent 901@noindent
902Type @kbd{v t} to transpose this 902Type @kbd{v t} to transpose this
@@ -908,7 +908,7 @@ matrix into a
908matrix. Type @w{@kbd{v u}} to unpack the rows into two separate 908matrix. Type @w{@kbd{v u}} to unpack the rows into two separate
909vectors. Now type @w{@kbd{V R + @key{TAB} V R +}} to compute the sums 909vectors. Now type @w{@kbd{V R + @key{TAB} V R +}} to compute the sums
910of the two original columns. (There is also a special 910of the two original columns. (There is also a special
911grab-and-sum-columns command, @kbd{M-# :}.) 911grab-and-sum-columns command, @kbd{C-x * :}.)
912 912
913@strong{Units conversion.} Units are entered algebraically. 913@strong{Units conversion.} Units are entered algebraically.
914Type @w{@kbd{' 43 mi/hr @key{RET}}} to enter the quantity 43 miles-per-hour. 914Type @w{@kbd{' 43 mi/hr @key{RET}}} to enter the quantity 43 miles-per-hour.
@@ -939,21 +939,21 @@ Type @kbd{7.5}, then @kbd{s l a @key{RET}} to let @expr{a = 7.5} in these formul
939 939
940@iftex 940@iftex
941@strong{Help functions.} You can read about any command in the on-line 941@strong{Help functions.} You can read about any command in the on-line
942manual. Type @kbd{M-# c} to return to Calc after each of these 942manual. Type @kbd{C-x * c} to return to Calc after each of these
943commands: @kbd{h k t N} to read about the @kbd{t N} command, 943commands: @kbd{h k t N} to read about the @kbd{t N} command,
944@kbd{h f sqrt @key{RET}} to read about the @code{sqrt} function, and 944@kbd{h f sqrt @key{RET}} to read about the @code{sqrt} function, and
945@kbd{h s} to read the Calc summary. 945@kbd{h s} to read the Calc summary.
946@end iftex 946@end iftex
947@ifinfo 947@ifinfo
948@strong{Help functions.} You can read about any command in the on-line 948@strong{Help functions.} You can read about any command in the on-line
949manual. Remember to type the letter @kbd{l}, then @kbd{M-# c}, to 949manual. Remember to type the letter @kbd{l}, then @kbd{C-x * c}, to
950return here after each of these commands: @w{@kbd{h k t N}} to read 950return here after each of these commands: @w{@kbd{h k t N}} to read
951about the @w{@kbd{t N}} command, @kbd{h f sqrt @key{RET}} to read about the 951about the @w{@kbd{t N}} command, @kbd{h f sqrt @key{RET}} to read about the
952@code{sqrt} function, and @kbd{h s} to read the Calc summary. 952@code{sqrt} function, and @kbd{h s} to read the Calc summary.
953@end ifinfo 953@end ifinfo
954 954
955Press @key{DEL} repeatedly to remove any leftover results from the stack. 955Press @key{DEL} repeatedly to remove any leftover results from the stack.
956To exit from Calc, press @kbd{q} or @kbd{M-# c} again. 956To exit from Calc, press @kbd{q} or @kbd{C-x * c} again.
957 957
958@node Using Calc, History and Acknowledgements, Demonstration of Calc, Getting Started 958@node Using Calc, History and Acknowledgements, Demonstration of Calc, Getting Started
959@section Using Calc 959@section Using Calc
@@ -970,54 +970,38 @@ there are Quick mode, Keypad mode, and Embedded mode.
970* Keypad Mode Overview:: 970* Keypad Mode Overview::
971* Standalone Operation:: 971* Standalone Operation::
972* Embedded Mode Overview:: 972* Embedded Mode Overview::
973* Other M-# Commands:: 973* Other C-x * Commands::
974@end menu 974@end menu
975 975
976@node Starting Calc, The Standard Interface, Using Calc, Using Calc 976@node Starting Calc, The Standard Interface, Using Calc, Using Calc
977@subsection Starting Calc 977@subsection Starting Calc
978 978
979@noindent 979@noindent
980On most systems, you can type @kbd{M-#} to start the Calculator. 980On most systems, you can type @kbd{C-x *} to start the Calculator.
981The notation @kbd{M-#} is short for Meta-@kbd{#}. On most 981The key sequence @kbd{C-x *} is bound to the command @code{calc-dispatch},
982keyboards this means holding down the Meta (or Alt) and 982which can be rebound if convenient (@pxref{Customizing Calc}).
983Shift keys while typing @kbd{3}.
984 983
985@cindex META key 984When you press @kbd{C-x *}, Emacs waits for you to press a second key to
986Once again, if you don't have a Meta key on your keyboard you can type 985complete the command. In this case, you will follow @kbd{C-x *} with a
987@key{ESC} first, then @kbd{#}, to accomplish the same thing. If you 986letter (upper- or lower-case, it doesn't matter for @kbd{C-x *}) that says
988don't even have an @key{ESC} key, you can fake it by holding down
989Control or @key{CTRL} while typing a left square bracket
990(that's @kbd{C-[} in Emacs notation).
991
992The key @kbd{M-#} is bound to the command @code{calc-dispatch},
993which can be rebound if convenient.
994(@xref{Key Bindings,,Customizing Key Bindings,emacs,
995The GNU Emacs Manual}.)
996
997When you press @kbd{M-#}, Emacs waits for you to press a second key to
998complete the command. In this case, you will follow @kbd{M-#} with a
999letter (upper- or lower-case, it doesn't matter for @kbd{M-#}) that says
1000which Calc interface you want to use. 987which Calc interface you want to use.
1001 988
1002To get Calc's standard interface, type @kbd{M-# c}. To get 989To get Calc's standard interface, type @kbd{C-x * c}. To get
1003Keypad mode, type @kbd{M-# k}. Type @kbd{M-# ?} to get a brief 990Keypad mode, type @kbd{C-x * k}. Type @kbd{C-x * ?} to get a brief
1004list of the available options, and type a second @kbd{?} to get 991list of the available options, and type a second @kbd{?} to get
1005a complete list. 992a complete list.
1006 993
1007To ease typing, @kbd{M-# M-#} (or @kbd{M-# #} if that's easier) 994To ease typing, @kbd{C-x * *} also works to start Calc. It starts the
1008also works to start Calc. It starts the same interface (either 995same interface (either @kbd{C-x * c} or @w{@kbd{C-x * k}}) that you last
1009@kbd{M-# c} or @w{@kbd{M-# k}}) that you last used, selecting the 996used, selecting the @kbd{C-x * c} interface by default.
1010@kbd{M-# c} interface by default. (If your installation has
1011a special function key set up to act like @kbd{M-#}, hitting that
1012function key twice is just like hitting @kbd{M-# M-#}.)
1013 997
1014If @kbd{M-#} doesn't work for you, you can always type explicit 998If @kbd{C-x *} doesn't work for you, you can always type explicit
1015commands like @kbd{M-x calc} (for the standard user interface) or 999commands like @kbd{M-x calc} (for the standard user interface) or
1016@w{@kbd{M-x calc-keypad}} (for Keypad mode). First type @kbd{M-x} 1000@w{@kbd{M-x calc-keypad}} (for Keypad mode). First type @kbd{M-x}
1017(that's Meta with the letter @kbd{x}), then, at the prompt, 1001(that's Meta with the letter @kbd{x}), then, at the prompt,
1018type the full command (like @kbd{calc-keypad}) and press Return. 1002type the full command (like @kbd{calc-keypad}) and press Return.
1019 1003
1020The same commands (like @kbd{M-# c} or @kbd{M-# M-#}) that start 1004The same commands (like @kbd{C-x * c} or @kbd{C-x * *}) that start
1021the Calculator also turn it off if it is already on. 1005the Calculator also turn it off if it is already on.
1022 1006
1023@node The Standard Interface, Quick Mode Overview, Starting Calc, Using Calc 1007@node The Standard Interface, Quick Mode Overview, Starting Calc, Using Calc
@@ -1026,7 +1010,7 @@ the Calculator also turn it off if it is already on.
1026@noindent 1010@noindent
1027@cindex Standard user interface 1011@cindex Standard user interface
1028Calc's standard interface acts like a traditional RPN calculator, 1012Calc's standard interface acts like a traditional RPN calculator,
1029operated by the normal Emacs keyboard. When you type @kbd{M-# c} 1013operated by the normal Emacs keyboard. When you type @kbd{C-x * c}
1030to start the Calculator, the Emacs screen splits into two windows 1014to start the Calculator, the Emacs screen splits into two windows
1031with the file you were editing on top and Calc on the bottom. 1015with the file you were editing on top and Calc on the bottom.
1032 1016
@@ -1082,55 +1066,55 @@ inside a regular window, Emacs acts just like normal. When the
1082cursor is in the Calc stack or trail windows, keys are interpreted 1066cursor is in the Calc stack or trail windows, keys are interpreted
1083as Calc commands. 1067as Calc commands.
1084 1068
1085When you quit by pressing @kbd{M-# c} a second time, the Calculator 1069When you quit by pressing @kbd{C-x * c} a second time, the Calculator
1086windows go away but the actual Stack and Trail are not gone, just 1070windows go away but the actual Stack and Trail are not gone, just
1087hidden. When you press @kbd{M-# c} once again you will get the 1071hidden. When you press @kbd{C-x * c} once again you will get the
1088same stack and trail contents you had when you last used the 1072same stack and trail contents you had when you last used the
1089Calculator. 1073Calculator.
1090 1074
1091The Calculator does not remember its state between Emacs sessions. 1075The Calculator does not remember its state between Emacs sessions.
1092Thus if you quit Emacs and start it again, @kbd{M-# c} will give you 1076Thus if you quit Emacs and start it again, @kbd{C-x * c} will give you
1093a fresh stack and trail. There is a command (@kbd{m m}) that lets 1077a fresh stack and trail. There is a command (@kbd{m m}) that lets
1094you save your favorite mode settings between sessions, though. 1078you save your favorite mode settings between sessions, though.
1095One of the things it saves is which user interface (standard or 1079One of the things it saves is which user interface (standard or
1096Keypad) you last used; otherwise, a freshly started Emacs will 1080Keypad) you last used; otherwise, a freshly started Emacs will
1097always treat @kbd{M-# M-#} the same as @kbd{M-# c}. 1081always treat @kbd{C-x * *} the same as @kbd{C-x * c}.
1098 1082
1099The @kbd{q} key is another equivalent way to turn the Calculator off. 1083The @kbd{q} key is another equivalent way to turn the Calculator off.
1100 1084
1101If you type @kbd{M-# b} first and then @kbd{M-# c}, you get a 1085If you type @kbd{C-x * b} first and then @kbd{C-x * c}, you get a
1102full-screen version of Calc (@code{full-calc}) in which the stack and 1086full-screen version of Calc (@code{full-calc}) in which the stack and
1103trail windows are still side-by-side but are now as tall as the whole 1087trail windows are still side-by-side but are now as tall as the whole
1104Emacs screen. When you press @kbd{q} or @kbd{M-# c} again to quit, 1088Emacs screen. When you press @kbd{q} or @kbd{C-x * c} again to quit,
1105the file you were editing before reappears. The @kbd{M-# b} key 1089the file you were editing before reappears. The @kbd{C-x * b} key
1106switches back and forth between ``big'' full-screen mode and the 1090switches back and forth between ``big'' full-screen mode and the
1107normal partial-screen mode. 1091normal partial-screen mode.
1108 1092
1109Finally, @kbd{M-# o} (@code{calc-other-window}) is like @kbd{M-# c} 1093Finally, @kbd{C-x * o} (@code{calc-other-window}) is like @kbd{C-x * c}
1110except that the Calc window is not selected. The buffer you were 1094except that the Calc window is not selected. The buffer you were
1111editing before remains selected instead. @kbd{M-# o} is a handy 1095editing before remains selected instead. @kbd{C-x * o} is a handy
1112way to switch out of Calc momentarily to edit your file; type 1096way to switch out of Calc momentarily to edit your file; type
1113@kbd{M-# c} to switch back into Calc when you are done. 1097@kbd{C-x * c} to switch back into Calc when you are done.
1114 1098
1115@node Quick Mode Overview, Keypad Mode Overview, The Standard Interface, Using Calc 1099@node Quick Mode Overview, Keypad Mode Overview, The Standard Interface, Using Calc
1116@subsection Quick Mode (Overview) 1100@subsection Quick Mode (Overview)
1117 1101
1118@noindent 1102@noindent
1119@dfn{Quick mode} is a quick way to use Calc when you don't need the 1103@dfn{Quick mode} is a quick way to use Calc when you don't need the
1120full complexity of the stack and trail. To use it, type @kbd{M-# q} 1104full complexity of the stack and trail. To use it, type @kbd{C-x * q}
1121(@code{quick-calc}) in any regular editing buffer. 1105(@code{quick-calc}) in any regular editing buffer.
1122 1106
1123Quick mode is very simple: It prompts you to type any formula in 1107Quick mode is very simple: It prompts you to type any formula in
1124standard algebraic notation (like @samp{4 - 2/3}) and then displays 1108standard algebraic notation (like @samp{4 - 2/3}) and then displays
1125the result at the bottom of the Emacs screen (@mathit{3.33333333333} 1109the result at the bottom of the Emacs screen (@mathit{3.33333333333}
1126in this case). You are then back in the same editing buffer you 1110in this case). You are then back in the same editing buffer you
1127were in before, ready to continue editing or to type @kbd{M-# q} 1111were in before, ready to continue editing or to type @kbd{C-x * q}
1128again to do another quick calculation. The result of the calculation 1112again to do another quick calculation. The result of the calculation
1129will also be in the Emacs ``kill ring'' so that a @kbd{C-y} command 1113will also be in the Emacs ``kill ring'' so that a @kbd{C-y} command
1130at this point will yank the result into your editing buffer. 1114at this point will yank the result into your editing buffer.
1131 1115
1132Calc mode settings affect Quick mode, too, though you will have to 1116Calc mode settings affect Quick mode, too, though you will have to
1133go into regular Calc (with @kbd{M-# c}) to change the mode settings. 1117go into regular Calc (with @kbd{C-x * c}) to change the mode settings.
1134 1118
1135@c [fix-ref Quick Calculator mode] 1119@c [fix-ref Quick Calculator mode]
1136@xref{Quick Calculator}, for further information. 1120@xref{Quick Calculator}, for further information.
@@ -1144,7 +1128,7 @@ It is designed for use with terminals that support a mouse. If you
1144don't have a mouse, you will have to operate Keypad mode with your 1128don't have a mouse, you will have to operate Keypad mode with your
1145arrow keys (which is probably more trouble than it's worth). 1129arrow keys (which is probably more trouble than it's worth).
1146 1130
1147Type @kbd{M-# k} to turn Keypad mode on or off. Once again you 1131Type @kbd{C-x * k} to turn Keypad mode on or off. Once again you
1148get two new windows, this time on the righthand side of the screen 1132get two new windows, this time on the righthand side of the screen
1149instead of at the bottom. The upper window is the familiar Calc 1133instead of at the bottom. The upper window is the familiar Calc
1150Stack; the lower window is a picture of a typical calculator keypad. 1134Stack; the lower window is a picture of a typical calculator keypad.
@@ -1206,7 +1190,7 @@ this buffer in the usual way while also clicking on the Calculator
1206keypad. One advantage of Keypad mode is that you don't need an 1190keypad. One advantage of Keypad mode is that you don't need an
1207explicit command to switch between editing and calculating. 1191explicit command to switch between editing and calculating.
1208 1192
1209If you press @kbd{M-# b} first, you get a full-screen Keypad mode 1193If you press @kbd{C-x * b} first, you get a full-screen Keypad mode
1210(@code{full-calc-keypad}) with three windows: The keypad in the lower 1194(@code{full-calc-keypad}) with three windows: The keypad in the lower
1211left, the stack in the lower right, and the trail on top. 1195left, the stack in the lower right, and the trail on top.
1212 1196
@@ -1234,13 +1218,13 @@ emacs -f full-calc-keypad
1234@end example 1218@end example
1235 1219
1236@noindent 1220@noindent
1237which run a full-screen Calculator (as if by @kbd{M-# b M-# c}) or 1221which run a full-screen Calculator (as if by @kbd{C-x * b C-x * c}) or
1238a full-screen X-based Calculator (as if by @kbd{M-# b M-# k}). 1222a full-screen X-based Calculator (as if by @kbd{C-x * b C-x * k}).
1239In standalone operation, quitting the Calculator (by pressing 1223In standalone operation, quitting the Calculator (by pressing
1240@kbd{q} or clicking on the keypad @key{EXIT} button) quits Emacs 1224@kbd{q} or clicking on the keypad @key{EXIT} button) quits Emacs
1241itself. 1225itself.
1242 1226
1243@node Embedded Mode Overview, Other M-# Commands, Standalone Operation, Using Calc 1227@node Embedded Mode Overview, Other C-x * Commands, Standalone Operation, Using Calc
1244@subsection Embedded Mode (Overview) 1228@subsection Embedded Mode (Overview)
1245 1229
1246@noindent 1230@noindent
@@ -1276,7 +1260,7 @@ is
1276@end group 1260@end group
1277@end smallexample 1261@end smallexample
1278 1262
1279Now, move the cursor onto this new formula and press @kbd{M-# e}. 1263Now, move the cursor onto this new formula and press @kbd{C-x * e}.
1280Calc will read the formula (using the surrounding blank lines to 1264Calc will read the formula (using the surrounding blank lines to
1281tell how much text to read), then push this formula (invisibly) 1265tell how much text to read), then push this formula (invisibly)
1282onto the Calc stack. The cursor will stay on the formula in the 1266onto the Calc stack. The cursor will stay on the formula in the
@@ -1340,10 +1324,10 @@ righthand label: Type @kbd{d @} (1) @key{RET}}.
1340@end group 1324@end group
1341@end smallexample 1325@end smallexample
1342 1326
1343To leave Embedded mode, type @kbd{M-# e} again. The mode line 1327To leave Embedded mode, type @kbd{C-x * e} again. The mode line
1344and keyboard will revert to the way they were before. 1328and keyboard will revert to the way they were before.
1345 1329
1346The related command @kbd{M-# w} operates on a single word, which 1330The related command @kbd{C-x * w} operates on a single word, which
1347generally means a single number, inside text. It uses any 1331generally means a single number, inside text. It uses any
1348non-numeric characters rather than blank lines to delimit the 1332non-numeric characters rather than blank lines to delimit the
1349formula it reads. Here's an example of its use: 1333formula it reads. Here's an example of its use:
@@ -1352,10 +1336,10 @@ formula it reads. Here's an example of its use:
1352A slope of one-third corresponds to an angle of 1 degrees. 1336A slope of one-third corresponds to an angle of 1 degrees.
1353@end smallexample 1337@end smallexample
1354 1338
1355Place the cursor on the @samp{1}, then type @kbd{M-# w} to enable 1339Place the cursor on the @samp{1}, then type @kbd{C-x * w} to enable
1356Embedded mode on that number. Now type @kbd{3 /} (to get one-third), 1340Embedded mode on that number. Now type @kbd{3 /} (to get one-third),
1357and @kbd{I T} (the Inverse Tangent converts a slope into an angle), 1341and @kbd{I T} (the Inverse Tangent converts a slope into an angle),
1358then @w{@kbd{M-# w}} again to exit Embedded mode. 1342then @w{@kbd{C-x * w}} again to exit Embedded mode.
1359 1343
1360@smallexample 1344@smallexample
1361A slope of one-third corresponds to an angle of 18.4349488229 degrees. 1345A slope of one-third corresponds to an angle of 18.4349488229 degrees.
@@ -1364,48 +1348,51 @@ A slope of one-third corresponds to an angle of 18.4349488229 degrees.
1364@c [fix-ref Embedded Mode] 1348@c [fix-ref Embedded Mode]
1365@xref{Embedded Mode}, for full details. 1349@xref{Embedded Mode}, for full details.
1366 1350
1367@node Other M-# Commands, , Embedded Mode Overview, Using Calc 1351@node Other C-x * Commands, , Embedded Mode Overview, Using Calc
1368@subsection Other @kbd{M-#} Commands 1352@subsection Other @kbd{C-x *} Commands
1369 1353
1370@noindent 1354@noindent
1371Two more Calc-related commands are @kbd{M-# g} and @kbd{M-# r}, 1355Two more Calc-related commands are @kbd{C-x * g} and @kbd{C-x * r},
1372which ``grab'' data from a selected region of a buffer into the 1356which ``grab'' data from a selected region of a buffer into the
1373Calculator. The region is defined in the usual Emacs way, by 1357Calculator. The region is defined in the usual Emacs way, by
1374a ``mark'' placed at one end of the region, and the Emacs 1358a ``mark'' placed at one end of the region, and the Emacs
1375cursor or ``point'' placed at the other. 1359cursor or ``point'' placed at the other.
1376 1360
1377The @kbd{M-# g} command reads the region in the usual left-to-right, 1361The @kbd{C-x * g} command reads the region in the usual left-to-right,
1378top-to-bottom order. The result is packaged into a Calc vector 1362top-to-bottom order. The result is packaged into a Calc vector
1379of numbers and placed on the stack. Calc (in its standard 1363of numbers and placed on the stack. Calc (in its standard
1380user interface) is then started. Type @kbd{v u} if you want 1364user interface) is then started. Type @kbd{v u} if you want
1381to unpack this vector into separate numbers on the stack. Also, 1365to unpack this vector into separate numbers on the stack. Also,
1382@kbd{C-u M-# g} interprets the region as a single number or 1366@kbd{C-u C-x * g} interprets the region as a single number or
1383formula. 1367formula.
1384 1368
1385The @kbd{M-# r} command reads a rectangle, with the point and 1369The @kbd{C-x * r} command reads a rectangle, with the point and
1386mark defining opposite corners of the rectangle. The result 1370mark defining opposite corners of the rectangle. The result
1387is a matrix of numbers on the Calculator stack. 1371is a matrix of numbers on the Calculator stack.
1388 1372
1389Complementary to these is @kbd{M-# y}, which ``yanks'' the 1373Complementary to these is @kbd{C-x * y}, which ``yanks'' the
1390value at the top of the Calc stack back into an editing buffer. 1374value at the top of the Calc stack back into an editing buffer.
1391If you type @w{@kbd{M-# y}} while in such a buffer, the value is 1375If you type @w{@kbd{C-x * y}} while in such a buffer, the value is
1392yanked at the current position. If you type @kbd{M-# y} while 1376yanked at the current position. If you type @kbd{C-x * y} while
1393in the Calc buffer, Calc makes an educated guess as to which 1377in the Calc buffer, Calc makes an educated guess as to which
1394editing buffer you want to use. The Calc window does not have 1378editing buffer you want to use. The Calc window does not have
1395to be visible in order to use this command, as long as there 1379to be visible in order to use this command, as long as there
1396is something on the Calc stack. 1380is something on the Calc stack.
1397 1381
1398Here, for reference, is the complete list of @kbd{M-#} commands. 1382Here, for reference, is the complete list of @kbd{C-x *} commands.
1399The shift, control, and meta keys are ignored for the keystroke 1383The shift, control, and meta keys are ignored for the keystroke
1400following @kbd{M-#}. 1384following @kbd{C-x *}.
1401 1385
1402@noindent 1386@noindent
1403Commands for turning Calc on and off: 1387Commands for turning Calc on and off:
1404 1388
1405@table @kbd 1389@table @kbd
1406@item # 1390@item *
1407Turn Calc on or off, employing the same user interface as last time. 1391Turn Calc on or off, employing the same user interface as last time.
1408 1392
1393@item =, +, -, /, \, &, #
1394Alternatives for @kbd{*}.
1395
1409@item C 1396@item C
1410Turn Calc on or off using its standard bottom-of-the-screen 1397Turn Calc on or off using its standard bottom-of-the-screen
1411interface. If Calc is already turned on but the cursor is not 1398interface. If Calc is already turned on but the cursor is not
@@ -1417,7 +1404,7 @@ Calc is already turned on and the cursor is in the Calc window,
1417move it out of that window. 1404move it out of that window.
1418 1405
1419@item B 1406@item B
1420Control whether @kbd{M-# c} and @kbd{M-# k} use the full screen. 1407Control whether @kbd{C-x * c} and @kbd{C-x * k} use the full screen.
1421 1408
1422@item Q 1409@item Q
1423Use Quick mode for a single short calculation. 1410Use Quick mode for a single short calculation.
@@ -1628,7 +1615,7 @@ finished in two weeks.
1628@c [tutorial] 1615@c [tutorial]
1629 1616
1630@ifinfo 1617@ifinfo
1631@c This node is accessed by the `M-# t' command. 1618@c This node is accessed by the `C-x * t' command.
1632@node Interactive Tutorial, , , Top 1619@node Interactive Tutorial, , , Top
1633@chapter Tutorial 1620@chapter Tutorial
1634 1621
@@ -1682,16 +1669,16 @@ the Embedded mode interface.
1682The easiest way to read this tutorial on-line is to have two windows on 1669The easiest way to read this tutorial on-line is to have two windows on
1683your Emacs screen, one with Calc and one with the Info system. (If you 1670your Emacs screen, one with Calc and one with the Info system. (If you
1684have a printed copy of the manual you can use that instead.) Press 1671have a printed copy of the manual you can use that instead.) Press
1685@kbd{M-# c} to turn Calc on or to switch into the Calc window, and 1672@kbd{C-x * c} to turn Calc on or to switch into the Calc window, and
1686press @kbd{M-# i} to start the Info system or to switch into its window. 1673press @kbd{C-x * i} to start the Info system or to switch into its window.
1687Or, you may prefer to use the tutorial in printed form. 1674Or, you may prefer to use the tutorial in printed form.
1688@end ifinfo 1675@end ifinfo
1689@iftex 1676@iftex
1690The easiest way to read this tutorial on-line is to have two windows on 1677The easiest way to read this tutorial on-line is to have two windows on
1691your Emacs screen, one with Calc and one with the Info system. (If you 1678your Emacs screen, one with Calc and one with the Info system. (If you
1692have a printed copy of the manual you can use that instead.) Press 1679have a printed copy of the manual you can use that instead.) Press
1693@kbd{M-# c} to turn Calc on or to switch into the Calc window, and 1680@kbd{C-x * c} to turn Calc on or to switch into the Calc window, and
1694press @kbd{M-# i} to start the Info system or to switch into its window. 1681press @kbd{C-x * i} to start the Info system or to switch into its window.
1695@end iftex 1682@end iftex
1696 1683
1697This tutorial is designed to be done in sequence. But the rest of this 1684This tutorial is designed to be done in sequence. But the rest of this
@@ -1772,8 +1759,8 @@ number of operands from the stack and pushes back the result.
1772Thus we could add the numbers 2 and 3 in an RPN calculator by typing: 1759Thus we could add the numbers 2 and 3 in an RPN calculator by typing:
1773@kbd{2 @key{RET} 3 @key{RET} +}. (The @key{RET} key, Return, corresponds to 1760@kbd{2 @key{RET} 3 @key{RET} +}. (The @key{RET} key, Return, corresponds to
1774the @key{ENTER} key on traditional RPN calculators.) Try this now if 1761the @key{ENTER} key on traditional RPN calculators.) Try this now if
1775you wish; type @kbd{M-# c} to switch into the Calc window (you can type 1762you wish; type @kbd{C-x * c} to switch into the Calc window (you can type
1776@kbd{M-# c} again or @kbd{M-# o} to switch back to the Tutorial window). 1763@kbd{C-x * c} again or @kbd{C-x * o} to switch back to the Tutorial window).
1777The first four keystrokes ``push'' the numbers 2 and 3 onto the stack. 1764The first four keystrokes ``push'' the numbers 2 and 3 onto the stack.
1778The @kbd{+} key ``pops'' the top two numbers from the stack, adds them, 1765The @kbd{+} key ``pops'' the top two numbers from the stack, adds them,
1779and pushes the result (5) back onto the stack. Here's how the stack 1766and pushes the result (5) back onto the stack. Here's how the stack
@@ -1785,7 +1772,7 @@ will look at various points throughout the calculation:
1785 . 1: 3 . 1772 . 1: 3 .
1786 . 1773 .
1787 1774
1788 M-# c 2 @key{RET} 3 @key{RET} + @key{DEL} 1775 C-x * c 2 @key{RET} 3 @key{RET} + @key{DEL}
1789@end group 1776@end group
1790@end smallexample 1777@end smallexample
1791 1778
@@ -2434,7 +2421,7 @@ when we discuss the algebra and calculus features of the Calculator.
2434@noindent 2421@noindent
2435If you make a mistake, you can usually correct it by pressing shift-@kbd{U}, 2422If you make a mistake, you can usually correct it by pressing shift-@kbd{U},
2436the ``undo'' command. First, clear the stack (@kbd{M-0 @key{DEL}}) and exit 2423the ``undo'' command. First, clear the stack (@kbd{M-0 @key{DEL}}) and exit
2437and restart Calc (@kbd{M-# M-# M-# M-#}) to make sure things start off 2424and restart Calc (@kbd{C-x * * C-x * *}) to make sure things start off
2438with a clean slate. Now: 2425with a clean slate. Now:
2439 2426
2440@smallexample 2427@smallexample
@@ -4093,7 +4080,7 @@ of values in a file we have loaded into Emacs:
4093 4080
4094@noindent 4081@noindent
4095If you are reading this tutorial in printed form, you will find it 4082If you are reading this tutorial in printed form, you will find it
4096easiest to press @kbd{M-# i} to enter the on-line Info version of 4083easiest to press @kbd{C-x * i} to enter the on-line Info version of
4097the manual and find this table there. (Press @kbd{g}, then type 4084the manual and find this table there. (Press @kbd{g}, then type
4098@kbd{List Tutorial}, to jump straight to this section.) 4085@kbd{List Tutorial}, to jump straight to this section.)
4099 4086
@@ -4102,7 +4089,7 @@ to the left of the @expr{1.34}. Press @kbd{C-@@} to set the mark.
4102(On your system this may be @kbd{C-2}, @kbd{C-@key{SPC}}, or @kbd{NUL}.) 4089(On your system this may be @kbd{C-2}, @kbd{C-@key{SPC}}, or @kbd{NUL}.)
4103Now position the cursor to the lower-right, just after the @expr{1.354}. 4090Now position the cursor to the lower-right, just after the @expr{1.354}.
4104You have now defined this region as an Emacs ``rectangle.'' Still 4091You have now defined this region as an Emacs ``rectangle.'' Still
4105in the Info buffer, type @kbd{M-# r}. This command 4092in the Info buffer, type @kbd{C-x * r}. This command
4106(@code{calc-grab-rectangle}) will pop you back into the Calculator, with 4093(@code{calc-grab-rectangle}) will pop you back into the Calculator, with
4107the contents of the rectangle you specified in the form of a matrix. 4094the contents of the rectangle you specified in the form of a matrix.
4108 4095
@@ -4372,7 +4359,7 @@ to solve for @expr{m} and @expr{b}, duplicating the above result.
4372 4359
4373@cindex Geometric mean 4360@cindex Geometric mean
4374(@bullet{}) @strong{Exercise 3.} If the input data do not form a 4361(@bullet{}) @strong{Exercise 3.} If the input data do not form a
4375rectangle, you can use @w{@kbd{M-# g}} (@code{calc-grab-region}) 4362rectangle, you can use @w{@kbd{C-x * g}} (@code{calc-grab-region})
4376to grab the data the way Emacs normally works with regions---it reads 4363to grab the data the way Emacs normally works with regions---it reads
4377left-to-right, top-to-bottom, treating line breaks the same as spaces. 4364left-to-right, top-to-bottom, treating line breaks the same as spaces.
4378Use this command to find the geometric mean of the following numbers. 4365Use this command to find the geometric mean of the following numbers.
@@ -4385,7 +4372,7 @@ Use this command to find the geometric mean of the following numbers.
4385@end example 4372@end example
4386 4373
4387@noindent 4374@noindent
4388The @kbd{M-# g} command accepts numbers separated by spaces or commas, 4375The @kbd{C-x * g} command accepts numbers separated by spaces or commas,
4389with or without surrounding vector brackets. 4376with or without surrounding vector brackets.
4390@xref{List Answer 3, 3}. (@bullet{}) 4377@xref{List Answer 3, 3}. (@bullet{})
4391 4378
@@ -5120,7 +5107,7 @@ numbers are in which units:
5120@end smallexample 5107@end smallexample
5121 5108
5122To see a complete list of built-in units, type @kbd{u v}. Press 5109To see a complete list of built-in units, type @kbd{u v}. Press
5123@w{@kbd{M-# c}} again to re-enter the Calculator when you're done looking 5110@w{@kbd{C-x * c}} again to re-enter the Calculator when you're done looking
5124at the units table. 5111at the units table.
5125 5112
5126(@bullet{}) @strong{Exercise 13.} How many seconds are there really 5113(@bullet{}) @strong{Exercise 13.} How many seconds are there really
@@ -6586,9 +6573,9 @@ The @file{edmacro} package defines a handy @code{read-kbd-macro} command
6586which reads the current region of the current buffer as a sequence of 6573which reads the current region of the current buffer as a sequence of
6587keystroke names, and defines that sequence on the @kbd{X} 6574keystroke names, and defines that sequence on the @kbd{X}
6588(and @kbd{C-x e}) key. Because this is so useful, Calc puts this 6575(and @kbd{C-x e}) key. Because this is so useful, Calc puts this
6589command on the @kbd{M-# m} key. Try reading in this macro in the 6576command on the @kbd{C-x * m} key. Try reading in this macro in the
6590following form: Press @kbd{C-@@} (or @kbd{C-@key{SPC}}) at 6577following form: Press @kbd{C-@@} (or @kbd{C-@key{SPC}}) at
6591one end of the text below, then type @kbd{M-# m} at the other. 6578one end of the text below, then type @kbd{C-x * m} at the other.
6592 6579
6593@example 6580@example
6594@group 6581@group
@@ -6738,7 +6725,7 @@ it to a key with, e.g., @kbd{Z K s}. Now enter the true definition,
6738using the @kbd{z s} command to call itself recursively, then assign it 6725using the @kbd{z s} command to call itself recursively, then assign it
6739to the same key with @kbd{Z K s}. Now the @kbd{z s} command will run 6726to the same key with @kbd{Z K s}. Now the @kbd{z s} command will run
6740the complete recursive program. (Another way is to use @w{@kbd{Z E}} 6727the complete recursive program. (Another way is to use @w{@kbd{Z E}}
6741or @kbd{M-# m} (@code{read-kbd-macro}) to read the whole macro at once, 6728or @kbd{C-x * m} (@code{read-kbd-macro}) to read the whole macro at once,
6742thus avoiding the ``training'' phase.) The task: Write a program 6729thus avoiding the ``training'' phase.) The task: Write a program
6743that computes Stirling numbers of the first kind, given @expr{n} and 6730that computes Stirling numbers of the first kind, given @expr{n} and
6744@expr{m} on the stack. Test it with @emph{small} inputs like 6731@expr{m} on the stack. Test it with @emph{small} inputs like
@@ -7530,7 +7517,7 @@ fits. @xref{Curve Fitting}.
7530@noindent 7517@noindent
7531Move to one end of the list and press @kbd{C-@@} (or @kbd{C-@key{SPC}} or 7518Move to one end of the list and press @kbd{C-@@} (or @kbd{C-@key{SPC}} or
7532whatever) to set the mark, then move to the other end of the list 7519whatever) to set the mark, then move to the other end of the list
7533and type @w{@kbd{M-# g}}. 7520and type @w{@kbd{C-x * g}}.
7534 7521
7535@smallexample 7522@smallexample
7536@group 7523@group
@@ -9525,7 +9512,7 @@ the formula
9525@infoline @expr{x - f(x)/f'(x)}. 9512@infoline @expr{x - f(x)/f'(x)}.
9526 9513
9527(Because this definition is long, it will be repeated in concise form 9514(Because this definition is long, it will be repeated in concise form
9528below. You can use @w{@kbd{M-# m}} to load it from there. While you are 9515below. You can use @w{@kbd{C-x * m}} to load it from there. While you are
9529entering a @kbd{Z ` Z '} body in a macro, Calc simply collects 9516entering a @kbd{Z ` Z '} body in a macro, Calc simply collects
9530keystrokes without executing them. In the following diagrams we'll 9517keystrokes without executing them. In the following diagrams we'll
9531pretend Calc actually executed the keystrokes as you typed them, 9518pretend Calc actually executed the keystrokes as you typed them,
@@ -9647,7 +9634,7 @@ and remember to add back a factor of @expr{-1/z} when we're done. This
9647step is repeated until @expr{z > 5}. 9634step is repeated until @expr{z > 5}.
9648 9635
9649(Because this definition is long, it will be repeated in concise form 9636(Because this definition is long, it will be repeated in concise form
9650below. You can use @w{@kbd{M-# m}} to load it from there. While you are 9637below. You can use @w{@kbd{C-x * m}} to load it from there. While you are
9651entering a @kbd{Z ` Z '} body in a macro, Calc simply collects 9638entering a @kbd{Z ` Z '} body in a macro, Calc simply collects
9652keystrokes without executing them. In the following diagrams we'll 9639keystrokes without executing them. In the following diagrams we'll
9653pretend Calc actually executed the keystrokes as you typed them, 9640pretend Calc actually executed the keystrokes as you typed them,
@@ -9768,7 +9755,7 @@ derivative of a polynomial, evaluated at @expr{x = 0}, will equal the
9768coefficient on the @expr{x^n} term times @expr{n!}. 9755coefficient on the @expr{x^n} term times @expr{n!}.
9769 9756
9770(Because this definition is long, it will be repeated in concise form 9757(Because this definition is long, it will be repeated in concise form
9771below. You can use @w{@kbd{M-# m}} to load it from there. While you are 9758below. You can use @w{@kbd{C-x * m}} to load it from there. While you are
9772entering a @kbd{Z ` Z '} body in a macro, Calc simply collects 9759entering a @kbd{Z ` Z '} body in a macro, Calc simply collects
9773keystrokes without executing them. In the following diagrams we'll 9760keystrokes without executing them. In the following diagrams we'll
9774pretend Calc actually executed the keystrokes as you typed them, 9761pretend Calc actually executed the keystrokes as you typed them,
@@ -9877,7 +9864,7 @@ definition. The recurrence needs to be rewritten slightly,
9877to the form @expr{s(n,m) = s(n-1,m-1) - (n-1) s(n-1,m)}. 9864to the form @expr{s(n,m) = s(n-1,m-1) - (n-1) s(n-1,m)}.
9878 9865
9879(Because this definition is long, it will be repeated in concise form 9866(Because this definition is long, it will be repeated in concise form
9880below. You can use @kbd{M-# m} to load it from there.) 9867below. You can use @kbd{C-x * m} to load it from there.)
9881 9868
9882@smallexample 9869@smallexample
9883@group 9870@group
@@ -9951,10 +9938,10 @@ C-x )
9951@end group 9938@end group
9952@end example 9939@end example
9953 9940
9954You can read this definition using @kbd{M-# m} (@code{read-kbd-macro}) 9941You can read this definition using @kbd{C-x * m} (@code{read-kbd-macro})
9955followed by @kbd{Z K s}, without having to make a dummy definition 9942followed by @kbd{Z K s}, without having to make a dummy definition
9956first, because @code{read-kbd-macro} doesn't need to execute the 9943first, because @code{read-kbd-macro} doesn't need to execute the
9957definition as it reads it in. For this reason, @code{M-# m} is often 9944definition as it reads it in. For this reason, @code{C-x * m} is often
9958the easiest way to create recursive programs in Calc. 9945the easiest way to create recursive programs in Calc.
9959 9946
9960@node Programming Answer 12, , Programming Answer 11, Answers to Exercises 9947@node Programming Answer 12, , Programming Answer 11, Answers to Exercises
@@ -10044,15 +10031,14 @@ still work when the trail buffer's window is selected. It is possible
10044to turn the trail window off, but the @samp{*Calc Trail*} buffer itself 10031to turn the trail window off, but the @samp{*Calc Trail*} buffer itself
10045still exists and is updated silently. @xref{Trail Commands}. 10032still exists and is updated silently. @xref{Trail Commands}.
10046 10033
10047@kindex M-# c 10034@kindex C-x * c
10048@kindex M-# M-# 10035@kindex C-x * *
10049@ignore 10036@ignore
10050@mindex @null 10037@mindex @null
10051@end ignore 10038@end ignore
10052@kindex M-# # 10039In most installations, the @kbd{C-x * c} key sequence is a more
10053In most installations, the @kbd{M-# c} key sequence is a more 10040convenient way to start the Calculator. Also, @kbd{C-x * *}
10054convenient way to start the Calculator. Also, @kbd{M-# M-#} and 10041is a synonym for @kbd{C-x * c} unless you last used Calc
10055@kbd{M-# #} are synonyms for @kbd{M-# c} unless you last used Calc
10056in its Keypad mode. 10042in its Keypad mode.
10057 10043
10058@kindex x 10044@kindex x
@@ -10068,7 +10054,7 @@ for you. For example, the following key sequences are equivalent:
10068 10054
10069@cindex Extensions module 10055@cindex Extensions module
10070@cindex @file{calc-ext} module 10056@cindex @file{calc-ext} module
10071The Calculator exists in many parts. When you type @kbd{M-# c}, the 10057The Calculator exists in many parts. When you type @kbd{C-x * c}, the
10072Emacs ``auto-load'' mechanism will bring in only the first part, which 10058Emacs ``auto-load'' mechanism will bring in only the first part, which
10073contains the basic arithmetic functions. The other parts will be 10059contains the basic arithmetic functions. The other parts will be
10074auto-loaded the first time you use the more advanced commands like trig 10060auto-loaded the first time you use the more advanced commands like trig
@@ -10076,48 +10062,48 @@ functions or matrix operations. This is done to improve the response time
10076of the Calculator in the common case when all you need to do is a 10062of the Calculator in the common case when all you need to do is a
10077little arithmetic. If for some reason the Calculator fails to load an 10063little arithmetic. If for some reason the Calculator fails to load an
10078extension module automatically, you can force it to load all the 10064extension module automatically, you can force it to load all the
10079extensions by using the @kbd{M-# L} (@code{calc-load-everything}) 10065extensions by using the @kbd{C-x * L} (@code{calc-load-everything})
10080command. @xref{Mode Settings}. 10066command. @xref{Mode Settings}.
10081 10067
10082If you type @kbd{M-x calc} or @kbd{M-# c} with any numeric prefix argument, 10068If you type @kbd{M-x calc} or @kbd{C-x * c} with any numeric prefix argument,
10083the Calculator is loaded if necessary, but it is not actually started. 10069the Calculator is loaded if necessary, but it is not actually started.
10084If the argument is positive, the @file{calc-ext} extensions are also 10070If the argument is positive, the @file{calc-ext} extensions are also
10085loaded if necessary. User-written Lisp code that wishes to make use 10071loaded if necessary. User-written Lisp code that wishes to make use
10086of Calc's arithmetic routines can use @samp{(calc 0)} or @samp{(calc 1)} 10072of Calc's arithmetic routines can use @samp{(calc 0)} or @samp{(calc 1)}
10087to auto-load the Calculator. 10073to auto-load the Calculator.
10088 10074
10089@kindex M-# b 10075@kindex C-x * b
10090@pindex full-calc 10076@pindex full-calc
10091If you type @kbd{M-# b}, then next time you use @kbd{M-# c} you 10077If you type @kbd{C-x * b}, then next time you use @kbd{C-x * c} you
10092will get a Calculator that uses the full height of the Emacs screen. 10078will get a Calculator that uses the full height of the Emacs screen.
10093When full-screen mode is on, @kbd{M-# c} runs the @code{full-calc} 10079When full-screen mode is on, @kbd{C-x * c} runs the @code{full-calc}
10094command instead of @code{calc}. From the Unix shell you can type 10080command instead of @code{calc}. From the Unix shell you can type
10095@samp{emacs -f full-calc} to start a new Emacs specifically for use 10081@samp{emacs -f full-calc} to start a new Emacs specifically for use
10096as a calculator. When Calc is started from the Emacs command line 10082as a calculator. When Calc is started from the Emacs command line
10097like this, Calc's normal ``quit'' commands actually quit Emacs itself. 10083like this, Calc's normal ``quit'' commands actually quit Emacs itself.
10098 10084
10099@kindex M-# o 10085@kindex C-x * o
10100@pindex calc-other-window 10086@pindex calc-other-window
10101The @kbd{M-# o} command is like @kbd{M-# c} except that the Calc 10087The @kbd{C-x * o} command is like @kbd{C-x * c} except that the Calc
10102window is not actually selected. If you are already in the Calc 10088window is not actually selected. If you are already in the Calc
10103window, @kbd{M-# o} switches you out of it. (The regular Emacs 10089window, @kbd{C-x * o} switches you out of it. (The regular Emacs
10104@kbd{C-x o} command would also work for this, but it has a 10090@kbd{C-x o} command would also work for this, but it has a
10105tendency to drop you into the Calc Trail window instead, which 10091tendency to drop you into the Calc Trail window instead, which
10106@kbd{M-# o} takes care not to do.) 10092@kbd{C-x * o} takes care not to do.)
10107 10093
10108@ignore 10094@ignore
10109@mindex M-# q 10095@mindex C-x * q
10110@end ignore 10096@end ignore
10111For one quick calculation, you can type @kbd{M-# q} (@code{quick-calc}) 10097For one quick calculation, you can type @kbd{C-x * q} (@code{quick-calc})
10112which prompts you for a formula (like @samp{2+3/4}). The result is 10098which prompts you for a formula (like @samp{2+3/4}). The result is
10113displayed at the bottom of the Emacs screen without ever creating 10099displayed at the bottom of the Emacs screen without ever creating
10114any special Calculator windows. @xref{Quick Calculator}. 10100any special Calculator windows. @xref{Quick Calculator}.
10115 10101
10116@ignore 10102@ignore
10117@mindex M-# k 10103@mindex C-x * k
10118@end ignore 10104@end ignore
10119Finally, if you are using the X window system you may want to try 10105Finally, if you are using the X window system you may want to try
10120@kbd{M-# k} (@code{calc-keypad}) which runs Calc with a 10106@kbd{C-x * k} (@code{calc-keypad}) which runs Calc with a
10121``calculator keypad'' picture as well as a stack display. Click on 10107``calculator keypad'' picture as well as a stack display. Click on
10122the keys with the mouse to operate the calculator. @xref{Keypad Mode}. 10108the keys with the mouse to operate the calculator. @xref{Keypad Mode}.
10123 10109
@@ -10128,13 +10114,13 @@ the keys with the mouse to operate the calculator. @xref{Keypad Mode}.
10128The @kbd{q} key (@code{calc-quit}) exits Calc mode and closes the 10114The @kbd{q} key (@code{calc-quit}) exits Calc mode and closes the
10129Calculator's window(s). It does not delete the Calculator buffers. 10115Calculator's window(s). It does not delete the Calculator buffers.
10130If you type @kbd{M-x calc} again, the Calculator will reappear with the 10116If you type @kbd{M-x calc} again, the Calculator will reappear with the
10131contents of the stack intact. Typing @kbd{M-# c} or @kbd{M-# M-#} 10117contents of the stack intact. Typing @kbd{C-x * c} or @kbd{C-x * *}
10132again from inside the Calculator buffer is equivalent to executing 10118again from inside the Calculator buffer is equivalent to executing
10133@code{calc-quit}; you can think of @kbd{M-# M-#} as toggling the 10119@code{calc-quit}; you can think of @kbd{C-x * *} as toggling the
10134Calculator on and off. 10120Calculator on and off.
10135 10121
10136@kindex M-# x 10122@kindex C-x * x
10137The @kbd{M-# x} command also turns the Calculator off, no matter which 10123The @kbd{C-x * x} command also turns the Calculator off, no matter which
10138user interface (standard, Keypad, or Embedded) is currently active. 10124user interface (standard, Keypad, or Embedded) is currently active.
10139It also cancels @code{calc-edit} mode if used from there. 10125It also cancels @code{calc-edit} mode if used from there.
10140 10126
@@ -10174,18 +10160,18 @@ The @kbd{@{} and @kbd{@}} keys are bound to @code{calc-scroll-down}
10174and @code{calc-scroll-up}. They scroll up or down by one-half the 10160and @code{calc-scroll-up}. They scroll up or down by one-half the
10175height of the Calc window. 10161height of the Calc window.
10176 10162
10177@kindex M-# 0 10163@kindex C-x * 0
10178@pindex calc-reset 10164@pindex calc-reset
10179The @kbd{M-# 0} command (@code{calc-reset}; that's @kbd{M-#} followed 10165The @kbd{C-x * 0} command (@code{calc-reset}; that's @kbd{C-x *} followed
10180by a zero) resets the Calculator to its initial state. This clears 10166by a zero) resets the Calculator to its initial state. This clears
10181the stack, resets all the modes to their initial values (the values 10167the stack, resets all the modes to their initial values (the values
10182that were saved with @kbd{m m} (@code{calc-save-modes})), clears the 10168that were saved with @kbd{m m} (@code{calc-save-modes})), clears the
10183caches (@pxref{Caches}), and so on. (It does @emph{not} erase the 10169caches (@pxref{Caches}), and so on. (It does @emph{not} erase the
10184values of any variables.) With an argument of 0, Calc will be reset to 10170values of any variables.) With an argument of 0, Calc will be reset to
10185its default state; namely, the modes will be given their default values. 10171its default state; namely, the modes will be given their default values.
10186With a positive prefix argument, @kbd{M-# 0} preserves the contents of 10172With a positive prefix argument, @kbd{C-x * 0} preserves the contents of
10187the stack but resets everything else to its initial state; with a 10173the stack but resets everything else to its initial state; with a
10188negative prefix argument, @kbd{M-# 0} preserves the contents of the 10174negative prefix argument, @kbd{C-x * 0} preserves the contents of the
10189stack but resets everything else to its default state. 10175stack but resets everything else to its default state.
10190 10176
10191@pindex calc-version 10177@pindex calc-version
@@ -10219,21 +10205,21 @@ provide help within Calc. Many of the @kbd{h} key functions are
10219Calc-specific analogues to the @kbd{C-h} functions for Emacs help. 10205Calc-specific analogues to the @kbd{C-h} functions for Emacs help.
10220 10206
10221@kindex h i 10207@kindex h i
10222@kindex M-# i 10208@kindex C-x * i
10223@kindex i 10209@kindex i
10224@pindex calc-info 10210@pindex calc-info
10225The @kbd{h i} (@code{calc-info}) command runs the Emacs Info system 10211The @kbd{h i} (@code{calc-info}) command runs the Emacs Info system
10226to read this manual on-line. This is basically the same as typing 10212to read this manual on-line. This is basically the same as typing
10227@kbd{C-h i} (the regular way to run the Info system), then, if Info 10213@kbd{C-h i} (the regular way to run the Info system), then, if Info
10228is not already in the Calc manual, selecting the beginning of the 10214is not already in the Calc manual, selecting the beginning of the
10229manual. The @kbd{M-# i} command is another way to read the Calc 10215manual. The @kbd{C-x * i} command is another way to read the Calc
10230manual; it is different from @kbd{h i} in that it works any time, 10216manual; it is different from @kbd{h i} in that it works any time,
10231not just inside Calc. The plain @kbd{i} key is also equivalent to 10217not just inside Calc. The plain @kbd{i} key is also equivalent to
10232@kbd{h i}, though this key is obsolete and may be replaced with a 10218@kbd{h i}, though this key is obsolete and may be replaced with a
10233different command in a future version of Calc. 10219different command in a future version of Calc.
10234 10220
10235@kindex h t 10221@kindex h t
10236@kindex M-# t 10222@kindex C-x * t
10237@pindex calc-tutorial 10223@pindex calc-tutorial
10238The @kbd{h t} (@code{calc-tutorial}) command runs the Info system on 10224The @kbd{h t} (@code{calc-tutorial}) command runs the Info system on
10239the Tutorial section of the Calc manual. It is like @kbd{h i}, 10225the Tutorial section of the Calc manual. It is like @kbd{h i},
@@ -10241,14 +10227,14 @@ except that it selects the starting node of the tutorial rather
10241than the beginning of the whole manual. (It actually selects the 10227than the beginning of the whole manual. (It actually selects the
10242node ``Interactive Tutorial'' which tells a few things about 10228node ``Interactive Tutorial'' which tells a few things about
10243using the Info system before going on to the actual tutorial.) 10229using the Info system before going on to the actual tutorial.)
10244The @kbd{M-# t} key is equivalent to @kbd{h t} (but it works at 10230The @kbd{C-x * t} key is equivalent to @kbd{h t} (but it works at
10245all times). 10231all times).
10246 10232
10247@kindex h s 10233@kindex h s
10248@kindex M-# s 10234@kindex C-x * s
10249@pindex calc-info-summary 10235@pindex calc-info-summary
10250The @kbd{h s} (@code{calc-info-summary}) command runs the Info system 10236The @kbd{h s} (@code{calc-info-summary}) command runs the Info system
10251on the Summary node of the Calc manual. @xref{Summary}. The @kbd{M-# s} 10237on the Summary node of the Calc manual. @xref{Summary}. The @kbd{C-x * s}
10252key is equivalent to @kbd{h s}. 10238key is equivalent to @kbd{h s}.
10253 10239
10254@kindex h k 10240@kindex h k
@@ -10526,11 +10512,11 @@ you might then press @kbd{=} when it is time to evaluate this formula.
10526@section ``Quick Calculator'' Mode 10512@section ``Quick Calculator'' Mode
10527 10513
10528@noindent 10514@noindent
10529@kindex M-# q 10515@kindex C-x * q
10530@pindex quick-calc 10516@pindex quick-calc
10531@cindex Quick Calculator 10517@cindex Quick Calculator
10532There is another way to invoke the Calculator if all you need to do 10518There is another way to invoke the Calculator if all you need to do
10533is make one or two quick calculations. Type @kbd{M-# q} (or 10519is make one or two quick calculations. Type @kbd{C-x * q} (or
10534@kbd{M-x quick-calc}), then type any formula as an algebraic entry. 10520@kbd{M-x quick-calc}), then type any formula as an algebraic entry.
10535The Calculator will compute the result and display it in the echo 10521The Calculator will compute the result and display it in the echo
10536area, without ever actually putting up a Calc window. 10522area, without ever actually putting up a Calc window.
@@ -10539,11 +10525,11 @@ You can use the @kbd{$} character in a Quick Calculator formula to
10539refer to the previous Quick Calculator result. Older results are 10525refer to the previous Quick Calculator result. Older results are
10540not retained; the Quick Calculator has no effect on the full 10526not retained; the Quick Calculator has no effect on the full
10541Calculator's stack or trail. If you compute a result and then 10527Calculator's stack or trail. If you compute a result and then
10542forget what it was, just run @code{M-# q} again and enter 10528forget what it was, just run @code{C-x * q} again and enter
10543@samp{$} as the formula. 10529@samp{$} as the formula.
10544 10530
10545If this is the first time you have used the Calculator in this Emacs 10531If this is the first time you have used the Calculator in this Emacs
10546session, the @kbd{M-# q} command will create the @code{*Calculator*} 10532session, the @kbd{C-x * q} command will create the @code{*Calculator*}
10547buffer and perform all the usual initializations; it simply will 10533buffer and perform all the usual initializations; it simply will
10548refrain from putting that buffer up in a new window. The Quick 10534refrain from putting that buffer up in a new window. The Quick
10549Calculator refers to the @code{*Calculator*} buffer for all mode 10535Calculator refers to the @code{*Calculator*} buffer for all mode
@@ -10551,15 +10537,15 @@ settings. Thus, for example, to set the precision that the Quick
10551Calculator uses, simply run the full Calculator momentarily and use 10537Calculator uses, simply run the full Calculator momentarily and use
10552the regular @kbd{p} command. 10538the regular @kbd{p} command.
10553 10539
10554If you use @code{M-# q} from inside the Calculator buffer, the 10540If you use @code{C-x * q} from inside the Calculator buffer, the
10555effect is the same as pressing the apostrophe key (algebraic entry). 10541effect is the same as pressing the apostrophe key (algebraic entry).
10556 10542
10557The result of a Quick calculation is placed in the Emacs ``kill ring'' 10543The result of a Quick calculation is placed in the Emacs ``kill ring''
10558as well as being displayed. A subsequent @kbd{C-y} command will 10544as well as being displayed. A subsequent @kbd{C-y} command will
10559yank the result into the editing buffer. You can also use this 10545yank the result into the editing buffer. You can also use this
10560to yank the result into the next @kbd{M-# q} input line as a more 10546to yank the result into the next @kbd{C-x * q} input line as a more
10561explicit alternative to @kbd{$} notation, or to yank the result 10547explicit alternative to @kbd{$} notation, or to yank the result
10562into the Calculator stack after typing @kbd{M-# c}. 10548into the Calculator stack after typing @kbd{C-x * c}.
10563 10549
10564If you finish your formula by typing @key{LFD} (or @kbd{C-j}) instead 10550If you finish your formula by typing @key{LFD} (or @kbd{C-j}) instead
10565of @key{RET}, the result is inserted immediately into the current 10551of @key{RET}, the result is inserted immediately into the current
@@ -10655,7 +10641,7 @@ queried whether or not to restore the variable to its original value.
10655The @kbd{U} key may be pressed any number of times to undo successively 10641The @kbd{U} key may be pressed any number of times to undo successively
10656farther back in time; with a numeric prefix argument it undoes a 10642farther back in time; with a numeric prefix argument it undoes a
10657specified number of operations. The undo history is cleared only by the 10643specified number of operations. The undo history is cleared only by the
10658@kbd{q} (@code{calc-quit}) command. (Recall that @kbd{M-# c} is 10644@kbd{q} (@code{calc-quit}) command. (Recall that @kbd{C-x * c} is
10659synonymous with @code{calc-quit} while inside the Calculator; this 10645synonymous with @code{calc-quit} while inside the Calculator; this
10660also clears the undo history.) 10646also clears the undo history.)
10661 10647
@@ -10731,7 +10717,7 @@ that you must always press @kbd{w} yourself to see the messages).
10731@pindex another-calc 10717@pindex another-calc
10732It is possible to have any number of Calc mode buffers at once. 10718It is possible to have any number of Calc mode buffers at once.
10733Usually this is done by executing @kbd{M-x another-calc}, which 10719Usually this is done by executing @kbd{M-x another-calc}, which
10734is similar to @kbd{M-# c} except that if a @samp{*Calculator*} 10720is similar to @kbd{C-x * c} except that if a @samp{*Calculator*}
10735buffer already exists, a new, independent one with a name of the 10721buffer already exists, a new, independent one with a name of the
10736form @samp{*Calculator*<@var{n}>} is created. You can also use the 10722form @samp{*Calculator*<@var{n}>} is created. You can also use the
10737command @code{calc-mode} to put any buffer into Calculator mode, but 10723command @code{calc-mode} to put any buffer into Calculator mode, but
@@ -10778,9 +10764,9 @@ Occasionally Calc may lose track of when a certain component is
10778necessary; typically this means you will type a command and it won't 10764necessary; typically this means you will type a command and it won't
10779work because some function you've never heard of was undefined. 10765work because some function you've never heard of was undefined.
10780 10766
10781@kindex M-# L 10767@kindex C-x * L
10782@pindex calc-load-everything 10768@pindex calc-load-everything
10783If this happens, the easiest workaround is to type @kbd{M-# L} 10769If this happens, the easiest workaround is to type @kbd{C-x * L}
10784(@code{calc-load-everything}) to force all the parts of Calc to be 10770(@code{calc-load-everything}) to force all the parts of Calc to be
10785loaded right away. This will cause Emacs to take up a lot more 10771loaded right away. This will cause Emacs to take up a lot more
10786memory than it would otherwise, but it's guaranteed to fix the problem. 10772memory than it would otherwise, but it's guaranteed to fix the problem.
@@ -10839,7 +10825,7 @@ data points computed by the graphing commands.
10839If you suspect a Calculator cache has become corrupt, you can use the 10825If you suspect a Calculator cache has become corrupt, you can use the
10840@code{calc-flush-caches} command to reset all caches to the empty state. 10826@code{calc-flush-caches} command to reset all caches to the empty state.
10841(This should only be necessary in the event of bugs in the Calculator.) 10827(This should only be necessary in the event of bugs in the Calculator.)
10842The @kbd{M-# 0} (with the zero key) command also resets caches along 10828The @kbd{C-x * 0} (with the zero key) command also resets caches along
10843with all other aspects of the Calculator's state. 10829with all other aspects of the Calculator's state.
10844 10830
10845@node Debugging Calc, , Caches, Troubleshooting Commands 10831@node Debugging Calc, , Caches, Troubleshooting Commands
@@ -12049,8 +12035,8 @@ represent the same operation.
12049 12035
12050Commands that interpret (``parse'') text as algebraic formulas include 12036Commands that interpret (``parse'') text as algebraic formulas include
12051algebraic entry (@kbd{'}), editing commands like @kbd{`} which parse 12037algebraic entry (@kbd{'}), editing commands like @kbd{`} which parse
12052the contents of the editing buffer when you finish, the @kbd{M-# g} 12038the contents of the editing buffer when you finish, the @kbd{C-x * g}
12053and @w{@kbd{M-# r}} commands, the @kbd{C-y} command, the X window system 12039and @w{@kbd{C-x * r}} commands, the @kbd{C-y} command, the X window system
12054``paste'' mouse operation, and Embedded mode. All of these operations 12040``paste'' mouse operation, and Embedded mode. All of these operations
12055use the same rules for parsing formulas; in particular, language modes 12041use the same rules for parsing formulas; in particular, language modes
12056(@pxref{Language Modes}) affect them all in the same way. 12042(@pxref{Language Modes}) affect them all in the same way.
@@ -12446,8 +12432,8 @@ This will cause Emacs to reestablish these modes each time it starts up.
12446The modes saved in the file include everything controlled by the @kbd{m} 12432The modes saved in the file include everything controlled by the @kbd{m}
12447and @kbd{d} prefix keys, the current precision and binary word size, 12433and @kbd{d} prefix keys, the current precision and binary word size,
12448whether or not the trail is displayed, the current height of the Calc 12434whether or not the trail is displayed, the current height of the Calc
12449window, and more. The current interface (used when you type @kbd{M-# 12435window, and more. The current interface (used when you type @kbd{C-x * *})
12450M-#}) is also saved. If there were already saved mode settings in the 12436is also saved. If there were already saved mode settings in the
12451file, they are replaced. Otherwise, the new mode information is 12437file, they are replaced. Otherwise, the new mode information is
12452appended to the end of the file. 12438appended to the end of the file.
12453 12439
@@ -12473,7 +12459,7 @@ if this file exists, and this file becomes the one that Calc will
12473use in the future for commands like @kbd{m m}. The default settings 12459use in the future for commands like @kbd{m m}. The default settings
12474file name is @file{~/.calc.el}. You can see the current file name by 12460file name is @file{~/.calc.el}. You can see the current file name by
12475giving a blank response to the @kbd{m F} prompt. See also the 12461giving a blank response to the @kbd{m F} prompt. See also the
12476discussion of the @code{calc-settings-file} variable; @pxref{Customizable Variables}. 12462discussion of the @code{calc-settings-file} variable; @pxref{Customizing Calc}.
12477 12463
12478If the file name you give is your user init file (typically 12464If the file name you give is your user init file (typically
12479@file{~/.emacs}), @kbd{m F} will not automatically load the new file. This 12465@file{~/.emacs}), @kbd{m F} will not automatically load the new file. This
@@ -12494,7 +12480,7 @@ extensions modules. Otherwise, the extensions modules will not be loaded
12494until the various advanced Calc features are used. Since this mode only 12480until the various advanced Calc features are used. Since this mode only
12495has effect when Calc is first loaded, @kbd{m x} is usually followed by 12481has effect when Calc is first loaded, @kbd{m x} is usually followed by
12496@kbd{m m} to make the mode-setting permanent. To load all of Calc just 12482@kbd{m m} to make the mode-setting permanent. To load all of Calc just
12497once, rather than always in the future, you can press @kbd{M-# L}. 12483once, rather than always in the future, you can press @kbd{C-x * L}.
12498 12484
12499@kindex m S 12485@kindex m S
12500@pindex calc-shift-prefix 12486@pindex calc-shift-prefix
@@ -12864,7 +12850,7 @@ recomputation is off, you can think of @kbd{m C m C} as a command
12864to update all @samp{=>} operators while leaving recomputation off.) 12850to update all @samp{=>} operators while leaving recomputation off.)
12865 12851
12866To update @samp{=>} operators in an Embedded buffer while 12852To update @samp{=>} operators in an Embedded buffer while
12867automatic recomputation is off, use @w{@kbd{M-# u}}. 12853automatic recomputation is off, use @w{@kbd{C-x * u}}.
12868@xref{Embedded Mode}. 12854@xref{Embedded Mode}.
12869 12855
12870@node Working Message, , Automatic Recomputation, Calculation Modes 12856@node Working Message, , Automatic Recomputation, Calculation Modes
@@ -13511,7 +13497,7 @@ uses it as the digit separator. As a special case, @kbd{d , \} selects
13511@samp{\,} (@TeX{}'s thin-space symbol) as the digit separator. 13497@samp{\,} (@TeX{}'s thin-space symbol) as the digit separator.
13512 13498
13513Please note that grouped numbers will not generally be parsed correctly 13499Please note that grouped numbers will not generally be parsed correctly
13514if re-read in textual form, say by the use of @kbd{M-# y} and @kbd{M-# g}. 13500if re-read in textual form, say by the use of @kbd{C-x * y} and @kbd{C-x * g}.
13515(@xref{Kill and Yank}, for details on these commands.) One exception is 13501(@xref{Kill and Yank}, for details on these commands.) One exception is
13516the @samp{\,} separator, which doesn't interfere with parsing because it 13502the @samp{\,} separator, which doesn't interfere with parsing because it
13517is ignored by @TeX{} language mode. 13503is ignored by @TeX{} language mode.
@@ -13571,7 +13557,7 @@ significant figures but displays only six. (In fact, intermediate
13571calculations are often carried to one or two more significant figures, 13557calculations are often carried to one or two more significant figures,
13572but values placed on the stack will be rounded down to ten figures.) 13558but values placed on the stack will be rounded down to ten figures.)
13573Numbers are never actually rounded to the display precision for storage, 13559Numbers are never actually rounded to the display precision for storage,
13574except by commands like @kbd{C-k} and @kbd{M-# y} which operate on the 13560except by commands like @kbd{C-k} and @kbd{C-x * y} which operate on the
13575actual displayed text in the Calculator buffer. 13561actual displayed text in the Calculator buffer.
13576 13562
13577@kindex d . 13563@kindex d .
@@ -14133,9 +14119,9 @@ and use the standard notation by giving a numeric prefix, e.g., @kbd{C-u '}.
14133For example, suppose the formula @samp{2*a[1] + atan(a[2])} occurs in a C 14119For example, suppose the formula @samp{2*a[1] + atan(a[2])} occurs in a C
14134program; elsewhere in the program you need the derivatives of this formula 14120program; elsewhere in the program you need the derivatives of this formula
14135with respect to @samp{a[1]} and @samp{a[2]}. First, type @kbd{d C} 14121with respect to @samp{a[1]} and @samp{a[2]}. First, type @kbd{d C}
14136to switch to C notation. Now use @code{C-u M-# g} to grab the formula 14122to switch to C notation. Now use @code{C-u C-x * g} to grab the formula
14137into the Calculator, @kbd{a d a[1] @key{RET}} to differentiate with respect 14123into the Calculator, @kbd{a d a[1] @key{RET}} to differentiate with respect
14138to the first variable, and @kbd{M-# y} to yank the formula for the derivative 14124to the first variable, and @kbd{C-x * y} to yank the formula for the derivative
14139back into your C program. Press @kbd{U} to undo the differentiation and 14125back into your C program. Press @kbd{U} to undo the differentiation and
14140repeat with @kbd{a d a[2] @key{RET}} for the other derivative. 14126repeat with @kbd{a d a[2] @key{RET}} for the other derivative.
14141 14127
@@ -21278,8 +21264,8 @@ but they are not currently supported with @kbd{V U} or @kbd{I V U}.
21278The obsolete reduce-by-columns function, @code{reducec}, is still 21264The obsolete reduce-by-columns function, @code{reducec}, is still
21279supported but there is no way to get it through the @kbd{V R} command. 21265supported but there is no way to get it through the @kbd{V R} command.
21280 21266
21281The commands @kbd{M-# :} and @kbd{M-# _} are equivalent to typing 21267The commands @kbd{C-x * :} and @kbd{C-x * _} are equivalent to typing
21282@kbd{M-# r} to grab a rectangle of data into Calc, and then typing 21268@kbd{C-x * r} to grab a rectangle of data into Calc, and then typing
21283@kbd{V R : +} or @kbd{V R _ +}, respectively, to sum the columns or 21269@kbd{V R : +} or @kbd{V R _ +}, respectively, to sum the columns or
21284rows of the matrix. @xref{Grabbing From Buffers}. 21270rows of the matrix. @xref{Grabbing From Buffers}.
21285 21271
@@ -27934,7 +27920,7 @@ argument to @kbd{u v}.
27934The @kbd{u V} (@code{calc-view-units-table}) command is like @kbd{u v} except 27920The @kbd{u V} (@code{calc-view-units-table}) command is like @kbd{u v} except
27935that the cursor is not moved into the Units Table buffer. You can 27921that the cursor is not moved into the Units Table buffer. You can
27936type @kbd{u V} again to remove the Units Table from the display. To 27922type @kbd{u V} again to remove the Units Table from the display. To
27937return from the Units Table buffer after a @kbd{u v}, type @kbd{M-# c} 27923return from the Units Table buffer after a @kbd{u v}, type @kbd{C-x * c}
27938again or use the regular Emacs @w{@kbd{C-x o}} (@code{other-window}) 27924again or use the regular Emacs @w{@kbd{C-x o}} (@code{other-window})
27939command. You can also kill the buffer with @kbd{C-x k} if you wish; 27925command. You can also kill the buffer with @kbd{C-x k} if you wish;
27940the actual units table is safely stored inside the Calculator. 27926the actual units table is safely stored inside the Calculator.
@@ -29320,7 +29306,7 @@ display or print the output of GNUPLOT, respectively. These may be
29320@samp{%s} to signify the name of the file to be displayed or printed. 29306@samp{%s} to signify the name of the file to be displayed or printed.
29321Or, these variables may contain Lisp expressions which are evaluated 29307Or, these variables may contain Lisp expressions which are evaluated
29322to display or print the output. These variables are customizable 29308to display or print the output. These variables are customizable
29323(@pxref{Customizable Variables}). 29309(@pxref{Customizing Calc}).
29324 29310
29325@kindex g x 29311@kindex g x
29326@pindex calc-graph-display 29312@pindex calc-graph-display
@@ -29479,20 +29465,20 @@ difference.)
29479@section Grabbing from Other Buffers 29465@section Grabbing from Other Buffers
29480 29466
29481@noindent 29467@noindent
29482@kindex M-# g 29468@kindex C-x * g
29483@pindex calc-grab-region 29469@pindex calc-grab-region
29484The @kbd{M-# g} (@code{calc-grab-region}) command takes the text between 29470The @kbd{C-x * g} (@code{calc-grab-region}) command takes the text between
29485point and mark in the current buffer and attempts to parse it as a 29471point and mark in the current buffer and attempts to parse it as a
29486vector of values. Basically, it wraps the text in vector brackets 29472vector of values. Basically, it wraps the text in vector brackets
29487@samp{[ ]} unless the text already is enclosed in vector brackets, 29473@samp{[ ]} unless the text already is enclosed in vector brackets,
29488then reads the text as if it were an algebraic entry. The contents 29474then reads the text as if it were an algebraic entry. The contents
29489of the vector may be numbers, formulas, or any other Calc objects. 29475of the vector may be numbers, formulas, or any other Calc objects.
29490If the @kbd{M-# g} command works successfully, it does an automatic 29476If the @kbd{C-x * g} command works successfully, it does an automatic
29491@kbd{M-# c} to enter the Calculator buffer. 29477@kbd{C-x * c} to enter the Calculator buffer.
29492 29478
29493A numeric prefix argument grabs the specified number of lines around 29479A numeric prefix argument grabs the specified number of lines around
29494point, ignoring the mark. A positive prefix grabs from point to the 29480point, ignoring the mark. A positive prefix grabs from point to the
29495@expr{n}th following newline (so that @kbd{M-1 M-# g} grabs from point 29481@expr{n}th following newline (so that @kbd{M-1 C-x * g} grabs from point
29496to the end of the current line); a negative prefix grabs from point 29482to the end of the current line); a negative prefix grabs from point
29497back to the @expr{n+1}st preceding newline. In these cases the text 29483back to the @expr{n+1}st preceding newline. In these cases the text
29498that is grabbed is exactly the same as the text that @kbd{C-k} would 29484that is grabbed is exactly the same as the text that @kbd{C-k} would
@@ -29503,19 +29489,19 @@ line.
29503 29489
29504A plain @kbd{C-u} prefix interprets the region between point and mark 29490A plain @kbd{C-u} prefix interprets the region between point and mark
29505as a single number or formula rather than a vector. For example, 29491as a single number or formula rather than a vector. For example,
29506@kbd{M-# g} on the text @samp{2 a b} produces the vector of three 29492@kbd{C-x * g} on the text @samp{2 a b} produces the vector of three
29507values @samp{[2, a, b]}, but @kbd{C-u M-# g} on the same region 29493values @samp{[2, a, b]}, but @kbd{C-u C-x * g} on the same region
29508reads a formula which is a product of three things: @samp{2 a b}. 29494reads a formula which is a product of three things: @samp{2 a b}.
29509(The text @samp{a + b}, on the other hand, will be grabbed as a 29495(The text @samp{a + b}, on the other hand, will be grabbed as a
29510vector of one element by plain @kbd{M-# g} because the interpretation 29496vector of one element by plain @kbd{C-x * g} because the interpretation
29511@samp{[a, +, b]} would be a syntax error.) 29497@samp{[a, +, b]} would be a syntax error.)
29512 29498
29513If a different language has been specified (@pxref{Language Modes}), 29499If a different language has been specified (@pxref{Language Modes}),
29514the grabbed text will be interpreted according to that language. 29500the grabbed text will be interpreted according to that language.
29515 29501
29516@kindex M-# r 29502@kindex C-x * r
29517@pindex calc-grab-rectangle 29503@pindex calc-grab-rectangle
29518The @kbd{M-# r} (@code{calc-grab-rectangle}) command takes the text between 29504The @kbd{C-x * r} (@code{calc-grab-rectangle}) command takes the text between
29519point and mark and attempts to parse it as a matrix. If point and mark 29505point and mark and attempts to parse it as a matrix. If point and mark
29520are both in the leftmost column, the lines in between are parsed in their 29506are both in the leftmost column, the lines in between are parsed in their
29521entirety. Otherwise, point and mark define the corners of a rectangle 29507entirety. Otherwise, point and mark define the corners of a rectangle
@@ -29535,15 +29521,15 @@ were surrounded by square brackets. Leading line numbers (in the
29535format used in the Calc stack buffer) are ignored. If you wish to 29521format used in the Calc stack buffer) are ignored. If you wish to
29536force this interpretation (even if the line contains bracketed 29522force this interpretation (even if the line contains bracketed
29537portions), give a negative numeric prefix argument to the 29523portions), give a negative numeric prefix argument to the
29538@kbd{M-# r} command. 29524@kbd{C-x * r} command.
29539 29525
29540If you give a numeric prefix argument of zero or plain @kbd{C-u}, each 29526If you give a numeric prefix argument of zero or plain @kbd{C-u}, each
29541line is instead interpreted as a single formula which is converted into 29527line is instead interpreted as a single formula which is converted into
29542a one-element vector. Thus the result of @kbd{C-u M-# r} will be a 29528a one-element vector. Thus the result of @kbd{C-u C-x * r} will be a
29543one-column matrix. For example, suppose one line of the data is the 29529one-column matrix. For example, suppose one line of the data is the
29544expression @samp{2 a}. A plain @w{@kbd{M-# r}} will interpret this as 29530expression @samp{2 a}. A plain @w{@kbd{C-x * r}} will interpret this as
29545@samp{[2 a]}, which in turn is read as a two-element vector that forms 29531@samp{[2 a]}, which in turn is read as a two-element vector that forms
29546one row of the matrix. But a @kbd{C-u M-# r} will interpret this row 29532one row of the matrix. But a @kbd{C-u C-x * r} will interpret this row
29547as @samp{[2*a]}. 29533as @samp{[2*a]}.
29548 29534
29549If you give a positive numeric prefix argument @var{n}, then each line 29535If you give a positive numeric prefix argument @var{n}, then each line
@@ -29558,35 +29544,35 @@ constituent rows and columns. (If it is a
29558@infoline 1x1 29544@infoline 1x1
29559matrix, just hit @kbd{v u} (@code{calc-unpack}) twice.) 29545matrix, just hit @kbd{v u} (@code{calc-unpack}) twice.)
29560 29546
29561@kindex M-# : 29547@kindex C-x * :
29562@kindex M-# _ 29548@kindex C-x * _
29563@pindex calc-grab-sum-across 29549@pindex calc-grab-sum-across
29564@pindex calc-grab-sum-down 29550@pindex calc-grab-sum-down
29565@cindex Summing rows and columns of data 29551@cindex Summing rows and columns of data
29566The @kbd{M-# :} (@code{calc-grab-sum-down}) command is a handy way to 29552The @kbd{C-x * :} (@code{calc-grab-sum-down}) command is a handy way to
29567grab a rectangle of data and sum its columns. It is equivalent to 29553grab a rectangle of data and sum its columns. It is equivalent to
29568typing @kbd{M-# r}, followed by @kbd{V R : +} (the vector reduction 29554typing @kbd{C-x * r}, followed by @kbd{V R : +} (the vector reduction
29569command that sums the columns of a matrix; @pxref{Reducing}). The 29555command that sums the columns of a matrix; @pxref{Reducing}). The
29570result of the command will be a vector of numbers, one for each column 29556result of the command will be a vector of numbers, one for each column
29571in the input data. The @kbd{M-# _} (@code{calc-grab-sum-across}) command 29557in the input data. The @kbd{C-x * _} (@code{calc-grab-sum-across}) command
29572similarly grabs a rectangle and sums its rows by executing @w{@kbd{V R _ +}}. 29558similarly grabs a rectangle and sums its rows by executing @w{@kbd{V R _ +}}.
29573 29559
29574As well as being more convenient, @kbd{M-# :} and @kbd{M-# _} are also 29560As well as being more convenient, @kbd{C-x * :} and @kbd{C-x * _} are also
29575much faster because they don't actually place the grabbed vector on 29561much faster because they don't actually place the grabbed vector on
29576the stack. In a @kbd{M-# r V R : +} sequence, formatting the vector 29562the stack. In a @kbd{C-x * r V R : +} sequence, formatting the vector
29577for display on the stack takes a large fraction of the total time 29563for display on the stack takes a large fraction of the total time
29578(unless you have planned ahead and used @kbd{v .} and @kbd{t .} modes). 29564(unless you have planned ahead and used @kbd{v .} and @kbd{t .} modes).
29579 29565
29580For example, suppose we have a column of numbers in a file which we 29566For example, suppose we have a column of numbers in a file which we
29581wish to sum. Go to one corner of the column and press @kbd{C-@@} to 29567wish to sum. Go to one corner of the column and press @kbd{C-@@} to
29582set the mark; go to the other corner and type @kbd{M-# :}. Since there 29568set the mark; go to the other corner and type @kbd{C-x * :}. Since there
29583is only one column, the result will be a vector of one number, the sum. 29569is only one column, the result will be a vector of one number, the sum.
29584(You can type @kbd{v u} to unpack this vector into a plain number if 29570(You can type @kbd{v u} to unpack this vector into a plain number if
29585you want to do further arithmetic with it.) 29571you want to do further arithmetic with it.)
29586 29572
29587To compute the product of the column of numbers, we would have to do 29573To compute the product of the column of numbers, we would have to do
29588it ``by hand'' since there's no special grab-and-multiply command. 29574it ``by hand'' since there's no special grab-and-multiply command.
29589Use @kbd{M-# r} to grab the column of numbers into the calculator in 29575Use @kbd{C-x * r} to grab the column of numbers into the calculator in
29590the form of a column matrix. The statistics command @kbd{u *} is a 29576the form of a column matrix. The statistics command @kbd{u *} is a
29591handy way to find the product of a vector or matrix of numbers. 29577handy way to find the product of a vector or matrix of numbers.
29592@xref{Statistical Operations}. Another approach would be to use 29578@xref{Statistical Operations}. Another approach would be to use
@@ -29618,13 +29604,13 @@ latter strips off the trailing newline.
29618With a lone @kbd{C-u} as a prefix argument, @kbd{y} @emph{replaces} the 29604With a lone @kbd{C-u} as a prefix argument, @kbd{y} @emph{replaces} the
29619region in the other buffer with the yanked text, then quits the 29605region in the other buffer with the yanked text, then quits the
29620Calculator, leaving you in that buffer. A typical use would be to use 29606Calculator, leaving you in that buffer. A typical use would be to use
29621@kbd{M-# g} to read a region of data into the Calculator, operate on the 29607@kbd{C-x * g} to read a region of data into the Calculator, operate on the
29622data to produce a new matrix, then type @kbd{C-u y} to replace the 29608data to produce a new matrix, then type @kbd{C-u y} to replace the
29623original data with the new data. One might wish to alter the matrix 29609original data with the new data. One might wish to alter the matrix
29624display style (@pxref{Vector and Matrix Formats}) or change the current 29610display style (@pxref{Vector and Matrix Formats}) or change the current
29625display language (@pxref{Language Modes}) before doing this. Also, note 29611display language (@pxref{Language Modes}) before doing this. Also, note
29626that this command replaces a linear region of text (as grabbed by 29612that this command replaces a linear region of text (as grabbed by
29627@kbd{M-# g}), not a rectangle (as grabbed by @kbd{M-# r}). 29613@kbd{C-x * g}), not a rectangle (as grabbed by @kbd{C-x * r}).
29628 29614
29629If the editing buffer is in overwrite (as opposed to insert) mode, 29615If the editing buffer is in overwrite (as opposed to insert) mode,
29630and the @kbd{C-u} prefix was not used, then the yanked number will 29616and the @kbd{C-u} prefix was not used, then the yanked number will
@@ -29641,8 +29627,8 @@ number, lengthening or shortening as necessary. The concept of
29641``overwrite mode'' has thus been generalized from overwriting characters 29627``overwrite mode'' has thus been generalized from overwriting characters
29642to overwriting one complete number with another. 29628to overwriting one complete number with another.
29643 29629
29644@kindex M-# y 29630@kindex C-x * y
29645The @kbd{M-# y} key sequence is equivalent to @kbd{y} except that 29631The @kbd{C-x * y} key sequence is equivalent to @kbd{y} except that
29646it can be typed anywhere, not just in Calc. This provides an easy 29632it can be typed anywhere, not just in Calc. This provides an easy
29647way to guarantee that Calc knows which editing buffer you want to use! 29633way to guarantee that Calc knows which editing buffer you want to use!
29648 29634
@@ -29679,9 +29665,9 @@ in the Calc window.
29679@chapter Keypad Mode 29665@chapter Keypad Mode
29680 29666
29681@noindent 29667@noindent
29682@kindex M-# k 29668@kindex C-x * k
29683@pindex calc-keypad 29669@pindex calc-keypad
29684The @kbd{M-# k} (@code{calc-keypad}) command starts the Calculator 29670The @kbd{C-x * k} (@code{calc-keypad}) command starts the Calculator
29685and displays a picture of a calculator-style keypad. If you are using 29671and displays a picture of a calculator-style keypad. If you are using
29686the X window system, you can click on any of the ``keys'' in the 29672the X window system, you can click on any of the ``keys'' in the
29687keypad using the left mouse button to operate the calculator. 29673keypad using the left mouse button to operate the calculator.
@@ -29690,7 +29676,7 @@ you can type in your file while simultaneously performing
29690calculations with the mouse. 29676calculations with the mouse.
29691 29677
29692@pindex full-calc-keypad 29678@pindex full-calc-keypad
29693If you have used @kbd{M-# b} first, @kbd{M-# k} instead invokes 29679If you have used @kbd{C-x * b} first, @kbd{C-x * k} instead invokes
29694the @code{full-calc-keypad} command, which takes over the whole 29680the @code{full-calc-keypad} command, which takes over the whole
29695Emacs screen and displays the keypad, the Calc stack, and the Calc 29681Emacs screen and displays the keypad, the Calc stack, and the Calc
29696trail all at once. This mode would normally be used when running 29682trail all at once. This mode would normally be used when running
@@ -29851,9 +29837,9 @@ of 0 @samp{[]}, 1 @samp{[)}, 2 @samp{(]} or 3 @samp{()}, followed
29851by the two limits of the interval. 29837by the two limits of the interval.
29852@end table 29838@end table
29853 29839
29854The @kbd{OFF} key turns Calc off; typing @kbd{M-# k} or @kbd{M-# M-#} 29840The @kbd{OFF} key turns Calc off; typing @kbd{C-x * k} or @kbd{C-x * *}
29855again has the same effect. This is analogous to typing @kbd{q} or 29841again has the same effect. This is analogous to typing @kbd{q} or
29856hitting @kbd{M-# c} again in the normal calculator. If Calc is 29842hitting @kbd{C-x * c} again in the normal calculator. If Calc is
29857running standalone (the @code{full-calc-keypad} command appeared in the 29843running standalone (the @code{full-calc-keypad} command appeared in the
29858command line that started Emacs), then @kbd{OFF} is replaced with 29844command line that started Emacs), then @kbd{OFF} is replaced with
29859@kbd{EXIT}; clicking on this actually exits Emacs itself. 29845@kbd{EXIT}; clicking on this actually exits Emacs itself.
@@ -30093,11 +30079,11 @@ linked to the stack and this copying is taken care of automatically.
30093@section Basic Embedded Mode 30079@section Basic Embedded Mode
30094 30080
30095@noindent 30081@noindent
30096@kindex M-# e 30082@kindex C-x * e
30097@pindex calc-embedded 30083@pindex calc-embedded
30098To enter Embedded mode, position the Emacs point (cursor) on a 30084To enter Embedded mode, position the Emacs point (cursor) on a
30099formula in any buffer and press @kbd{M-# e} (@code{calc-embedded}). 30085formula in any buffer and press @kbd{C-x * e} (@code{calc-embedded}).
30100Note that @kbd{M-# e} is not to be used in the Calc stack buffer 30086Note that @kbd{C-x * e} is not to be used in the Calc stack buffer
30101like most Calc commands, but rather in regular editing buffers that 30087like most Calc commands, but rather in regular editing buffers that
30102are visiting your own files. 30088are visiting your own files.
30103 30089
@@ -30108,7 +30094,7 @@ Similarly, Calc will use @TeX{} language for @code{tex-mode},
30108@code{plain-tex-mode} and @code{context-mode}, C language for 30094@code{plain-tex-mode} and @code{context-mode}, C language for
30109@code{c-mode} and @code{c++-mode}, FORTRAN language for 30095@code{c-mode} and @code{c++-mode}, FORTRAN language for
30110@code{fortran-mode} and @code{f90-mode}, Pascal for @code{pascal-mode}, 30096@code{fortran-mode} and @code{f90-mode}, Pascal for @code{pascal-mode},
30111and eqn for @code{nroff-mode} (@pxref{Customizable Variables}). 30097and eqn for @code{nroff-mode} (@pxref{Customizing Calc}).
30112These can be overridden with Calc's mode 30098These can be overridden with Calc's mode
30113changing commands (@pxref{Mode Settings in Embedded Mode}). If no 30099changing commands (@pxref{Mode Settings in Embedded Mode}). If no
30114suitable language is available, Calc will continue with its current language. 30100suitable language is available, Calc will continue with its current language.
@@ -30145,9 +30131,9 @@ With a prefix argument of zero, Calc uses the current region (delimited
30145by point and mark) instead of formula delimiters. With a prefix 30131by point and mark) instead of formula delimiters. With a prefix
30146argument of @kbd{C-u} only, Calc uses the current line as the formula. 30132argument of @kbd{C-u} only, Calc uses the current line as the formula.
30147 30133
30148@kindex M-# w 30134@kindex C-x * w
30149@pindex calc-embedded-word 30135@pindex calc-embedded-word
30150The @kbd{M-# w} (@code{calc-embedded-word}) command will start Embedded 30136The @kbd{C-x * w} (@code{calc-embedded-word}) command will start Embedded
30151mode on the current ``word''; in this case Calc will scan for the first 30137mode on the current ``word''; in this case Calc will scan for the first
30152non-numeric character (i.e., the first character that is not a digit, 30138non-numeric character (i.e., the first character that is not a digit,
30153sign, decimal point, or upper- or lower-case @samp{e}) forward and 30139sign, decimal point, or upper- or lower-case @samp{e}) forward and
@@ -30165,7 +30151,7 @@ in Normal language mode, but the @code{atan} won't correspond to
30165the built-in @code{arctan} function, and the @samp{a[1]} will be 30151the built-in @code{arctan} function, and the @samp{a[1]} will be
30166interpreted as @samp{a} times the vector @samp{[1]}! 30152interpreted as @samp{a} times the vector @samp{[1]}!
30167 30153
30168If you press @kbd{M-# e} or @kbd{M-# w} to activate an embedded 30154If you press @kbd{C-x * e} or @kbd{C-x * w} to activate an embedded
30169formula which is blank, say with the cursor on the space between 30155formula which is blank, say with the cursor on the space between
30170the two delimiters @samp{$ $}, Calc will immediately prompt for 30156the two delimiters @samp{$ $}, Calc will immediately prompt for
30171an algebraic entry. 30157an algebraic entry.
@@ -30179,10 +30165,10 @@ not affected by Embedded mode.
30179When Embedded mode begins, Calc pushes the current formula onto 30165When Embedded mode begins, Calc pushes the current formula onto
30180the stack. No Calc stack window is created; however, Calc copies 30166the stack. No Calc stack window is created; however, Calc copies
30181the top-of-stack position into the original buffer at all times. 30167the top-of-stack position into the original buffer at all times.
30182You can create a Calc window by hand with @kbd{M-# o} if you 30168You can create a Calc window by hand with @kbd{C-x * o} if you
30183find you need to see the entire stack. 30169find you need to see the entire stack.
30184 30170
30185For example, typing @kbd{M-# e} while somewhere in the formula 30171For example, typing @kbd{C-x * e} while somewhere in the formula
30186@samp{n>2} in the following line enables Embedded mode on that 30172@samp{n>2} in the following line enables Embedded mode on that
30187inequality: 30173inequality:
30188 30174
@@ -30216,7 +30202,7 @@ needs to be commuted.
30216We define $F_n = F_(n-1)+F_(n-2)$ for all $2 < n$. 30202We define $F_n = F_(n-1)+F_(n-2)$ for all $2 < n$.
30217@end example 30203@end example
30218 30204
30219The @kbd{M-# o} command is a useful way to open a Calc window 30205The @kbd{C-x * o} command is a useful way to open a Calc window
30220without actually selecting that window. Giving this command 30206without actually selecting that window. Giving this command
30221verifies that @samp{2 < n} is also on the Calc stack. Typing 30207verifies that @samp{2 < n} is also on the Calc stack. Typing
30222@kbd{17 @key{RET}} would produce: 30208@kbd{17 @key{RET}} would produce:
@@ -30232,9 +30218,9 @@ at this point will exchange the two stack values and restore
30232normally see the stack in Embedded mode, it is still there and 30218normally see the stack in Embedded mode, it is still there and
30233it still operates in the same way. But, as with old-fashioned 30219it still operates in the same way. But, as with old-fashioned
30234RPN calculators, you can only see the value at the top of the 30220RPN calculators, you can only see the value at the top of the
30235stack at any given time (unless you use @kbd{M-# o}). 30221stack at any given time (unless you use @kbd{C-x * o}).
30236 30222
30237Typing @kbd{M-# e} again turns Embedded mode off. The Calc 30223Typing @kbd{C-x * e} again turns Embedded mode off. The Calc
30238window reveals that the formula @w{@samp{2 < n}} is automatically 30224window reveals that the formula @w{@samp{2 < n}} is automatically
30239removed from the stack, but the @samp{17} is not. Entering 30225removed from the stack, but the @samp{17} is not. Entering
30240Embedded mode always pushes one thing onto the stack, and 30226Embedded mode always pushes one thing onto the stack, and
@@ -30242,11 +30228,11 @@ leaving Embedded mode always removes one thing. Anything else
30242that happens on the stack is entirely your business as far as 30228that happens on the stack is entirely your business as far as
30243Embedded mode is concerned. 30229Embedded mode is concerned.
30244 30230
30245If you press @kbd{M-# e} in the wrong place by accident, it is 30231If you press @kbd{C-x * e} in the wrong place by accident, it is
30246possible that Calc will be able to parse the nearby text as a 30232possible that Calc will be able to parse the nearby text as a
30247formula and will mangle that text in an attempt to redisplay it 30233formula and will mangle that text in an attempt to redisplay it
30248``properly'' in the current language mode. If this happens, 30234``properly'' in the current language mode. If this happens,
30249press @kbd{M-# e} again to exit Embedded mode, then give the 30235press @kbd{C-x * e} again to exit Embedded mode, then give the
30250regular Emacs ``undo'' command (@kbd{C-_} or @kbd{C-x u}) to put 30236regular Emacs ``undo'' command (@kbd{C-_} or @kbd{C-x u}) to put
30251the text back the way it was before Calc edited it. Note that Calc's 30237the text back the way it was before Calc edited it. Note that Calc's
30252own Undo command (typed before you turn Embedded mode back off) 30238own Undo command (typed before you turn Embedded mode back off)
@@ -30357,10 +30343,10 @@ and at x = 3 is
30357 @r{(the value)} 30343 @r{(the value)}
30358@end smallexample 30344@end smallexample
30359 30345
30360@kindex M-# d 30346@kindex C-x * d
30361@pindex calc-embedded-duplicate 30347@pindex calc-embedded-duplicate
30362The @kbd{M-# d} (@code{calc-embedded-duplicate}) command is a 30348The @kbd{C-x * d} (@code{calc-embedded-duplicate}) command is a
30363handy way to make sequences like this. If you type @kbd{M-# d}, 30349handy way to make sequences like this. If you type @kbd{C-x * d},
30364the formula under the cursor (which may or may not have Embedded 30350the formula under the cursor (which may or may not have Embedded
30365mode enabled for it at the time) is copied immediately below and 30351mode enabled for it at the time) is copied immediately below and
30366Embedded mode is then enabled for that copy. 30352Embedded mode is then enabled for that copy.
@@ -30374,7 +30360,7 @@ The derivative of
30374@end smallexample 30360@end smallexample
30375 30361
30376@noindent 30362@noindent
30377and press @kbd{M-# d} with the cursor on this formula. The result 30363and press @kbd{C-x * d} with the cursor on this formula. The result
30378is 30364is
30379 30365
30380@smallexample 30366@smallexample
@@ -30389,12 +30375,12 @@ The derivative of
30389@noindent 30375@noindent
30390with the second copy of the formula enabled in Embedded mode. 30376with the second copy of the formula enabled in Embedded mode.
30391You can now press @kbd{a d x @key{RET}} to take the derivative, and 30377You can now press @kbd{a d x @key{RET}} to take the derivative, and
30392@kbd{M-# d M-# d} to make two more copies of the derivative. 30378@kbd{C-x * d C-x * d} to make two more copies of the derivative.
30393To complete the computations, type @kbd{3 s l x @key{RET}} to evaluate 30379To complete the computations, type @kbd{3 s l x @key{RET}} to evaluate
30394the last formula, then move up to the second-to-last formula 30380the last formula, then move up to the second-to-last formula
30395and type @kbd{2 s l x @key{RET}}. 30381and type @kbd{2 s l x @key{RET}}.
30396 30382
30397Finally, you would want to press @kbd{M-# e} to exit Embedded 30383Finally, you would want to press @kbd{C-x * e} to exit Embedded
30398mode, then go up and insert the necessary text in between the 30384mode, then go up and insert the necessary text in between the
30399various formulas and numbers. 30385various formulas and numbers.
30400 30386
@@ -30402,40 +30388,37 @@ various formulas and numbers.
30402\bigskip 30388\bigskip
30403@end tex 30389@end tex
30404 30390
30405@kindex M-# f 30391@kindex C-x * f
30406@kindex M-# ' 30392@kindex C-x * '
30407@pindex calc-embedded-new-formula 30393@pindex calc-embedded-new-formula
30408The @kbd{M-# f} (@code{calc-embedded-new-formula}) command 30394The @kbd{C-x * f} (@code{calc-embedded-new-formula}) command
30409creates a new embedded formula at the current point. It inserts 30395creates a new embedded formula at the current point. It inserts
30410some default delimiters, which are usually just blank lines, 30396some default delimiters, which are usually just blank lines,
30411and then does an algebraic entry to get the formula (which is 30397and then does an algebraic entry to get the formula (which is
30412then enabled for Embedded mode). This is just shorthand for 30398then enabled for Embedded mode). This is just shorthand for
30413typing the delimiters yourself, positioning the cursor between 30399typing the delimiters yourself, positioning the cursor between
30414the new delimiters, and pressing @kbd{M-# e}. The key sequence 30400the new delimiters, and pressing @kbd{C-x * e}. The key sequence
30415@kbd{M-# '} is equivalent to @kbd{M-# f}. 30401@kbd{C-x * '} is equivalent to @kbd{C-x * f}.
30416 30402
30417@kindex M-# n 30403@kindex C-x * n
30418@kindex M-# p 30404@kindex C-x * p
30419@pindex calc-embedded-next 30405@pindex calc-embedded-next
30420@pindex calc-embedded-previous 30406@pindex calc-embedded-previous
30421The @kbd{M-# n} (@code{calc-embedded-next}) and @kbd{M-# p} 30407The @kbd{C-x * n} (@code{calc-embedded-next}) and @kbd{C-x * p}
30422(@code{calc-embedded-previous}) commands move the cursor to the 30408(@code{calc-embedded-previous}) commands move the cursor to the
30423next or previous active embedded formula in the buffer. They 30409next or previous active embedded formula in the buffer. They
30424can take positive or negative prefix arguments to move by several 30410can take positive or negative prefix arguments to move by several
30425formulas. Note that these commands do not actually examine the 30411formulas. Note that these commands do not actually examine the
30426text of the buffer looking for formulas; they only see formulas 30412text of the buffer looking for formulas; they only see formulas
30427which have previously been activated in Embedded mode. In fact, 30413which have previously been activated in Embedded mode. In fact,
30428@kbd{M-# n} and @kbd{M-# p} are a useful way to tell which 30414@kbd{C-x * n} and @kbd{C-x * p} are a useful way to tell which
30429embedded formulas are currently active. Also, note that these 30415embedded formulas are currently active. Also, note that these
30430commands do not enable Embedded mode on the next or previous 30416commands do not enable Embedded mode on the next or previous
30431formula, they just move the cursor. (By the way, @kbd{M-# n} is 30417formula, they just move the cursor.
30432not as awkward to type as it may seem, because @kbd{M-#} ignores
30433Shift and Meta on the second keystroke: @kbd{M-# M-N} can be typed
30434by holding down Shift and Meta and alternately typing two keys.)
30435 30418
30436@kindex M-# ` 30419@kindex C-x * `
30437@pindex calc-embedded-edit 30420@pindex calc-embedded-edit
30438The @kbd{M-# `} (@code{calc-embedded-edit}) command edits the 30421The @kbd{C-x * `} (@code{calc-embedded-edit}) command edits the
30439embedded formula at the current point as if by @kbd{`} (@code{calc-edit}). 30422embedded formula at the current point as if by @kbd{`} (@code{calc-edit}).
30440Embedded mode does not have to be enabled for this to work. Press 30423Embedded mode does not have to be enabled for this to work. Press
30441@kbd{C-c C-c} to finish the edit, or @kbd{C-x k} to cancel. 30424@kbd{C-c C-c} to finish the edit, or @kbd{C-x k} to cancel.
@@ -30500,10 +30483,10 @@ will do the trick) to select the righthand side of the assignment.
30500Then, @kbd{17 @key{TAB} @key{DEL}} will swap the 17 into place (@pxref{Selecting 30483Then, @kbd{17 @key{TAB} @key{DEL}} will swap the 17 into place (@pxref{Selecting
30501Subformulas}, to see how this works). 30484Subformulas}, to see how this works).
30502 30485
30503@kindex M-# j 30486@kindex C-x * j
30504@pindex calc-embedded-select 30487@pindex calc-embedded-select
30505The @kbd{M-# j} (@code{calc-embedded-select}) command provides an 30488The @kbd{C-x * j} (@code{calc-embedded-select}) command provides an
30506easy way to operate on assignments. It is just like @kbd{M-# e}, 30489easy way to operate on assignments. It is just like @kbd{C-x * e},
30507except that if the enabled formula is an assignment, it uses 30490except that if the enabled formula is an assignment, it uses
30508@kbd{j 2} to select the righthand side. If the enabled formula 30491@kbd{j 2} to select the righthand side. If the enabled formula
30509is an evaluates-to, it uses @kbd{j 1} to select the lefthand side. 30492is an evaluates-to, it uses @kbd{j 1} to select the lefthand side.
@@ -30514,20 +30497,18 @@ bar := foo + 3 => 20
30514@end example 30497@end example
30515 30498
30516@noindent 30499@noindent
30517in which case @kbd{M-# j} will select the middle part (@samp{foo + 3}). 30500in which case @kbd{C-x * j} will select the middle part (@samp{foo + 3}).
30518 30501
30519The formula is automatically deselected when you leave Embedded 30502The formula is automatically deselected when you leave Embedded
30520mode. 30503mode.
30521 30504
30522@kindex M-# u 30505@kindex C-x * u
30523@kindex M-# =
30524@pindex calc-embedded-update-formula 30506@pindex calc-embedded-update-formula
30525Another way to change the assignment to @code{foo} would simply be 30507Another way to change the assignment to @code{foo} would simply be
30526to edit the number using regular Emacs editing rather than Embedded 30508to edit the number using regular Emacs editing rather than Embedded
30527mode. Then, we have to find a way to get Embedded mode to notice 30509mode. Then, we have to find a way to get Embedded mode to notice
30528the change. The @kbd{M-# u} or @kbd{M-# =} 30510the change. The @kbd{C-x * u} (@code{calc-embedded-update-formula})
30529(@code{calc-embedded-update-formula}) command is a convenient way 30511command is a convenient way to do this.
30530to do this.
30531 30512
30532@example 30513@example
30533foo := 6 30514foo := 6
@@ -30535,29 +30516,29 @@ foo := 6
30535foo + 7 => 13 30516foo + 7 => 13
30536@end example 30517@end example
30537 30518
30538Pressing @kbd{M-# u} is much like pressing @kbd{M-# e = M-# e}, that 30519Pressing @kbd{C-x * u} is much like pressing @kbd{C-x * e = C-x * e}, that
30539is, temporarily enabling Embedded mode for the formula under the 30520is, temporarily enabling Embedded mode for the formula under the
30540cursor and then evaluating it with @kbd{=}. But @kbd{M-# u} does 30521cursor and then evaluating it with @kbd{=}. But @kbd{C-x * u} does
30541not actually use @kbd{M-# e}, and in fact another formula somewhere 30522not actually use @kbd{C-x * e}, and in fact another formula somewhere
30542else can be enabled in Embedded mode while you use @kbd{M-# u} and 30523else can be enabled in Embedded mode while you use @kbd{C-x * u} and
30543that formula will not be disturbed. 30524that formula will not be disturbed.
30544 30525
30545With a numeric prefix argument, @kbd{M-# u} updates all active 30526With a numeric prefix argument, @kbd{C-x * u} updates all active
30546@samp{=>} formulas in the buffer. Formulas which have not yet 30527@samp{=>} formulas in the buffer. Formulas which have not yet
30547been activated in Embedded mode, and formulas which do not have 30528been activated in Embedded mode, and formulas which do not have
30548@samp{=>} as their top-level operator, are not affected by this. 30529@samp{=>} as their top-level operator, are not affected by this.
30549(This is useful only if you have used @kbd{m C}; see below.) 30530(This is useful only if you have used @kbd{m C}; see below.)
30550 30531
30551With a plain @kbd{C-u} prefix, @kbd{C-u M-# u} updates only in the 30532With a plain @kbd{C-u} prefix, @kbd{C-u C-x * u} updates only in the
30552region between mark and point rather than in the whole buffer. 30533region between mark and point rather than in the whole buffer.
30553 30534
30554@kbd{M-# u} is also a handy way to activate a formula, such as an 30535@kbd{C-x * u} is also a handy way to activate a formula, such as an
30555@samp{=>} formula that has freshly been typed in or loaded from a 30536@samp{=>} formula that has freshly been typed in or loaded from a
30556file. 30537file.
30557 30538
30558@kindex M-# a 30539@kindex C-x * a
30559@pindex calc-embedded-activate 30540@pindex calc-embedded-activate
30560The @kbd{M-# a} (@code{calc-embedded-activate}) command scans 30541The @kbd{C-x * a} (@code{calc-embedded-activate}) command scans
30561through the current buffer and activates all embedded formulas 30542through the current buffer and activates all embedded formulas
30562that contain @samp{:=} or @samp{=>} symbols. This does not mean 30543that contain @samp{:=} or @samp{=>} symbols. This does not mean
30563that Embedded mode is actually turned on, but only that the 30544that Embedded mode is actually turned on, but only that the
@@ -30565,7 +30546,7 @@ formulas' positions are registered with Embedded mode so that
30565the @samp{=>} values can be properly updated as assignments are 30546the @samp{=>} values can be properly updated as assignments are
30566changed. 30547changed.
30567 30548
30568It is a good idea to type @kbd{M-# a} right after loading a file 30549It is a good idea to type @kbd{C-x * a} right after loading a file
30569that uses embedded @samp{=>} operators. Emacs includes a nifty 30550that uses embedded @samp{=>} operators. Emacs includes a nifty
30570``buffer-local variables'' feature that you can use to do this 30551``buffer-local variables'' feature that you can use to do this
30571automatically. The idea is to place near the end of your file 30552automatically. The idea is to place near the end of your file
@@ -30588,41 +30569,41 @@ trailing strings.
30588When Emacs loads a file into memory, it checks for a Local Variables 30569When Emacs loads a file into memory, it checks for a Local Variables
30589section like this one at the end of the file. If it finds this 30570section like this one at the end of the file. If it finds this
30590section, it does the specified things (in this case, running 30571section, it does the specified things (in this case, running
30591@kbd{M-# a} automatically) before editing of the file begins. 30572@kbd{C-x * a} automatically) before editing of the file begins.
30592The Local Variables section must be within 3000 characters of the 30573The Local Variables section must be within 3000 characters of the
30593end of the file for Emacs to find it, and it must be in the last 30574end of the file for Emacs to find it, and it must be in the last
30594page of the file if the file has any page separators. 30575page of the file if the file has any page separators.
30595@xref{File Variables, , Local Variables in Files, emacs, the 30576@xref{File Variables, , Local Variables in Files, emacs, the
30596Emacs manual}. 30577Emacs manual}.
30597 30578
30598Note that @kbd{M-# a} does not update the formulas it finds. 30579Note that @kbd{C-x * a} does not update the formulas it finds.
30599To do this, type, say, @kbd{M-1 M-# u} after @w{@kbd{M-# a}}. 30580To do this, type, say, @kbd{M-1 C-x * u} after @w{@kbd{C-x * a}}.
30600Generally this should not be a problem, though, because the 30581Generally this should not be a problem, though, because the
30601formulas will have been up-to-date already when the file was 30582formulas will have been up-to-date already when the file was
30602saved. 30583saved.
30603 30584
30604Normally, @kbd{M-# a} activates all the formulas it finds, but 30585Normally, @kbd{C-x * a} activates all the formulas it finds, but
30605any previous active formulas remain active as well. With a 30586any previous active formulas remain active as well. With a
30606positive numeric prefix argument, @kbd{M-# a} first deactivates 30587positive numeric prefix argument, @kbd{C-x * a} first deactivates
30607all current active formulas, then actives the ones it finds in 30588all current active formulas, then actives the ones it finds in
30608its scan of the buffer. With a negative prefix argument, 30589its scan of the buffer. With a negative prefix argument,
30609@kbd{M-# a} simply deactivates all formulas. 30590@kbd{C-x * a} simply deactivates all formulas.
30610 30591
30611Embedded mode has two symbols, @samp{Active} and @samp{~Active}, 30592Embedded mode has two symbols, @samp{Active} and @samp{~Active},
30612which it puts next to the major mode name in a buffer's mode line. 30593which it puts next to the major mode name in a buffer's mode line.
30613It puts @samp{Active} if it has reason to believe that all 30594It puts @samp{Active} if it has reason to believe that all
30614formulas in the buffer are active, because you have typed @kbd{M-# a} 30595formulas in the buffer are active, because you have typed @kbd{C-x * a}
30615and Calc has not since had to deactivate any formulas (which can 30596and Calc has not since had to deactivate any formulas (which can
30616happen if Calc goes to update an @samp{=>} formula somewhere because 30597happen if Calc goes to update an @samp{=>} formula somewhere because
30617a variable changed, and finds that the formula is no longer there 30598a variable changed, and finds that the formula is no longer there
30618due to some kind of editing outside of Embedded mode). Calc puts 30599due to some kind of editing outside of Embedded mode). Calc puts
30619@samp{~Active} in the mode line if some, but probably not all, 30600@samp{~Active} in the mode line if some, but probably not all,
30620formulas in the buffer are active. This happens if you activate 30601formulas in the buffer are active. This happens if you activate
30621a few formulas one at a time but never use @kbd{M-# a}, or if you 30602a few formulas one at a time but never use @kbd{C-x * a}, or if you
30622used @kbd{M-# a} but then Calc had to deactivate a formula 30603used @kbd{C-x * a} but then Calc had to deactivate a formula
30623because it lost track of it. If neither of these symbols appears 30604because it lost track of it. If neither of these symbols appears
30624in the mode line, no embedded formulas are active in the buffer 30605in the mode line, no embedded formulas are active in the buffer
30625(e.g., before Embedded mode has been used, or after a @kbd{M-- M-# a}). 30606(e.g., before Embedded mode has been used, or after a @kbd{M-- C-x * a}).
30626 30607
30627Embedded formulas can refer to assignments both before and after them 30608Embedded formulas can refer to assignments both before and after them
30628in the buffer. If there are several assignments to a variable, the 30609in the buffer. If there are several assignments to a variable, the
@@ -30658,15 +30639,15 @@ and loaded in a later Emacs session, unless you have used the
30658 30639
30659The @kbd{m C} (@code{calc-auto-recompute}) command turns automatic 30640The @kbd{m C} (@code{calc-auto-recompute}) command turns automatic
30660recomputation of @samp{=>} forms on and off. If you turn automatic 30641recomputation of @samp{=>} forms on and off. If you turn automatic
30661recomputation off, you will have to use @kbd{M-# u} to update these 30642recomputation off, you will have to use @kbd{C-x * u} to update these
30662formulas manually after an assignment has been changed. If you 30643formulas manually after an assignment has been changed. If you
30663plan to change several assignments at once, it may be more efficient 30644plan to change several assignments at once, it may be more efficient
30664to type @kbd{m C}, change all the assignments, then use @kbd{M-1 M-# u} 30645to type @kbd{m C}, change all the assignments, then use @kbd{M-1 C-x * u}
30665to update the entire buffer afterwards. The @kbd{m C} command also 30646to update the entire buffer afterwards. The @kbd{m C} command also
30666controls @samp{=>} formulas on the stack; @pxref{Evaluates-To 30647controls @samp{=>} formulas on the stack; @pxref{Evaluates-To
30667Operator}. When you turn automatic recomputation back on, the 30648Operator}. When you turn automatic recomputation back on, the
30668stack will be updated but the Embedded buffer will not; you must 30649stack will be updated but the Embedded buffer will not; you must
30669use @kbd{M-# u} to update the buffer by hand. 30650use @kbd{C-x * u} to update the buffer by hand.
30670 30651
30671@node Mode Settings in Embedded Mode, Customizing Embedded Mode, Assignments in Embedded Mode, Embedded Mode 30652@node Mode Settings in Embedded Mode, Customizing Embedded Mode, Assignments in Embedded Mode, Embedded Mode
30672@section Mode Settings in Embedded Mode 30653@section Mode Settings in Embedded Mode
@@ -30777,11 +30758,11 @@ mode annotations somewhere out of the way, say, on a new page of
30777the file, as long as those mode settings are suitable for all 30758the file, as long as those mode settings are suitable for all
30778formulas in the file. 30759formulas in the file.
30779 30760
30780Enabling a formula with @kbd{M-# e} causes a fresh scan for local 30761Enabling a formula with @kbd{C-x * e} causes a fresh scan for local
30781mode annotations; you will have to use this after adding annotations 30762mode annotations; you will have to use this after adding annotations
30782above a formula by hand to get the formula to notice them. Updating 30763above a formula by hand to get the formula to notice them. Updating
30783a formula with @kbd{M-# u} will also re-scan the local modes, but 30764a formula with @kbd{C-x * u} will also re-scan the local modes, but
30784global modes are only re-scanned by @kbd{M-# a}. 30765global modes are only re-scanned by @kbd{C-x * a}.
30785 30766
30786Another way that modes can get out of date is if you add a local 30767Another way that modes can get out of date is if you add a local
30787mode annotation to a formula that has another formula after it. 30768mode annotation to a formula that has another formula after it.
@@ -30797,7 +30778,7 @@ rules of reading annotations the @samp{(sci 0)} applies to it, too.
30797456. 30778456.
30798@end example 30779@end example
30799 30780
30800We would have to go down to the other formula and press @kbd{M-# u} 30781We would have to go down to the other formula and press @kbd{C-x * u}
30801on it in order to get it to notice the new annotation. 30782on it in order to get it to notice the new annotation.
30802 30783
30803Two more mode-recording modes selectable by @kbd{m R} are available 30784Two more mode-recording modes selectable by @kbd{m R} are available
@@ -30819,13 +30800,13 @@ for @code{Save} have no effect.
30819@noindent 30800@noindent
30820You can modify Embedded mode's behavior by setting various Lisp 30801You can modify Embedded mode's behavior by setting various Lisp
30821variables described here. These variables are customizable 30802variables described here. These variables are customizable
30822(@pxref{Customizable Variables}), or you can use @kbd{M-x set-variable} 30803(@pxref{Customizing Calc}), or you can use @kbd{M-x set-variable}
30823or @kbd{M-x edit-options} to adjust a variable on the fly. 30804or @kbd{M-x edit-options} to adjust a variable on the fly.
30824(Another possibility would be to use a file-local variable annotation at 30805(Another possibility would be to use a file-local variable annotation at
30825the end of the file; 30806the end of the file;
30826@pxref{File Variables, , Local Variables in Files, emacs, the Emacs manual}.) 30807@pxref{File Variables, , Local Variables in Files, emacs, the Emacs manual}.)
30827Many of the variables given mentioned here can be set to depend on the 30808Many of the variables given mentioned here can be set to depend on the
30828major mode of the editing buffer (@pxref{Customizable Variables}). 30809major mode of the editing buffer (@pxref{Customizing Calc}).
30829 30810
30830@vindex calc-embedded-open-formula 30811@vindex calc-embedded-open-formula
30831The @code{calc-embedded-open-formula} variable holds a regular 30812The @code{calc-embedded-open-formula} variable holds a regular
@@ -30899,8 +30880,8 @@ case).
30899@vindex calc-embedded-open-word 30880@vindex calc-embedded-open-word
30900@vindex calc-embedded-close-word 30881@vindex calc-embedded-close-word
30901The @code{calc-embedded-open-word} and @code{calc-embedded-close-word} 30882The @code{calc-embedded-open-word} and @code{calc-embedded-close-word}
30902variables are similar expressions used when you type @kbd{M-# w} 30883variables are similar expressions used when you type @kbd{C-x * w}
30903instead of @kbd{M-# e} to enable Embedded mode. 30884instead of @kbd{C-x * e} to enable Embedded mode.
30904 30885
30905@vindex calc-embedded-open-plain 30886@vindex calc-embedded-open-plain
30906The @code{calc-embedded-open-plain} variable is a string which 30887The @code{calc-embedded-open-plain} variable is a string which
@@ -30921,9 +30902,9 @@ that followed might be shifted over with respect to the other lines.
30921@vindex calc-embedded-open-new-formula 30902@vindex calc-embedded-open-new-formula
30922The @code{calc-embedded-open-new-formula} variable is a string 30903The @code{calc-embedded-open-new-formula} variable is a string
30923which is inserted at the front of a new formula when you type 30904which is inserted at the front of a new formula when you type
30924@kbd{M-# f}. Its default value is @code{"\n\n"}. If this 30905@kbd{C-x * f}. Its default value is @code{"\n\n"}. If this
30925string begins with a newline character and the @kbd{M-# f} is 30906string begins with a newline character and the @kbd{C-x * f} is
30926typed at the beginning of a line, @kbd{M-# f} will skip this 30907typed at the beginning of a line, @kbd{C-x * f} will skip this
30927first newline to avoid introducing unnecessary blank lines in 30908first newline to avoid introducing unnecessary blank lines in
30928the file. 30909the file.
30929 30910
@@ -30931,15 +30912,15 @@ the file.
30931The @code{calc-embedded-close-new-formula} variable is the corresponding 30912The @code{calc-embedded-close-new-formula} variable is the corresponding
30932string which is inserted at the end of a new formula. Its default 30913string which is inserted at the end of a new formula. Its default
30933value is also @code{"\n\n"}. The final newline is omitted by 30914value is also @code{"\n\n"}. The final newline is omitted by
30934@w{@kbd{M-# f}} if typed at the end of a line. (It follows that if 30915@w{@kbd{C-x * f}} if typed at the end of a line. (It follows that if
30935@kbd{M-# f} is typed on a blank line, both a leading opening 30916@kbd{C-x * f} is typed on a blank line, both a leading opening
30936newline and a trailing closing newline are omitted.) 30917newline and a trailing closing newline are omitted.)
30937 30918
30938@vindex calc-embedded-announce-formula 30919@vindex calc-embedded-announce-formula
30939The @code{calc-embedded-announce-formula} variable is a regular 30920The @code{calc-embedded-announce-formula} variable is a regular
30940expression which is sure to be followed by an embedded formula. 30921expression which is sure to be followed by an embedded formula.
30941The @kbd{M-# a} command searches for this pattern as well as for 30922The @kbd{C-x * a} command searches for this pattern as well as for
30942@samp{=>} and @samp{:=} operators. Note that @kbd{M-# a} will 30923@samp{=>} and @samp{:=} operators. Note that @kbd{C-x * a} will
30943not activate just anything surrounded by formula delimiters; after 30924not activate just anything surrounded by formula delimiters; after
30944all, blank lines are considered formula delimiters by default! 30925all, blank lines are considered formula delimiters by default!
30945But if your language includes a delimiter which can only occur 30926But if your language includes a delimiter which can only occur
@@ -30967,7 +30948,7 @@ is simply a newline, @code{"\n"}, but may be different for different
30967major modes. If you change this, it is a good idea still to end with a 30948major modes. If you change this, it is a good idea still to end with a
30968newline so that mode annotations will appear on lines by themselves. 30949newline so that mode annotations will appear on lines by themselves.
30969 30950
30970@node Programming, Customizable Variables, Embedded Mode, Top 30951@node Programming, Customizing Calc, Embedded Mode, Top
30971@chapter Programming 30952@chapter Programming
30972 30953
30973@noindent 30954@noindent
@@ -31179,9 +31160,9 @@ takes some liberties with spaces: When we say @kbd{' [1 2 3] @key{RET}},
31179we take it for granted that it is clear we really mean 31160we take it for granted that it is clear we really mean
31180@kbd{' [1 @key{SPC} 2 @key{SPC} 3] @key{RET}}. 31161@kbd{' [1 @key{SPC} 2 @key{SPC} 3] @key{RET}}.
31181 31162
31182@kindex M-# m 31163@kindex C-x * m
31183@pindex read-kbd-macro 31164@pindex read-kbd-macro
31184The @kbd{M-# m} (@code{read-kbd-macro}) command reads an Emacs ``region'' 31165The @kbd{C-x * m} (@code{read-kbd-macro}) command reads an Emacs ``region''
31185of spelled-out keystrokes and defines it as the current keyboard macro. 31166of spelled-out keystrokes and defines it as the current keyboard macro.
31186It is a convenient way to define a keyboard macro that has been stored 31167It is a convenient way to define a keyboard macro that has been stored
31187in a file, or to define a macro without executing it at the same time. 31168in a file, or to define a macro without executing it at the same time.
@@ -31289,7 +31270,7 @@ happened to be sitting on the stack before we typed the above definition!
31289Another approach is to enter a harmless dummy definition for the macro, 31270Another approach is to enter a harmless dummy definition for the macro,
31290then go back and edit in the real one with a @kbd{Z E} command. Yet 31271then go back and edit in the real one with a @kbd{Z E} command. Yet
31291another approach is to type the macro as written-out keystroke names 31272another approach is to type the macro as written-out keystroke names
31292in a buffer, then use @kbd{M-# m} (@code{read-kbd-macro}) to read the 31273in a buffer, then use @kbd{C-x * m} (@code{read-kbd-macro}) to read the
31293macro. 31274macro.
31294 31275
31295@kindex Z / 31276@kindex Z /
@@ -31463,29 +31444,29 @@ return control to the keyboard macro.
31463@node Invocation Macros, Algebraic Definitions, Keyboard Macros, Programming 31444@node Invocation Macros, Algebraic Definitions, Keyboard Macros, Programming
31464@section Invocation Macros 31445@section Invocation Macros
31465 31446
31466@kindex M-# z 31447@kindex C-x * z
31467@kindex Z I 31448@kindex Z I
31468@pindex calc-user-invocation 31449@pindex calc-user-invocation
31469@pindex calc-user-define-invocation 31450@pindex calc-user-define-invocation
31470Calc provides one special keyboard macro, called up by @kbd{M-# z} 31451Calc provides one special keyboard macro, called up by @kbd{C-x * z}
31471(@code{calc-user-invocation}), that is intended to allow you to define 31452(@code{calc-user-invocation}), that is intended to allow you to define
31472your own special way of starting Calc. To define this ``invocation 31453your own special way of starting Calc. To define this ``invocation
31473macro,'' create the macro in the usual way with @kbd{C-x (} and 31454macro,'' create the macro in the usual way with @kbd{C-x (} and
31474@kbd{C-x )}, then type @kbd{Z I} (@code{calc-user-define-invocation}). 31455@kbd{C-x )}, then type @kbd{Z I} (@code{calc-user-define-invocation}).
31475There is only one invocation macro, so you don't need to type any 31456There is only one invocation macro, so you don't need to type any
31476additional letters after @kbd{Z I}. From now on, you can type 31457additional letters after @kbd{Z I}. From now on, you can type
31477@kbd{M-# z} at any time to execute your invocation macro. 31458@kbd{C-x * z} at any time to execute your invocation macro.
31478 31459
31479For example, suppose you find yourself often grabbing rectangles of 31460For example, suppose you find yourself often grabbing rectangles of
31480numbers into Calc and multiplying their columns. You can do this 31461numbers into Calc and multiplying their columns. You can do this
31481by typing @kbd{M-# r} to grab, and @kbd{V R : *} to multiply columns. 31462by typing @kbd{C-x * r} to grab, and @kbd{V R : *} to multiply columns.
31482To make this into an invocation macro, just type @kbd{C-x ( M-# r 31463To make this into an invocation macro, just type @kbd{C-x ( C-x * r
31483V R : * C-x )}, then @kbd{Z I}. Then, to multiply a rectangle of data, 31464V R : * C-x )}, then @kbd{Z I}. Then, to multiply a rectangle of data,
31484just mark the data in its buffer in the usual way and type @kbd{M-# z}. 31465just mark the data in its buffer in the usual way and type @kbd{C-x * z}.
31485 31466
31486Invocation macros are treated like regular Emacs keyboard macros; 31467Invocation macros are treated like regular Emacs keyboard macros;
31487all the special features described above for @kbd{Z K}-style macros 31468all the special features described above for @kbd{Z K}-style macros
31488do not apply. @kbd{M-# z} is just like @kbd{C-x e}, except that it 31469do not apply. @kbd{C-x * z} is just like @kbd{C-x e}, except that it
31489uses the macro that was last stored by @kbd{Z I}. (In fact, the 31470uses the macro that was last stored by @kbd{Z I}. (In fact, the
31490macro does not even have to have anything to do with Calc!) 31471macro does not even have to have anything to do with Calc!)
31491 31472
@@ -34729,7 +34710,7 @@ per Emacs session.
34729 34710
34730@defvar calc-end-hook 34711@defvar calc-end-hook
34731This hook is called by @code{calc-quit}, generally because the user 34712This hook is called by @code{calc-quit}, generally because the user
34732presses @kbd{q} or @kbd{M-# c} while in Calc. The Calc buffer will 34713presses @kbd{q} or @kbd{C-x * c} while in Calc. The Calc buffer will
34733be the current buffer. The hook is called as the very first 34714be the current buffer. The hook is called as the very first
34734step, before the Calc window is destroyed. 34715step, before the Calc window is destroyed.
34735@end defvar 34716@end defvar
@@ -34781,7 +34762,7 @@ message is inserted.
34781@end defvar 34762@end defvar
34782 34763
34783@defvar calc-reset-hook 34764@defvar calc-reset-hook
34784This hook is called after @kbd{M-# 0} (@code{calc-reset}) has 34765This hook is called after @kbd{C-x * 0} (@code{calc-reset}) has
34785reset all modes. The Calc buffer will be the current buffer. 34766reset all modes. The Calc buffer will be the current buffer.
34786@end defvar 34767@end defvar
34787 34768
@@ -34846,10 +34827,27 @@ used the first time, your hook should add a variable to the
34846list and also call @code{make-local-variable} itself. 34827list and also call @code{make-local-variable} itself.
34847@end defvar 34828@end defvar
34848 34829
34849@node Customizable Variables, Reporting Bugs, Programming, Top 34830@node Customizing Calc, Reporting Bugs, Programming, Top
34850@appendix Customizable Variables 34831@appendix Customizing Calc
34832
34833The usual prefix for Calc is the key sequence @kbd{C-x *}. If you wish
34834to use a different prefix, you can put
34851 34835
34852GNU Calc is controlled by many variables, most of which can be reset 34836@example
34837(global-set-key "NEWPREFIX" 'calc-dispatch)
34838@end example
34839
34840@noindent
34841in your .emacs file.
34842(@xref{Key Bindings,,Customizing Key Bindings,emacs,
34843The GNU Emacs Manual}, for more information on binding keys.)
34844A convenient way to start Calc is with @kbd{C-x * *}; to make it equally
34845convenient for users who use a different prefix, the prefix can be
34846followed by @kbd{=}, @kbd{&}, @kbd{#}, @kbd{\}, @kbd{/}, @kbd{+} or
34847@kbd{-} as well as @kbd{*} to start Calc, and so in many cases the last
34848character of the prefix can simply be typed twice.
34849
34850Calc is controlled by many variables, most of which can be reset
34853from within Calc. Some variables are less involved with actual 34851from within Calc. Some variables are less involved with actual
34854calculation, and can be set outside of Calc using Emacs's 34852calculation, and can be set outside of Calc using Emacs's
34855customization facilities. These variables are listed below. 34853customization facilities. These variables are listed below.
@@ -34882,7 +34880,7 @@ See @ref{Graphics}.@*
34882The variable @code{calc-gnuplot-name} should be the name of the 34880The variable @code{calc-gnuplot-name} should be the name of the
34883GNUPLOT program (a string). If you have GNUPLOT installed on your 34881GNUPLOT program (a string). If you have GNUPLOT installed on your
34884system but Calc is unable to find it, you may need to set this 34882system but Calc is unable to find it, you may need to set this
34885variable. (@pxref{Customizable Variables}) 34883variable. (@pxref{Customizing Calc})
34886You may also need to set some Lisp variables to show Calc how to run 34884You may also need to set some Lisp variables to show Calc how to run
34887GNUPLOT on your system, see @ref{Devices, ,Graphical Devices} . The default value 34885GNUPLOT on your system, see @ref{Devices, ,Graphical Devices} . The default value
34888of @code{calc-gnuplot-name} is @code{"gnuplot"}. 34886of @code{calc-gnuplot-name} is @code{"gnuplot"}.
@@ -34936,9 +34934,9 @@ The default value of @code{calc-language-alist} is
34936@defvarx calc-embedded-announce-formula-alist 34934@defvarx calc-embedded-announce-formula-alist
34937See @ref{Customizing Embedded Mode}.@* 34935See @ref{Customizing Embedded Mode}.@*
34938The variable @code{calc-embedded-announce-formula} helps determine 34936The variable @code{calc-embedded-announce-formula} helps determine
34939what formulas @kbd{M-# a} will activate in a buffer. It is a 34937what formulas @kbd{C-x * a} will activate in a buffer. It is a
34940regular expression, and when activating embedded formulas with 34938regular expression, and when activating embedded formulas with
34941@kbd{M-# a}, it will tell Calc that what follows is a formula to be 34939@kbd{C-x * a}, it will tell Calc that what follows is a formula to be
34942activated. (Calc also uses other patterns to find formulas, such as 34940activated. (Calc also uses other patterns to find formulas, such as
34943@samp{=>} and @samp{:=}.) 34941@samp{=>} and @samp{:=}.)
34944 34942
@@ -34975,7 +34973,7 @@ and @code{calc-embedded-open-close-mode-alist}.
34975See @ref{Customizing Embedded Mode}.@* 34973See @ref{Customizing Embedded Mode}.@*
34976The variables @code{calc-embedded-open-formula} and 34974The variables @code{calc-embedded-open-formula} and
34977@code{calc-embedded-open-formula} control the region that Calc will 34975@code{calc-embedded-open-formula} control the region that Calc will
34978activate as a formula when Embedded mode is entered with @kbd{M-# e}. 34976activate as a formula when Embedded mode is entered with @kbd{C-x * e}.
34979They are regular expressions; 34977They are regular expressions;
34980Calc normally scans backward and forward in the buffer for the 34978Calc normally scans backward and forward in the buffer for the
34981nearest text matching these regular expressions to be the ``formula 34979nearest text matching these regular expressions to be the ``formula
@@ -35013,7 +35011,7 @@ It consists of a list of lists of the form
35013See @ref{Customizing Embedded Mode}.@* 35011See @ref{Customizing Embedded Mode}.@*
35014The variables @code{calc-embedded-open-word} and 35012The variables @code{calc-embedded-open-word} and
35015@code{calc-embedded-close-word} control the region that Calc will 35013@code{calc-embedded-close-word} control the region that Calc will
35016activate when Embedded mode is entered with @kbd{M-# w}. They are 35014activate when Embedded mode is entered with @kbd{C-x * w}. They are
35017regular expressions. 35015regular expressions.
35018 35016
35019The default values of @code{calc-embedded-open-word} and 35017The default values of @code{calc-embedded-open-word} and
@@ -35077,15 +35075,15 @@ and @code{calc-embedded-open-close-mode-alist}.
35077See @ref{Customizing Embedded Mode}.@* 35075See @ref{Customizing Embedded Mode}.@*
35078The variables @code{calc-embedded-open-new-formula} and 35076The variables @code{calc-embedded-open-new-formula} and
35079@code{calc-embedded-close-new-formula} are strings which are 35077@code{calc-embedded-close-new-formula} are strings which are
35080inserted before and after a new formula when you type @kbd{M-# f}. 35078inserted before and after a new formula when you type @kbd{C-x * f}.
35081 35079
35082The default value of @code{calc-embedded-open-new-formula} is 35080The default value of @code{calc-embedded-open-new-formula} is
35083@code{"\n\n"}. If this string begins with a newline character and the 35081@code{"\n\n"}. If this string begins with a newline character and the
35084@kbd{M-# f} is typed at the beginning of a line, @kbd{M-# f} will skip 35082@kbd{C-x * f} is typed at the beginning of a line, @kbd{C-x * f} will skip
35085this first newline to avoid introducing unnecessary blank lines in the 35083this first newline to avoid introducing unnecessary blank lines in the
35086file. The default value of @code{calc-embedded-close-new-formula} is 35084file. The default value of @code{calc-embedded-close-new-formula} is
35087also @code{"\n\n"}. The final newline is omitted by @w{@kbd{M-# f}} 35085also @code{"\n\n"}. The final newline is omitted by @w{@kbd{C-x * f}}
35088if typed at the end of a line. (It follows that if @kbd{M-# f} is 35086if typed at the end of a line. (It follows that if @kbd{C-x * f} is
35089typed on a blank line, both a leading opening newline and a trailing 35087typed on a blank line, both a leading opening newline and a trailing
35090closing newline are omitted.) 35088closing newline are omitted.)
35091 35089
@@ -35141,7 +35139,7 @@ should also be added to @code{calc-embedded-announce-formula-alist}
35141and @code{calc-embedded-open-close-plain-alist}. 35139and @code{calc-embedded-open-close-plain-alist}.
35142@end defvar 35140@end defvar
35143 35141
35144@node Reporting Bugs, Summary, Customizable Variables, Top 35142@node Reporting Bugs, Summary, Customizing Calc, Top
35145@appendix Reporting Bugs 35143@appendix Reporting Bugs
35146 35144
35147@noindent 35145@noindent
@@ -35225,35 +35223,34 @@ keystrokes are not listed in this summary.
35225@advance@baselineskip-2.5pt 35223@advance@baselineskip-2.5pt
35226@let@c@sumbreak 35224@let@c@sumbreak
35227@end iftex 35225@end iftex
35228@r{ @: M-# a @: @: 33 @:calc-embedded-activate@:} 35226@r{ @: C-x * a @: @: 33 @:calc-embedded-activate@:}
35229@r{ @: M-# b @: @: @:calc-big-or-small@:} 35227@r{ @: C-x * b @: @: @:calc-big-or-small@:}
35230@r{ @: M-# c @: @: @:calc@:} 35228@r{ @: C-x * c @: @: @:calc@:}
35231@r{ @: M-# d @: @: @:calc-embedded-duplicate@:} 35229@r{ @: C-x * d @: @: @:calc-embedded-duplicate@:}
35232@r{ @: M-# e @: @: 34 @:calc-embedded@:} 35230@r{ @: C-x * e @: @: 34 @:calc-embedded@:}
35233@r{ @: M-# f @:formula @: @:calc-embedded-new-formula@:} 35231@r{ @: C-x * f @:formula @: @:calc-embedded-new-formula@:}
35234@r{ @: M-# g @: @: 35 @:calc-grab-region@:} 35232@r{ @: C-x * g @: @: 35 @:calc-grab-region@:}
35235@r{ @: M-# i @: @: @:calc-info@:} 35233@r{ @: C-x * i @: @: @:calc-info@:}
35236@r{ @: M-# j @: @: @:calc-embedded-select@:} 35234@r{ @: C-x * j @: @: @:calc-embedded-select@:}
35237@r{ @: M-# k @: @: @:calc-keypad@:} 35235@r{ @: C-x * k @: @: @:calc-keypad@:}
35238@r{ @: M-# l @: @: @:calc-load-everything@:} 35236@r{ @: C-x * l @: @: @:calc-load-everything@:}
35239@r{ @: M-# m @: @: @:read-kbd-macro@:} 35237@r{ @: C-x * m @: @: @:read-kbd-macro@:}
35240@r{ @: M-# n @: @: 4 @:calc-embedded-next@:} 35238@r{ @: C-x * n @: @: 4 @:calc-embedded-next@:}
35241@r{ @: M-# o @: @: @:calc-other-window@:} 35239@r{ @: C-x * o @: @: @:calc-other-window@:}
35242@r{ @: M-# p @: @: 4 @:calc-embedded-previous@:} 35240@r{ @: C-x * p @: @: 4 @:calc-embedded-previous@:}
35243@r{ @: M-# q @:formula @: @:quick-calc@:} 35241@r{ @: C-x * q @:formula @: @:quick-calc@:}
35244@r{ @: M-# r @: @: 36 @:calc-grab-rectangle@:} 35242@r{ @: C-x * r @: @: 36 @:calc-grab-rectangle@:}
35245@r{ @: M-# s @: @: @:calc-info-summary@:} 35243@r{ @: C-x * s @: @: @:calc-info-summary@:}
35246@r{ @: M-# t @: @: @:calc-tutorial@:} 35244@r{ @: C-x * t @: @: @:calc-tutorial@:}
35247@r{ @: M-# u @: @: @:calc-embedded-update-formula@:} 35245@r{ @: C-x * u @: @: @:calc-embedded-update-formula@:}
35248@r{ @: M-# w @: @: @:calc-embedded-word@:} 35246@r{ @: C-x * w @: @: @:calc-embedded-word@:}
35249@r{ @: M-# x @: @: @:calc-quit@:} 35247@r{ @: C-x * x @: @: @:calc-quit@:}
35250@r{ @: M-# y @: @:1,28,49 @:calc-copy-to-buffer@:} 35248@r{ @: C-x * y @: @:1,28,49 @:calc-copy-to-buffer@:}
35251@r{ @: M-# z @: @: @:calc-user-invocation@:} 35249@r{ @: C-x * z @: @: @:calc-user-invocation@:}
35252@r{ @: M-# = @: @: @:calc-embedded-update-formula@:} 35250@r{ @: C-x * : @: @: 36 @:calc-grab-sum-down@:}
35253@r{ @: M-# : @: @: 36 @:calc-grab-sum-down@:} 35251@r{ @: C-x * _ @: @: 36 @:calc-grab-sum-across@:}
35254@r{ @: M-# _ @: @: 36 @:calc-grab-sum-across@:} 35252@r{ @: C-x * ` @:editing @: 30 @:calc-embedded-edit@:}
35255@r{ @: M-# ` @:editing @: 30 @:calc-embedded-edit@:} 35253@r{ @: C-x * 0 @:(zero) @: @:calc-reset@:}
35256@r{ @: M-# 0 @:(zero) @: @:calc-reset@:}
35257 35254
35258@c 35255@c
35259@r{ @: 0-9 @:number @: @:@:number} 35256@r{ @: 0-9 @:number @: @:@:number}