lisp/progmodes/which-func.el (which-func-mode): Fix bug#10428.
[emacs.git] / lisp / calc / calc-menu.el
blobe67d169b6833ef0b4366cc1f5794c39a75d266fe
1 ;;; calc-menu.el --- a menu for Calc
3 ;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
5 ;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
7 ;; This file is part of GNU Emacs.
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation, either version 3 of the License, or
12 ;; (at your option) any later version.
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 ;;; Commentary:
24 (defvar calc-arithmetic-menu
25 (list "Arithmetic"
26 (list "Basic"
27 ["-(1:)" calc-change-sign
28 :keys "n" :active (>= (calc-stack-size) 1)]
29 ["(2:) + (1:)" calc-plus
30 :keys "+" :active (>= (calc-stack-size) 2)]
31 ["(2:) - (1:)" calc-minus
32 :keys "-" :active (>= (calc-stack-size) 2)]
33 ["(2:) * (1:)" calc-times
34 :keys "*" :active (>= (calc-stack-size) 2)]
35 ["(2:) / (1:)" calc-divide
36 :keys "/" :active (>= (calc-stack-size) 2)]
37 ["(2:) ^ (1:)" calc-power
38 :keys "^" :active (>= (calc-stack-size) 2)]
39 ["(2:) ^ (1/(1:))"
40 (progn
41 (require 'calc-ext)
42 (let ((calc-inverse-flag t))
43 (call-interactively 'calc-power)))
44 :keys "I ^"
45 :active (>= (calc-stack-size) 2)
46 :help "The (1:)th root of (2:)"]
47 ["abs(1:)"
48 (progn
49 (require 'calc-arith)
50 (call-interactively 'calc-abs))
51 :keys "A"
52 :active (>= (calc-stack-size) 1)
53 :help "Absolute value"]
54 ["1/(1:)"
55 (progn
56 (require 'calc-arith)
57 (call-interactively 'calc-inv))
58 :keys "&"
59 :active (>= (calc-stack-size) 1)]
60 ["sqrt(1:)"
61 (progn
62 (require 'calc-math)
63 (call-interactively 'calc-sqrt))
64 :keys "Q"
65 :active (>= (calc-stack-size) 1)]
66 ["idiv(2:,1:)"
67 (progn
68 (require 'calc-arith)
69 (call-interactively 'calc-idiv))
70 :keys "\\"
71 :active (>= (calc-stack-size) 2)
72 :help "The integer quotient of (2:) over (1:)"]
73 ["(2:) mod (1:)"
74 (progn
75 (require 'calc-misc)
76 (call-interactively 'calc-mod))
77 :keys "%"
78 :active (>= (calc-stack-size) 2)
79 :help "The remainder when (2:) is divided by (1:)"])
80 (list "Rounding"
81 ["floor(1:)"
82 (progn
83 (require 'calc-arith)
84 (call-interactively 'calc-floor))
85 :keys "F"
86 :active (>= (calc-stack-size) 1)
87 :help "The greatest integer less than or equal to (1:)"]
88 ["ceiling(1:)"
89 (progn
90 (require 'calc-arith)
91 (call-interactively 'calc-ceiling))
92 :keys "I F"
93 :active (>= (calc-stack-size) 1)
94 :help "The smallest integer greater than or equal to (1:)"]
95 ["round(1:)"
96 (progn
97 (require 'calc-arith)
98 (call-interactively 'calc-round))
99 :keys "R"
100 :active (>= (calc-stack-size) 1)
101 :help "The nearest integer to (1:)"]
102 ["truncate(1:)"
103 (progn
104 (require 'calc-arith)
105 (call-interactively 'calc-trunc))
106 :keys "I R"
107 :active (>= (calc-stack-size) 1)
108 :help "The integer part of (1:)"])
109 (list "Complex Numbers"
110 ["Re(1:)"
111 (progn
112 (require 'calc-cplx)
113 (call-interactively 'calc-re))
114 :keys "f r"
115 :active (>= (calc-stack-size) 1)]
116 ["Im(1:)"
117 (progn
118 (require 'calc-cplx)
119 (call-interactively 'calc-im))
120 :keys "f i"
121 :active (>= (calc-stack-size) 1)]
122 ["conj(1:)"
123 (progn
124 (require 'calc-cplx)
125 (call-interactively 'calc-conj))
126 :keys "J"
127 :active (>= (calc-stack-size) 1)
128 :help "The complex conjugate of (1:)"]
129 ["length(1:)"
130 (progn (require 'calc-arith)
131 (call-interactively 'calc-abs))
132 :keys "A"
133 :active (>= (calc-stack-size) 1)
134 :help "The length (absolute value) of (1:)"]
135 ["arg(1:)"
136 (progn
137 (require 'calc-cplx)
138 (call-interactively 'calc-argument))
139 :keys "G"
140 :active (>= (calc-stack-size) 1)
141 :help "The argument (polar angle) of (1:)"])
142 (list "Conversion"
143 ["Convert (1:) to a float"
144 (progn
145 (require 'calc-ext)
146 (call-interactively 'calc-float))
147 :keys "c f"
148 :active (>= (calc-stack-size) 1)]
149 ["Convert (1:) to a fraction"
150 (progn
151 (require 'calc-ext)
152 (call-interactively 'calc-fraction))
153 :keys "c F"
154 :active (>= (calc-stack-size) 1)])
155 (list "Binary"
156 ["Set word size"
157 (progn
158 (require 'calc-bin)
159 (call-interactively 'calc-word-size))
160 :keys "b w"]
161 ["Clip (1:) to word size"
162 (progn
163 (require 'calc-bin)
164 (call-interactively 'calc-clip))
165 :keys "b c"
166 :active (>= (calc-stack-size) 1)
167 :help "Reduce (1:) modulo 2^wordsize"]
168 ["(2:) and (1:)"
169 (progn
170 (require 'calc-bin)
171 (call-interactively 'calc-and))
172 :keys "b a"
173 :active (>= (calc-stack-size) 2)
174 :help "Bitwise AND [modulo 2^wordsize]"]
175 ["(2:) or (1:)"
176 (progn
177 (require 'calc-bin)
178 (call-interactively 'calc-or))
179 :keys "b o"
180 :active (>= (calc-stack-size) 2)
181 :help "Bitwise inclusive OR [modulo 2^wordsize]"]
182 ["(2:) xor (1:)"
183 (progn
184 (require 'calc-bin)
185 (call-interactively 'calc-xor))
186 :keys "b x"
187 :active (>= (calc-stack-size) 2)
188 :help "Bitwise exclusive OR [modulo 2^wordsize]"]
189 ["diff(2:,1:)"
190 (progn
191 (require 'calc-bin)
192 (call-interactively 'calc-diff))
193 :keys "b d"
194 :active (>= (calc-stack-size) 2)
195 :help "Bitwise difference [modulo 2^wordsize]"]
196 ["not (1:)"
197 (progn
198 (require 'calc-bin)
199 (call-interactively 'calc-not))
200 :keys "b n"
201 :active (>= (calc-stack-size) 1)
202 :help "Bitwise NOT [modulo 2^wordsize]"]
203 ["left shift(1:)"
204 (progn
205 (require 'calc-bin)
206 (call-interactively 'calc-lshift-binary))
207 :keys "b l"
208 :active (>= (calc-stack-size) 1)
209 :help "Shift (1:)[modulo 2^wordsize] one bit left"]
210 ["right shift(1:)"
211 (progn
212 (require 'calc-bin)
213 (call-interactively 'calc-rshift-binary))
214 :keys "b r"
215 :active (>= (calc-stack-size) 1)
216 :help "Shift (1:)[modulo 2^wordsize] one bit right, putting 0s on the left"]
217 ["arithmetic right shift(1:)"
218 (progn
219 (require 'calc-bin)
220 (call-interactively 'calc-rshift-arith))
221 :keys "b R"
222 :active (>= (calc-stack-size) 1)
223 :help "Shift (1:)[modulo 2^wordsize] one bit right, duplicating the leftmost bit"]
224 ["rotate(1:)"
225 (progn
226 (require 'calc-bin)
227 (call-interactively 'calc-rotate-binary))
228 :keys "b t"
229 :active (>= (calc-stack-size) 1)
230 :help "Rotate (1:)[modulo 2^wordsize] one bit left"])
231 "-------"
232 ["Help on Arithmetic"
233 (calc-info-goto-node "Arithmetic")])
234 "Menu for Calc's arithmetic functions.")
236 (defvar calc-scientific-function-menu
237 (list "Scientific Functions"
238 (list "Constants"
239 ["pi"
240 (progn
241 (require 'calc-math)
242 (call-interactively 'calc-pi))
243 :keys "P"]
244 ["e"
245 (progn
246 (require 'calc-math)
247 (let ((calc-hyperbolic-flag t))
248 (call-interactively 'calc-pi)))
249 :keys "H P"]
250 ["phi"
251 (progn
252 (require 'calc-math)
253 (let ((calc-inverse-flag t)
254 (calc-hyperbolic-flag t))
255 (call-interactively 'calc-pi)))
256 :keys "I H P"
257 :help "The golden ratio"]
258 ["gamma"
259 (progn
260 (require 'calc-math)
261 (let ((calc-inverse-flag t))
262 (call-interactively 'calc-pi)))
263 :keys "I P"
264 :help "Euler's constant"])
265 (list "Logs and Exps"
266 ["ln(1:)"
267 (progn
268 (require 'calc-math)
269 (call-interactively 'calc-ln))
270 :keys "L"
271 :active (>= (calc-stack-size) 1)
272 :help "The natural logarithm"]
273 ["e^(1:)"
274 (progn
275 (require 'calc-math)
276 (call-interactively 'calc-exp))
277 :keys "E"
278 :active (>= (calc-stack-size) 1)]
279 ["log(1:) [base 10]"
280 (progn
281 (require 'calc-math)
282 (call-interactively 'calc-log10))
283 :keys "H L"
284 :active (>= (calc-stack-size) 1)
285 :help "The common logarithm"]
286 ["10^(1:)"
287 (progn
288 (require 'calc-math)
289 (let ((calc-inverse-flag t))
290 (call-interactively 'calc-log10)))
291 :keys "I H L"
292 :active (>= (calc-stack-size) 1)]
293 ["log(2:) [base(1:)]"
294 (progn
295 (require 'calc-math)
296 (call-interactively 'calc-log))
297 :keys "B"
298 :active (>= (calc-stack-size) 2)
299 :help "The logarithm with an arbitrary base"]
300 ["(2:) ^ (1:)"
301 calc-power
302 :keys "^"
303 :active (>= (calc-stack-size) 2)])
304 (list "Trigonometric Functions"
305 ["sin(1:)"
306 (progn
307 (require 'calc-math)
308 (call-interactively 'calc-sin))
309 :keys "S"
310 :active (>= (calc-stack-size) 1)]
311 ["cos(1:)"
312 (progn
313 (require 'calc-math)
314 (call-interactively 'calc-cos))
315 :keys "C"
316 :active (>= (calc-stack-size) 1)]
317 ["tan(1:)"
318 (progn
319 (require 'calc-math)
320 (call-interactively 'calc-tan))
321 :keys "T"
322 :active (>= (calc-stack-size) 1)]
323 ["arcsin(1:)"
324 (progn
325 (require 'calc-math)
326 (call-interactively 'calc-arcsin))
327 :keys "I S"
328 :active (>= (calc-stack-size) 1)]
329 ["arccos(1:)"
330 (progn
331 (require 'calc-math)
332 (call-interactively 'calc-arccos))
333 :keys "I C"
334 :active (>= (calc-stack-size) 1)]
335 ["arctan(1:)"
336 (progn
337 (require 'calc-math)
338 (call-interactively 'calc-arctan))
339 :keys "I T"
340 :active (>= (calc-stack-size) 1)]
341 ["arctan2(2:,1:)"
342 (progn
343 (require 'calc-math)
344 (call-interactively 'calc-arctan2))
345 :keys "f T"
346 :active (>= (calc-stack-size) 2)]
347 "--Angle Measure--"
348 ["Radians"
349 (progn
350 (require 'calc-math)
351 (calc-radians-mode))
352 :keys "m r"
353 :style radio
354 :selected (eq calc-angle-mode 'rad)]
355 ["Degrees"
356 (progn
357 (require 'calc-math)
358 (calc-degrees-mode))
359 :keys "m d"
360 :style radio
361 :selected (eq calc-angle-mode 'deg)]
362 ["HMS"
363 (progn
364 (require 'calc-math)
365 (calc-hms-mode))
366 :keys "m h"
367 :style radio
368 :selected (eq calc-angle-mode 'hms)])
369 (list "Hyperbolic Functions"
370 ["sinh(1:)"
371 (progn
372 (require 'calc-math)
373 (call-interactively 'calc-sinh))
374 :keys "H S"
375 :active (>= (calc-stack-size) 1)]
376 ["cosh(1:)"
377 (progn
378 (require 'calc-math)
379 (call-interactively 'calc-cosh))
380 :keys "H C"
381 :active (>= (calc-stack-size) 1)]
382 ["tanh(1:)"
383 (progn
384 (require 'calc-math)
385 (call-interactively 'calc-tanh))
386 :keys "H T"
387 :active (>= (calc-stack-size) 1)]
388 ["arcsinh(1:)"
389 (progn
390 (require 'calc-math)
391 (call-interactively 'calc-arcsinh))
392 :keys "I H S"
393 :active (>= (calc-stack-size) 1)]
394 ["arccosh(1:)"
395 (progn
396 (require 'calc-math)
397 (call-interactively 'calc-arccosh))
398 :keys "I H C"
399 :active (>= (calc-stack-size) 1)]
400 ["arctanh(1:)"
401 (progn
402 (require 'calc-math)
403 (call-interactively 'calc-arctanh))
404 :keys "I H T"
405 :active (>= (calc-stack-size) 1)])
406 (list "Advanced Math Functions"
407 ["Gamma(1:)"
408 (progn
409 (require 'calc-comb)
410 (call-interactively 'calc-gamma))
411 :keys "f g"
412 :active (>= (calc-stack-size) 1)
413 :help "The Euler Gamma function"]
414 ["GammaP(2:,1:)"
415 (progn
416 (require 'calc-funcs)
417 (call-interactively 'calc-inc-gamma))
418 :keys "f G"
419 :active (>= (calc-stack-size) 2)
420 :help "The lower incomplete Gamma function"]
421 ["Beta(2:,1:)"
422 (progn
423 (require 'calc-funcs)
424 (call-interactively 'calc-beta))
425 :keys "f b"
426 :active (>= (calc-stack-size) 2)
427 :help "The Euler Beta function"]
428 ["BetaI(3:,2:,1:)"
429 (progn
430 (require 'calc-funcs)
431 (call-interactively 'calc-inc-beta))
432 :keys "f B"
433 :active (>= (calc-stack-size) 3)
434 :help "The incomplete Beta function"]
435 ["erf(1:)"
436 (progn
437 (require 'calc-funcs)
438 (call-interactively 'calc-erf))
439 :keys "f e"
440 :active (>= (calc-stack-size) 1)
441 :help "The error function"]
442 ["BesselJ(2:,1:)"
443 (progn
444 (require 'calc-funcs)
445 (call-interactively 'calc-bessel-J))
446 :keys "f j"
447 :active (>= (calc-stack-size) 2)
448 :help "The Bessel function of the first kind (of order (2:))"]
449 ["BesselY(2:,1:)"
450 (progn
451 (require 'calc-funcs)
452 (call-interactively 'calc-bessel-Y))
453 :keys "f y"
454 :active (>= (calc-stack-size) 2)
455 :help "The Bessel function of the second kind (of order (2:))"])
456 (list "Combinatorial Functions"
457 ["gcd(2:,1:)"
458 (progn
459 (require 'calc-comb)
460 (call-interactively 'calc-gcd))
461 :keys "k g"
462 :active (>= (calc-stack-size) 2)]
463 ["lcm(2:,1:)"
464 (progn
465 (require 'calc-comb)
466 (call-interactively 'calc-lcm))
467 :keys "k l"
468 :active (>= (calc-stack-size) 2)]
469 ["factorial(1:)"
470 (progn
471 (require 'calc-comb)
472 (call-interactively 'calc-factorial))
473 :keys "!"
474 :active (>= (calc-stack-size) 1)]
475 ["(2:) choose (1:)"
476 (progn
477 (require 'calc-comb)
478 (call-interactively 'calc-choose))
479 :keys "k c"
480 :active (>= (calc-stack-size) 2)]
481 ["permutations(2:,1:)"
482 (progn
483 (require 'calc-comb)
484 (call-interactively 'calc-perm))
485 :keys "H k c"
486 :active (>= (calc-stack-size) 2)]
487 ["Primality test for (1:)"
488 (progn
489 (require 'calc-comb)
490 (call-interactively 'calc-prime-test))
491 :keys "k p"
492 :active (>= (calc-stack-size) 1)
493 :help "For large (1:), a probabilistic test"]
494 ["Factor (1:) into primes"
495 (progn
496 (require 'calc-comb)
497 (call-interactively 'calc-prime-factors))
498 :keys "k f"
499 :active (>= (calc-stack-size) 1)]
500 ["Next prime after (1:)"
501 (progn
502 (require 'calc-comb)
503 (call-interactively 'calc-next-prime))
504 :keys "k n"
505 :active (>= (calc-stack-size) 1)]
506 ["Previous prime before (1:)"
507 (progn
508 (require 'calc-comb)
509 (call-interactively 'calc-prev-prime))
510 :keys "I k n"
511 :active (>= (calc-stack-size) 1)]
512 ["phi(1:)"
513 (progn
514 (require 'calc-comb)
515 (call-interactively 'calc-totient))
516 :keys "k n"
517 :active (>= (calc-stack-size) 1)
518 :help "Euler's totient function"]
519 ["random(1:)"
520 (progn
521 (require 'calc-comb)
522 (call-interactively 'calc-random))
523 :keys "k r"
524 :active (>= (calc-stack-size) 1)
525 :help "A random number >=1 and < (1:)"])
526 "----"
527 ["Help on Scientific Functions"
528 (calc-info-goto-node "Scientific Functions")])
529 "Menu for Calc's scientific functions.")
531 (defvar calc-algebra-menu
532 (list "Algebra"
533 (list "Simplification"
534 ["Simplify (1:)"
535 (progn
536 (require 'calc-alg)
537 (call-interactively 'calc-simplify))
538 :keys "a s"
539 :active (>= (calc-stack-size) 1)]
540 ["Simplify (1:) with extended rules"
541 (progn
542 (require 'calc-alg)
543 (call-interactively 'calc-simplify-extended))
544 :keys "a e"
545 :active (>= (calc-stack-size) 1)
546 :help "Apply possibly unsafe simplifications"])
547 (list "Manipulation"
548 ["Expand formula (1:)"
549 (progn
550 (require 'calc-alg)
551 (call-interactively 'calc-expand-formula))
552 :keys "a \""
553 :active (>= (calc-stack-size) 1)
554 :help "Expand (1:) into its defining formula, if possible"]
555 ["Evaluate variables in (1:)"
556 (progn
557 (require 'calc-ext)
558 (call-interactively 'calc-evaluate))
559 :keys "="
560 :active (>= (calc-stack-size) 1)]
561 ["Make substitution in (1:)"
562 (progn
563 (require 'calc-alg)
564 (call-interactively 'calc-substitute))
565 :keys "a b"
566 :active (>= (calc-stack-size) 1)
567 :help
568 "Substitute all occurrences of a sub-expression with a new sub-expression"])
569 (list "Polynomials"
570 ["Factor (1:)"
571 (progn
572 (require 'calc-alg)
573 (call-interactively 'calc-factor))
574 :keys "a f"
575 :active (>= (calc-stack-size) 1)]
576 ["Collect terms in (1:)"
577 (progn
578 (require 'calc-alg)
579 (call-interactively 'calc-collect))
580 :keys "a c"
581 :active (>= (calc-stack-size) 1)
582 :help "Arrange as a polynomial in a given variable"]
583 ["Expand (1:)"
584 (progn
585 (require 'calc-alg)
586 (call-interactively 'calc-expand))
587 :keys "a x"
588 :active (>= (calc-stack-size) 1)
589 :help "Apply distributive law everywhere"]
590 ["Find roots of (1:)"
591 (progn
592 (require 'calcalg2)
593 (call-interactively 'calc-poly-roots))
594 :keys "a P"
595 :active (>= (calc-stack-size) 1)])
596 (list "Calculus"
597 ["Differentiate (1:)"
598 (progn
599 (require 'calcalg2)
600 (call-interactively 'calc-derivative))
601 :keys "a d"
602 :active (>= (calc-stack-size) 1)]
603 ["Integrate (1:) [indefinite]"
604 (progn
605 (require 'calcalg2)
606 (call-interactively 'calc-integral))
607 :keys "a i"
608 :active (>= (calc-stack-size) 1)]
609 ["Integrate (1:) [definite]"
610 (progn
611 (require 'calcalg2)
612 (let ((var (read-string "Integration variable: ")))
613 (calc-tabular-command 'calcFunc-integ "Integration"
614 "intg" nil var nil nil)))
615 :keys "C-u a i"
616 :active (>= (calc-stack-size) 1)]
617 ["Integrate (1:) [numeric]"
618 (progn
619 (require 'calcalg2)
620 (call-interactively 'calc-num-integral))
621 :keys "a I"
622 :active (>= (calc-stack-size) 1)
623 :help "Integrate using the open Romberg method"]
624 ["Taylor expand (1:)"
625 (progn
626 (require 'calcalg2)
627 (call-interactively 'calc-taylor))
628 :keys "a t"
629 :active (>= (calc-stack-size) 1)]
630 ["Minimize (2:) [initial guess = (1:)]"
631 (progn
632 (require 'calcalg3)
633 (call-interactively 'calc-find-minimum))
634 :keys "a N"
635 :active (>= (calc-stack-size) 2)
636 :help "Find a local minimum"]
637 ["Maximize (2:) [initial guess = (1:)]"
638 (progn
639 (require 'calcalg3)
640 (call-interactively 'calc-find-maximum))
641 :keys "a X"
642 :active (>= (calc-stack-size) 2)
643 :help "Find a local maximum"])
644 (list "Solving"
645 ["Solve equation (1:)"
646 (progn
647 (require 'calcalg2)
648 (call-interactively 'calc-solve-for))
649 :keys "a S"
650 :active (>= (calc-stack-size) 1)]
651 ["Solve equation (2:) numerically [initial guess = (1:)]"
652 (progn
653 (require 'calcalg3)
654 (call-interactively 'calc-find-root))
655 :keys "a R"
656 :active (>= (calc-stack-size) 2)]
657 ["Find roots of polynomial (1:)"
658 (progn
659 (require 'calcalg2)
660 (call-interactively 'calc-poly-roots))
661 :keys "a P"
662 :active (>= (calc-stack-size) 1)])
663 (list "Curve Fitting"
664 ["Fit (1:)=[x values, y values] to a curve"
665 (progn
666 (require 'calcalg3)
667 (call-interactively 'calc-curve-fit))
668 :keys "a F"
669 :active (>= (calc-stack-size) 1)])
670 "----"
671 ["Help on Algebra"
672 (calc-info-goto-node "Algebra")])
673 "Menu for Calc's algebraic facilities.")
676 (defvar calc-graphics-menu
677 (list "Graphics"
678 ["Graph 2D [(1:)= y values, (2:)= x values]"
679 (progn
680 (require 'calc-graph)
681 (call-interactively 'calc-graph-fast))
682 :keys "g f"
683 :active (>= (calc-stack-size) 2)]
684 ["Graph 3D [(1:)= z values, (2:)= y values, (3:)= x values]"
685 (progn
686 (require 'calc-graph)
687 (call-interactively 'calc-graph-fast-3d))
688 :keys "g F"
689 :active (>= (calc-stack-size) 3)]
690 "----"
691 ["Help on Graphics"
692 (calc-info-goto-node "Graphics")])
693 "Menu for Calc's graphics.")
696 (defvar calc-vectors-menu
697 (list "Matrices/Vectors"
698 (list "Matrices"
699 ["(2:) + (1:)" calc-plus
700 :keys "+" :active (>= (calc-stack-size) 2)]
701 ["(2:) - (1:)" calc-minus
702 :keys "-" :active (>= (calc-stack-size) 2)]
703 ["(2:) * (1:)" calc-times
704 :keys "*" :active (>= (calc-stack-size) 2)]
705 ["(1:)^(-1)"
706 (progn
707 (require 'calc-arith)
708 (call-interactively 'calc-inv))
709 :keys "&"
710 :active (>= (calc-stack-size) 1)]
711 ["Create an identity matrix"
712 (progn
713 (require 'calc-vec)
714 (call-interactively 'calc-ident))
715 :keys "v i"]
716 ["transpose(1:)"
717 (progn
718 (require 'calc-vec)
719 (call-interactively 'calc-transpose))
720 :keys "v t"
721 :active (>= (calc-stack-size) 1)]
722 ["det(1:)"
723 (progn
724 (require 'calc-mtx)
725 (call-interactively 'calc-mdet))
726 :keys "V D"
727 :active (>= (calc-stack-size) 1)]
728 ["trace(1:)"
729 (progn
730 (require 'calc-mtx)
731 (call-interactively 'calc-mtrace))
732 :keys "V T"
733 :active (>= (calc-stack-size) 1)]
734 ["LUD decompose (1:)"
735 (progn
736 (require 'calc-mtx)
737 (call-interactively 'calc-mlud))
738 :keys "V L"
739 :active (>= (calc-stack-size) 1)]
740 ["Extract a row from (1:)"
741 (progn
742 (require 'calc-vec)
743 (call-interactively 'calc-mrow))
744 :keys "v r"
745 :active (>= (calc-stack-size) 1)]
746 ["Extract a column from (1:)"
747 (progn
748 (require 'calc-vec)
749 (call-interactively 'calc-mcol))
750 :keys "v c"
751 :active (>= (calc-stack-size) 1)])
752 (list "Vectors"
753 ["Extract the first element of (1:)"
754 (progn
755 (require 'calc-vec)
756 (call-interactively 'calc-head))
757 :keys "v h"
758 :active (>= (calc-stack-size) 1)]
759 ["Extract an element from (1:)"
760 (progn
761 (require 'calc-vec)
762 (call-interactively 'calc-mrow))
763 :keys "v r"
764 :active (>= (calc-stack-size) 1)]
765 ["Reverse (1:)"
766 (progn
767 (require 'calc-vec)
768 (call-interactively 'calc-reverse-vector))
769 :keys "v v"
770 :active (>= (calc-stack-size) 1)]
771 ["Unpack (1:)"
772 (progn
773 (require 'calc-vec)
774 (call-interactively 'calc-unpack))
775 :keys "v u"
776 :active (>= (calc-stack-size) 1)
777 :help "Separate the elements of (1:)"]
778 ["(2:) cross (1:)"
779 (progn
780 (require 'calc-vec)
781 (call-interactively 'calc-cross))
782 :keys "V C"
783 :active (>= (calc-stack-size) 2)
784 :help "The cross product in R^3"]
785 ["(2:) dot (1:)"
786 calc-mult
787 :keys "*"
788 :active (>= (calc-stack-size) 2)
789 :help "The dot product"]
790 ["Map a function across (1:)"
791 (progn
792 (require 'calc-map)
793 (call-interactively 'calc-map))
794 :keys "V M"
795 :active (>= (calc-stack-size) 1)
796 :help "Apply a function to each element"])
797 (list "Vectors As Sets"
798 ["Remove duplicates from (1:)"
799 (progn
800 (require 'calc-vec)
801 (call-interactively 'calc-remove-duplicates))
802 :keys "V +"
803 :active (>= (calc-stack-size) 1)]
804 ["(2:) union (1:)"
805 (progn
806 (require 'calc-vec)
807 (call-interactively 'calc-set-union))
808 :keys "V V"
809 :active (>= (calc-stack-size) 2)]
810 ["(2:) intersect (1:)"
811 (progn
812 (require 'calc-vec)
813 (call-interactively 'calc-set-intersect))
814 :keys "V ^"
815 :active (>= (calc-stack-size) 2)]
816 ["(2:) \\ (1:)"
817 (progn
818 (require 'calc-vec)
819 (call-interactively 'calc-set-difference))
820 :keys "V -"
821 :help "Set difference"
822 :active (>= (calc-stack-size) 2)])
823 (list "Statistics On Vectors"
824 ["length(1:)"
825 (progn
826 (require 'calc-stat)
827 (call-interactively 'calc-vector-count))
828 :keys "u #"
829 :active (>= (calc-stack-size) 1)
830 :help "The number of data values"]
831 ["sum(1:)"
832 (progn
833 (require 'calc-stat)
834 (call-interactively 'calc-vector-sum))
835 :keys "u +"
836 :active (>= (calc-stack-size) 1)
837 :help "The sum of the data values"]
838 ["max(1:)"
839 (progn
840 (require 'calc-stat)
841 (call-interactively 'calc-vector-max))
842 :keys "u x"
843 :active (>= (calc-stack-size) 1)
844 :help "The maximum of the data values"]
845 ["min(1:)"
846 (progn
847 (require 'calc-stat)
848 (call-interactively 'calc-vector-min))
849 :keys "u N"
850 :active (>= (calc-stack-size) 1)
851 :help "The minimum of the data values"]
852 ["mean(1:)"
853 (progn
854 (require 'calc-stat)
855 (call-interactively 'calc-vector-mean))
856 :keys "u M"
857 :active (>= (calc-stack-size) 1)
858 :help "The average (arithmetic mean) of the data values"]
859 ["mean(1:) with error"
860 (progn
861 (require 'calc-stat)
862 (call-interactively 'calc-vector-mean-error))
863 :keys "I u M"
864 :active (>= (calc-stack-size) 1)
865 :help "The average (arithmetic mean) of the data values as an error form"]
866 ["sdev(1:)"
867 (progn
868 (require 'calc-stat)
869 (call-interactively 'calc-vector-sdev))
870 :keys "u S"
871 :active (>= (calc-stack-size) 1)
872 :help "The sample sdev, sqrt[sum((values - mean)^2)/(N-1)]"]
873 ["variance(1:)"
874 (progn
875 (require 'calc-stat)
876 (call-interactively 'calc-vector-variance))
877 :keys "H u S"
878 :active (>= (calc-stack-size) 1)
879 :help "The sample variance, sum((values - mean)^2)/(N-1)"]
880 ["population sdev(1:)"
881 (progn
882 (require 'calc-stat)
883 (call-interactively 'calc-vector-pop-sdev))
884 :keys "I u S"
885 :active (>= (calc-stack-size) 1)
886 :help "The population sdev, sqrt[sum((values - mean)^2)/N]"]
887 ["population variance(1:)"
888 (progn
889 (require 'calc-stat)
890 (call-interactively 'calc-vector-pop-variance))
891 :keys "H I u S"
892 :active (>= (calc-stack-size) 1)
893 :help "The population variance, sum((values - mean)^2)/N"]
894 ["median(1:)"
895 (progn
896 (require 'calc-stat)
897 (call-interactively 'calc-vector-median))
898 :keys "H u M"
899 :active (>= (calc-stack-size) 1)
900 :help "The median of the data values"]
901 ["harmonic mean(1:)"
902 (progn
903 (require 'calc-stat)
904 (call-interactively 'calc-vector-harmonic-mean))
905 :keys "H I u M"
906 :active (>= (calc-stack-size) 1)]
907 ["geometric mean(1:)"
908 (progn
909 (require 'calc-stat)
910 (call-interactively 'calc-vector-geometric-mean))
911 :keys "u G"
912 :active (>= (calc-stack-size) 1)]
913 ["arithmetic-geometric mean(1:)"
914 (progn
915 (require 'calc-stat)
916 (let ((calc-hyperbolic-flag t))
917 (call-interactively 'calc-vector-geometric-mean)))
918 :keys "H u G"
919 :active (>= (calc-stack-size) 1)]
920 ["RMS(1:)"
921 (progn (require 'calc-arith)
922 (call-interactively 'calc-abs))
923 :keys "A"
924 :active (>= (calc-stack-size) 1)
925 :help "The root-mean-square, or quadratic mean"])
926 ["Abbreviate long vectors"
927 (progn
928 (require 'calc-mode)
929 (call-interactively 'calc-full-vectors))
930 :keys "v ."
931 :style toggle
932 :selected (not calc-full-vectors)]
933 "----"
934 ["Help on Matrices/Vectors"
935 (calc-info-goto-node "Matrix Functions")])
936 "Menu for Calc's vector and matrix functions.")
938 (defvar calc-units-menu
939 (list "Units"
940 ["Convert units in (1:)"
941 (progn
942 (require 'calc-units)
943 (call-interactively 'calc-convert-units ))
944 :keys "u c"
945 :active (>= (calc-stack-size) 1)]
946 ["Convert temperature in (1:)"
947 (progn
948 (require 'calc-units)
949 (call-interactively 'calc-convert-temperature))
950 :keys "u t"
951 :active (>= (calc-stack-size) 1)]
952 ["Simplify units in (1:)"
953 (progn
954 (require 'calc-units)
955 (call-interactively 'calc-simplify-units))
956 :keys "u s"
957 :active (>= (calc-stack-size) 1)]
958 ["View units table"
959 (progn
960 (require 'calc-units)
961 (call-interactively 'calc-view-units-table))
962 :keys "u V"]
963 (list "Logarithmic Units"
964 ["Convert (1:) to dB (power)"
965 (progn
966 (require 'calc-units)
967 (call-interactively 'calc-db))
968 :keys "l d"
969 :active (>= (calc-stack-size) 1)]
970 ["Convert (2:) to dB (power) with reference level (1:)"
971 (progn
972 (require 'calc-units)
973 (let ((calc-option-flag t))
974 (call-interactively 'calc-db)))
975 :keys "O l d"
976 :active (>= (calc-stack-size) 2)]
977 ["Convert (1:) to Np (power)"
978 (progn
979 (require 'calc-units)
980 (call-interactively 'calc-np))
981 :keys "l n"
982 :active (>= (calc-stack-size) 1)]
983 ["Convert (2:) to Np (power) with reference level (1:)"
984 (progn
985 (require 'calc-units)
986 (let ((calc-option-flag t))
987 (call-interactively 'calc-np)))
988 :keys "O l n"
989 :active (>= (calc-stack-size) 2)]
990 ["Convert (1:) to power quantity"
991 (progn
992 (require 'calc-units)
993 (call-interactively 'calc-lu-quant))
994 :keys "l q"
995 :active (>= (calc-stack-size) 1)]
996 ["Convert (2:) to power quantity with reference level (1:)"
997 (progn
998 (require 'calc-units)
999 (let ((calc-option-flag t))
1000 (call-interactively 'calc-lu-quant)))
1001 :keys "O l q"
1002 :active (>= (calc-stack-size) 2)]
1003 "----"
1004 ["Convert (1:) to dB (field)"
1005 (progn
1006 (require 'calc-units)
1007 (let ((calc-hyperbolic-flag t))
1008 (call-interactively 'calc-db)))
1009 :keys "H l d"
1010 :active (>= (calc-stack-size) 1)]
1011 ["Convert (2:) to dB (field) with reference level (1:)"
1012 (progn
1013 (require 'calc-units)
1014 (let ((calc-option-flag t)
1015 (calc-hyperbolic-flag t))
1016 (call-interactively 'calc-db)))
1017 :keys "O H l d"
1018 :active (>= (calc-stack-size) 2)]
1019 ["Convert (1:) to Np (field)"
1020 (progn
1021 (require 'calc-units)
1022 (let ((calc-hyperbolic-flag t))
1023 (call-interactively 'calc-np)))
1024 :keys "H l n"
1025 :active (>= (calc-stack-size) 1)]
1026 ["Convert (2:) to Np (field) with reference level (1:)"
1027 (progn
1028 (require 'calc-units)
1029 (let ((calc-option-flag t)
1030 (calc-hyperbolic-flag t))
1031 (call-interactively 'calc-np)))
1032 :keys "O H l d"
1033 :active (>= (calc-stack-size) 2)]
1034 ["Convert (1:) to field quantity"
1035 (progn
1036 (require 'calc-units)
1037 (let ((calc-hyperbolic-flag t))
1038 (call-interactively 'calc-lu-quant)))
1039 :keys "H l q"
1040 :active (>= (calc-stack-size) 1)]
1041 ["Convert (2:) to field quantity with reference level (1:)"
1042 (progn
1043 (require 'calc-units)
1044 (let ((calc-option-flag t)
1045 (calc-hyperbolic-flag))
1046 (call-interactively 'calc-lu-quant)))
1047 :keys "O H l q"
1048 :active (>= (calc-stack-size) 2)])
1049 (list "Musical Notes"
1050 ["Convert (1:) to scientific pitch notation"
1051 (progn
1052 (require 'calc-units)
1053 (call-interactively 'calc-spn))
1054 :keys "l s"
1055 :active (>= (calc-stack-size) 1)]
1056 ["Convert (1:) to midi number"
1057 (progn
1058 (require 'calc-units)
1059 (call-interactively 'calc-midi))
1060 :keys "l m"
1061 :active (>= (calc-stack-size) 1)]
1062 ["Convert (1:) to frequency"
1063 (progn
1064 (require 'calc-units)
1065 (call-interactively 'calc-freq))
1066 :keys "l f"
1067 :active (>= (calc-stack-size) 1)])
1068 "----"
1069 ["Help on Units"
1070 (calc-info-goto-node "Units")])
1071 "Menu for Calc's units functions.")
1073 (defvar calc-variables-menu
1074 (list "Variables"
1075 ["Store (1:) into a variable"
1076 (progn
1077 (require 'calc-store)
1078 (call-interactively 'calc-store))
1079 :keys "s s"
1080 :active (>= (calc-stack-size) 1)]
1081 ["Recall a variable value"
1082 (progn
1083 (require 'calc-store)
1084 (call-interactively 'calc-recall ))
1085 :keys "s r"]
1086 ["Edit the value of a variable"
1087 (progn
1088 (require 'calc-store)
1089 (call-interactively 'calc-edit-variable))
1090 :keys "s e"]
1091 ["Exchange (1:) with a variable value"
1092 (progn
1093 (require 'calc-store)
1094 (call-interactively 'calc-store-exchange))
1095 :keys "s x"
1096 :active (>= (calc-stack-size) 1)]
1097 ["Clear variable value"
1098 (progn
1099 (require 'calc-store)
1100 (call-interactively 'calc-unstore))
1101 :keys "s u"]
1102 ["Evaluate variables in (1:)"
1103 (progn
1104 (require 'calc-ext)
1105 (call-interactively 'calc-evaluate))
1106 :keys "="
1107 :active (>= (calc-stack-size) 1)]
1108 ["Evaluate (1:), assigning a value to a variable"
1109 (progn
1110 (require 'calc-store)
1111 (call-interactively 'calc-let))
1112 :keys "s l"
1113 :active (>= (calc-stack-size) 1)
1114 :help "Evaluate (1:) under a temporary assignment of a variable"]
1115 "----"
1116 ["Help on Variables"
1117 (calc-info-goto-node "Store and Recall")])
1118 "Menu for Calc's variables.")
1120 (defvar calc-stack-menu
1121 (list "Stack"
1122 ["Remove (1:)"
1123 calc-pop
1124 :keys "DEL"
1125 :active (>= (calc-stack-size) 1)]
1126 ["Switch (1:) and (2:)"
1127 calc-roll-down
1128 :keys "TAB"
1129 :active (>= (calc-stack-size) 2)]
1130 ["Duplicate (1:)"
1131 calc-enter
1132 :keys "RET"
1133 :active (>= (calc-stack-size) 1)]
1134 ["Edit (1:)"
1135 (progn
1136 (require 'calc-yank)
1137 (call-interactively calc-edit))
1138 :keys "`"
1139 :active (>= (calc-stack-size) 1)]
1140 "----"
1141 ["Help on Stack"
1142 (calc-info-goto-node "Stack and Trail")])
1143 "Menu for Calc's stack functions.")
1145 (defvar calc-errors-menu
1146 (list "Undo"
1147 ["Undo"
1148 (progn
1149 (require 'calc-undo)
1150 (call-interactively 'calc-undo))
1151 :keys "U"]
1152 ["Redo"
1153 (progn
1154 (require 'calc-undo)
1155 (call-interactively 'calc-redo))
1156 :keys "D"]
1157 "----"
1158 ["Help on Undo"
1159 (progn
1160 (calc-info-goto-node "Introduction")
1161 (Info-goto-node "Undo"))]))
1163 (defvar calc-modes-menu
1164 (list "Modes"
1165 ["Precision"
1166 (progn
1167 (require 'calc-ext)
1168 (call-interactively 'calc-precision))
1169 :keys "p"
1170 :help "Set the precision for floating point calculations"]
1171 ["Fraction mode"
1172 (progn
1173 (require 'calc-frac)
1174 (call-interactively 'calc-frac-mode))
1175 :keys "m f"
1176 :style toggle
1177 :selected calc-prefer-frac
1178 :help "Leave integer quotients as fractions"]
1179 ["Symbolic mode"
1180 (lambda ()
1181 (interactive)
1182 (require 'calc-mode)
1183 (calc-symbolic-mode nil))
1184 :keys "m s"
1185 :style toggle
1186 :selected calc-symbolic-mode
1187 :help "Leave functions producing inexact answers in symbolic form"]
1188 ["Infinite mode"
1189 (lambda ()
1190 (interactive)
1191 (require 'calc-mode)
1192 (calc-infinite-mode nil))
1193 :keys "m i"
1194 :style toggle
1195 :selected calc-infinite-mode
1196 :help "Let expressions like 1/0 produce infinite results"]
1197 ["Abbreviate long vectors"
1198 (progn
1199 (require 'calc-mode)
1200 (call-interactively 'calc-full-vectors))
1201 :keys "v ."
1202 :style toggle
1203 :selected (not calc-full-vectors)]
1204 (list "Angle Measure"
1205 ["Radians"
1206 (progn
1207 (require 'calc-math)
1208 (call-interactively 'calc-radians-mode))
1209 :keys "m r"
1210 :style radio
1211 :selected (eq calc-angle-mode 'rad)]
1212 ["Degrees"
1213 (progn
1214 (require 'calc-math)
1215 (call-interactively 'calc-degrees-mode))
1216 :keys "m d"
1217 :style radio
1218 :selected (eq calc-angle-mode 'deg)]
1219 ["HMS"
1220 (progn
1221 (require 'calc-math)
1222 (call-interactively 'calc-hms-mode))
1223 :keys "m h"
1224 :style radio
1225 :selected (eq calc-angle-mode 'hms)])
1226 (list "Radix"
1227 ["Decimal"
1228 (progn
1229 (require 'calc-bin)
1230 (call-interactively 'calc-decimal-radix))
1231 :keys "d 0"
1232 :style radio
1233 :selected (and (= calc-number-radix 10)
1234 (not calc-twos-complement-mode))]
1235 ["Binary"
1236 (progn
1237 (require 'calc-bin)
1238 (call-interactively 'calc-binary-radix))
1239 :keys "d 2"
1240 :style radio
1241 :selected (and (= calc-number-radix 2)
1242 (not calc-twos-complement-mode))]
1243 ["Octal"
1244 (progn
1245 (require 'calc-bin)
1246 (call-interactively 'calc-octal-radix))
1247 :keys "d 8"
1248 :style radio
1249 :selected (and (= calc-number-radix 8)
1250 (not calc-twos-complement-mode))]
1251 ["Hexadecimal"
1252 (progn
1253 (require 'calc-bin)
1254 (call-interactively 'calc-hex-radix))
1255 :keys "d 6"
1256 :style radio
1257 :selected (and (= calc-number-radix 16)
1258 (not calc-twos-complement-mode))]
1259 ["Other"
1260 (progn
1261 (require 'calc-bin)
1262 (call-interactively 'calc-radix))
1263 :keys "d r"
1264 :style radio
1265 :selected (and
1266 (not calc-twos-complement-mode)
1267 (not
1269 (= calc-number-radix 10)
1270 (= calc-number-radix 2)
1271 (= calc-number-radix 8)
1272 (= calc-number-radix 16))))]
1273 ["--Two's Complement--"
1274 (lambda () ())
1275 :style radio
1276 :selected nil]
1277 ["Binary"
1278 (progn
1279 (require 'calc-bin)
1280 (call-interactively
1281 (lambda () (interactive) (calc-binary-radix t))))
1282 :keys "C-u d 2"
1283 :style radio
1284 :selected (and (= calc-number-radix 2)
1285 calc-twos-complement-mode)]
1286 ["Octal"
1287 (progn
1288 (require 'calc-bin)
1289 (call-interactively
1290 (lambda () (interactive) (calc-octal-radix t))))
1291 :keys "C-u d 8"
1292 :style radio
1293 :selected (and (= calc-number-radix 8)
1294 calc-twos-complement-mode)]
1295 ["Hexadecimal"
1296 (progn
1297 (require 'calc-bin)
1298 (call-interactively
1299 (lambda () (interactive) (calc-hex-radix t))))
1300 :keys "C-u d 6"
1301 :style radio
1302 :selected (and (= calc-number-radix 16)
1303 calc-twos-complement-mode)])
1304 (list "Float Format"
1305 ["Normal"
1306 (progn
1307 (require 'calc-mode)
1308 (call-interactively 'calc-normal-notation))
1309 :keys "d n"
1310 :style radio
1311 :selected (eq (car-safe calc-float-format) 'float)]
1312 ["Fixed point"
1313 (progn
1314 (require 'calc-mode)
1315 (call-interactively 'calc-fix-notation))
1316 :keys "d f"
1317 :style radio
1318 :selected (eq (car-safe calc-float-format) 'fix)]
1319 ["Scientific notation"
1320 (progn
1321 (require 'calc-mode)
1322 (call-interactively 'calc-sci-notation))
1323 :keys "d s"
1324 :style radio
1325 :selected (eq (car-safe calc-float-format) 'sci)]
1326 ["Engineering notation"
1327 (progn
1328 (require 'calc-mode)
1329 (call-interactively 'calc-eng-notation))
1330 :keys "d e"
1331 :style radio
1332 :selected (eq (car-safe calc-float-format) 'eng)])
1333 (list "Complex Format"
1334 ["Default"
1335 (progn
1336 (require 'calc-cplx)
1337 (calc-complex-notation))
1338 :style radio
1339 :selected (not calc-complex-format)
1340 :keys "d c"
1341 :help "Display complex numbers as ordered pairs."]
1342 ["i notation"
1343 (progn
1344 (require 'calc-cplx)
1345 (calc-i-notation))
1346 :style radio
1347 :selected (eq calc-complex-format 'i)
1348 :keys "d i"
1349 :help "Display complex numbers as a+bi."]
1350 ["j notation"
1351 (progn
1352 (require 'calc-cplx)
1353 (calc-i-notation))
1354 :style radio
1355 :selected (eq calc-complex-format 'j)
1356 :keys "d j"
1357 :help "Display complex numbers as a+bj."]
1358 ["Other"
1359 (calc-complex-notation)
1360 :style radio
1361 :selected (and calc-complex-format
1362 (not (eq calc-complex-format 'i))
1363 (not (eq calc-complex-format 'j)))
1364 :active nil]
1365 "----"
1366 ["Polar mode"
1367 (progn
1368 (require 'calc-cplx)
1369 (calc-polar-mode nil))
1370 :style toggle
1371 :selected (eq calc-complex-mode 'polar)
1372 :keys "m p"
1373 :help "Prefer polar form for complex numbers."])
1374 (list "Algebraic"
1375 ["Normal"
1376 (progn
1377 (require 'calc-mode)
1378 (cond
1379 (calc-incomplete-algebraic-mode
1380 (calc-algebraic-mode t))
1381 (calc-algebraic-mode
1382 (calc-algebraic-mode nil))))
1383 :style radio
1384 :selected (not calc-algebraic-mode)]
1385 ["Algebraic mode"
1386 (progn
1387 (require 'calc-mode)
1388 (if (or
1389 calc-incomplete-algebraic-mode
1390 (not calc-algebraic-mode))
1391 (calc-algebraic-mode nil)))
1392 :keys "m a"
1393 :style radio
1394 :selected (and calc-algebraic-mode
1395 (not calc-incomplete-algebraic-mode))
1396 :help "Keys which start numeric entry also start algebraic entry"]
1397 ["Incomplete algebraic mode"
1398 (progn
1399 (require 'calc-mode)
1400 (unless calc-incomplete-algebraic-mode
1401 (calc-algebraic-mode t)))
1402 :keys "C-u m a"
1403 :style radio
1404 :selected calc-incomplete-algebraic-mode
1405 :help "Only ( and [ begin algebraic entry"]
1406 ["Total algebraic mode"
1407 (progn
1408 (require 'calc-mode)
1409 (unless (eq calc-algebraic-mode 'total)
1410 (calc-total-algebraic-mode nil)))
1411 :keys "m t"
1412 :style radio
1413 :selected (eq calc-algebraic-mode 'total)
1414 :help "All regular letters and punctuation begin algebraic entry"])
1415 (list "Language"
1416 ["Normal"
1417 (progn
1418 (require 'calc-lang)
1419 (call-interactively 'calc-normal-language))
1420 :keys "d N"
1421 :style radio
1422 :selected (eq calc-language nil)]
1423 ["Big"
1424 (progn
1425 (require 'calc-lang)
1426 (call-interactively 'calc-big-language))
1427 :keys "d B"
1428 :style radio
1429 :selected (eq calc-language 'big)
1430 :help "Use textual approximations to various mathematical notations"]
1431 ["Flat"
1432 (progn
1433 (require 'calc-lang)
1434 (call-interactively 'calc-flat-language))
1435 :keys "d O"
1436 :style radio
1437 :selected (eq calc-language 'flat)
1438 :help "Write matrices on a single line"]
1439 ["C"
1440 (progn
1441 (require 'calc-lang)
1442 (call-interactively 'calc-c-language))
1443 :keys "d C"
1444 :style radio
1445 :selected (eq calc-language 'c)]
1446 ["Pascal"
1447 (progn
1448 (require 'calc-lang)
1449 (call-interactively 'calc-pascal-language))
1450 :keys "d P"
1451 :style radio
1452 :selected (eq calc-language 'pascal)]
1453 ["Fortran"
1454 (progn
1455 (require 'calc-lang)
1456 (call-interactively 'calc-fortran-language))
1457 :keys "d F"
1458 :style radio
1459 :selected (eq calc-language 'fortran)]
1460 ["TeX"
1461 (progn
1462 (require 'calc-lang)
1463 (call-interactively 'calc-tex-language))
1464 :keys "d T"
1465 :style radio
1466 :selected (eq calc-language 'tex)]
1467 ["LaTeX"
1468 (progn
1469 (require 'calc-lang)
1470 (call-interactively 'calc-latex-language))
1471 :keys "d L"
1472 :style radio
1473 :selected (eq calc-language 'latex)]
1474 ["Eqn"
1475 (progn
1476 (require 'calc-lang)
1477 (call-interactively 'calc-eqn-language))
1478 :keys "d E"
1479 :style radio
1480 :selected (eq calc-language 'eqn)]
1481 ["Yacas"
1482 (progn
1483 (require 'calc-lang)
1484 (call-interactively 'calc-yacas-language))
1485 :keys "d Y"
1486 :style radio
1487 :selected (eq calc-language 'yacas)]
1488 ["Maxima"
1489 (progn
1490 (require 'calc-lang)
1491 (call-interactively 'calc-maxima-language))
1492 :keys "d X"
1493 :style radio
1494 :selected (eq calc-language 'maxima)]
1495 ["Giac"
1496 (progn
1497 (require 'calc-lang)
1498 (call-interactively 'calc-giac-language))
1499 :keys "d A"
1500 :style radio
1501 :selected (eq calc-language 'giac)]
1502 ["Mma"
1503 (progn
1504 (require 'calc-lang)
1505 (call-interactively 'calc-mathematica-language))
1506 :keys "d M"
1507 :style radio
1508 :selected (eq calc-language 'math)]
1509 ["Maple"
1510 (progn
1511 (require 'calc-lang)
1512 (call-interactively 'calc-maple-language))
1513 :keys "d W"
1514 :style radio
1515 :selected (eq calc-language 'maple)])
1516 "----"
1517 ["Save mode settings" calc-save-modes :keys "m m"]
1518 "----"
1519 ["Help on Modes"
1520 (calc-info-goto-node "Mode settings")])
1521 "Menu for Calc's mode settings.")
1523 (defvar calc-help-menu
1524 (list "Help"
1525 ["Manual"
1526 calc-info
1527 :keys "h i"]
1528 ["Tutorial"
1529 calc-tutorial
1530 :keys "h t"]
1531 ["Summary"
1532 calc-info-summary
1533 :keys "h s"]
1534 "----"
1535 ["Help on Help"
1536 (progn
1537 (calc-info-goto-node "Introduction")
1538 (Info-goto-node "Help Commands"))])
1539 "Menu for Calc's help functions.")
1541 (defvar calc-mode-map)
1543 (easy-menu-define
1544 calc-menu
1545 calc-mode-map
1546 "Menu for Calc."
1547 (list "Calc"
1548 :visible '(eq major-mode 'calc-mode)
1549 calc-arithmetic-menu
1550 calc-scientific-function-menu
1551 calc-algebra-menu
1552 calc-graphics-menu
1553 calc-vectors-menu
1554 calc-units-menu
1555 calc-variables-menu
1556 calc-stack-menu
1557 calc-errors-menu
1558 calc-modes-menu
1559 calc-help-menu
1560 ["Reset"
1561 (progn
1562 (require 'calc-ext)
1563 (call-interactively 'calc-reset))
1564 :help "Reset Calc to its initial state"]
1565 ["Quit" calc-quit]))
1567 (provide 'calc-menu)