aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2023-02-17 17:49:53 +0100
committerStefan Kangas2023-02-17 17:49:53 +0100
commita5ad897b35fd5f9079977b12d69da253cbcfcb8a (patch)
tree45b7e4842fae83daad0f3e3f0d3543b134982005
parentdabd7feb950ef2dba0ce23ec74c5b141cff96a55 (diff)
downloademacs-a5ad897b35fd5f9079977b12d69da253cbcfcb8a.tar.gz
emacs-a5ad897b35fd5f9079977b12d69da253cbcfcb8a.zip
Use substitute-command-keys more in Calc help
* lisp/calc/calc-ext.el (calc-do-prefix-help): * lisp/calc/calc-help.el (calc-help-prefix, calc-help-for-help) (calc-h-prefix-help, calc-inverse-prefix-help) (calc-hyperbolic-prefix-help, calc-inv-hyp-prefix-help) (calc-f-prefix-help, calc-s-prefix-help, calc-r-prefix-help) (calc-j-prefix-help, calc-a-prefix-help, calc-b-prefix-help) (calc-c-prefix-help, calc-d-prefix-help, calc-g-prefix-help) (calc-k-prefix-help, calc-m-prefix-help, calc-t-prefix-help) (calc-u-prefix-help, calc-l-prefix-help, calc-v-prefix-help): * lisp/calc/calc-misc.el (calc-dispatch-help, calc-help): * lisp/calc/calc.el (calc-do-dispatch): Use substitute-command keys.
-rw-r--r--lisp/calc/calc-ext.el5
-rw-r--r--lisp/calc/calc-help.el238
-rw-r--r--lisp/calc/calc-misc.el44
-rw-r--r--lisp/calc/calc.el8
4 files changed, 154 insertions, 141 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index bb0ecd2c84f..52c0fa4f69f 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -1297,12 +1297,13 @@ calc-kill calc-kill-region calc-yank))))
1297 0)) 1297 0))
1298 (let ((msg (nth calc-prefix-help-phase msgs))) 1298 (let ((msg (nth calc-prefix-help-phase msgs)))
1299 (message "%s" (if msg 1299 (message "%s" (if msg
1300 (concat group ": " msg ":" 1300 (concat group ": " (substitute-command-keys msg) ":"
1301 (make-string 1301 (make-string
1302 (- (apply #'max (mapcar #'length msgs)) 1302 (- (apply #'max (mapcar #'length msgs))
1303 (length msg)) 1303 (length msg))
1304 ?\s) 1304 ?\s)
1305 " [MORE]" 1305 (substitute-command-keys
1306 " [\\`?'=MORE]")
1306 (if key 1307 (if key
1307 (concat " " (char-to-string key) 1308 (concat " " (char-to-string key)
1308 "-") 1309 "-")
diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el
index d0052472836..6b3e5cd64b1 100644
--- a/lisp/calc/calc-help.el
+++ b/lisp/calc/calc-help.el
@@ -39,8 +39,11 @@
39 (or calc-dispatch-help (sit-for echo-keystrokes)) 39 (or calc-dispatch-help (sit-for echo-keystrokes))
40 (let ((key (calc-read-key-sequence 40 (let ((key (calc-read-key-sequence
41 (if calc-dispatch-help 41 (if calc-dispatch-help
42 "Calc Help options: Help, Info, Tutorial, Summary; Key, Function; ?=more" 42 (substitute-command-keys
43 (format "%s (Type ? for a list of Calc Help options)" 43 (concat "Calc Help options: \\`h'elp, \\`i'nfo, \\`t'utorial, "
44 "\\`s'ummary; \\`k'ey, \\`f'unction; \\`?'=more"))
45 (format (substitute-command-keys
46 "%s (Type \\`?' for a list of Calc Help options)")
44 (key-description (this-command-keys)))) 47 (key-description (this-command-keys))))
45 calc-help-map))) 48 calc-help-map)))
46 (setq key (lookup-key calc-help-map key)) 49 (setq key (lookup-key calc-help-map key))
@@ -76,7 +79,10 @@
76 (describe-function 'calc-help-for-help) 79 (describe-function 'calc-help-for-help)
77 (select-window (get-buffer-window "*Help*")) 80 (select-window (get-buffer-window "*Help*"))
78 (while (progn 81 (while (progn
79 (message "Calc Help options: Help, Info, ... press SPC, DEL to scroll, C-g to cancel") 82 (message (substitute-command-keys
83 (concat
84 "Calc Help options: \\`h'elp, \\`i'nfo, ... press "
85 "\\`SPC', \\`DEL' to scroll, \\`C-g' to cancel")))
80 (memq (setq key (read-event)) 86 (memq (setq key (read-event))
81 '(? ?\C-h ?\C-? ?\C-v ?\M-v))) 87 '(? ?\C-h ?\C-? ?\C-v ?\M-v)))
82 (condition-case nil 88 (condition-case nil
@@ -453,47 +459,47 @@
453(defun calc-h-prefix-help () 459(defun calc-h-prefix-help ()
454 (interactive) 460 (interactive)
455 (calc-do-prefix-help 461 (calc-do-prefix-help
456 '("Help; Bindings; Info, Tutorial, Summary; News" 462 '("\\`h'elp; \\`b'indings; \\`i'nfo, \\`t'utorial, \\`s'ummary; \\`n'ews"
457 "describe: Key, C (briefly), Function, Variable") 463 "describe: \\`k'ey, \\`c' (briefly), \\`f'unction, \\`v'ariable")
458 "help" ?h)) 464 "help" ?h))
459 465
460(defun calc-inverse-prefix-help () 466(defun calc-inverse-prefix-help ()
461 (interactive) 467 (interactive)
462 (calc-do-prefix-help 468 (calc-do-prefix-help
463 '("I + S (arcsin), C (arccos), T (arctan); Q (square)" 469 '("\\`I' + \\`S' (arcsin), \\`C' (arccos), \\`T' (arctan); \\`Q' (square)"
464 "I + E (ln), L (exp), B (alog: B^X); f E (lnp1), f L (expm1)" 470 "\\`I' + \\`E' (ln), \\`L' (exp), \\`B' (alog: B^X); \\`f E' (lnp1), \\`f L' (expm1)"
465 "I + F (ceiling), R (truncate); a S (invert func)" 471 "\\`I' + \\`F' (ceiling), \\`R' (truncate); \\`a S' (invert func)"
466 "I + a m (match-not); c h (from-hms); k n (prev prime)" 472 "\\`I' + \\`a m' (match-not); \\`c h' (from-hms); \\`k n' (prev prime)"
467 "I + f G (gamma-Q); f e (erfc); k B (etc., lower-tail dists)" 473 "\\`I' + \\`f G' (gamma-Q); \\`f e' (erfc); \\`k B' (etc., lower-tail dists)"
468 "I + V S (reverse sort); V G (reverse grade)" 474 "\\`I' + \\`V S' (reverse sort); \\`V G' (reverse grade)"
469 "I + v s (remove subvec); v h (tail)" 475 "\\`I' + \\`v s' (remove subvec); \\`v h' (tail)"
470 "I + t + (alt sum), t M (mean with error)" 476 "\\`I' + \\`t' + (alt sum), \\`t M' (mean with error)"
471 "I + t S (pop std dev), t C (pop covar)") 477 "\\`I' + \\`t S' (pop std dev), \\`t C' (pop covar)")
472 "inverse" nil)) 478 "inverse" nil))
473 479
474(defun calc-hyperbolic-prefix-help () 480(defun calc-hyperbolic-prefix-help ()
475 (interactive) 481 (interactive)
476 (calc-do-prefix-help 482 (calc-do-prefix-help
477 '("H + S (sinh), C (cosh), T (tanh); E (exp10), L (log10)" 483 '("\\`H' + \\`S' (sinh), \\`C' (cosh), \\`T' (tanh); \\`E' (exp10), \\`L' (log10)"
478 "H + F (float floor), R (float round); P (constant \"e\")" 484 "\\`H' + \\`F' (float floor), \\`R' (float round); \\`P' (constant \"e\")"
479 "H + a d (total derivative); k c (permutations)" 485 "\\`H' + \\`a d' (total derivative); \\`k c' (permutations)"
480 "H + k b (bern-poly), k e (euler-poly); k s (stirling-2)" 486 "\\`H' + \\`k b' (bern-poly), \\`k e' (euler-poly); \\`k s' (stirling-2)"
481 "H + f G (gamma-g), f B (beta-B); v h (rhead), v k (rcons)" 487 "\\`H' + \\`f G' (gamma-g), \\`f B' (beta-B); \\`v h' (rhead), \\`v k' (rcons)"
482 "H + v e (expand w/filler); V H (weighted histogram)" 488 "\\`H' + \\`v e' (expand w/filler); \\`V H' (weighted histogram)"
483 "H + a S (general solve eqn), j I (general isolate)" 489 "\\`H' + \\`a S' (general solve eqn), \\`j I' (general isolate)"
484 "H + a R (widen/root), a N (widen/min), a X (widen/max)" 490 "\\`H' + \\`a R' (widen/root), \\`a N' (widen/min), \\`a X' (widen/max)"
485 "H + t M (median), t S (variance), t C (correlation coef)" 491 "\\`H' + \\`t M' (median), \\`t S' (variance), \\`t C' (correlation coef)"
486 "H + c f/F/c (pervasive float/frac/clean)") 492 "\\`H' + \\`c' \\`f'/\\`F'/\\`c' (pervasive float/frac/clean)")
487 "hyperbolic" nil)) 493 "hyperbolic" nil))
488 494
489(defun calc-inv-hyp-prefix-help () 495(defun calc-inv-hyp-prefix-help ()
490 (interactive) 496 (interactive)
491 (calc-do-prefix-help 497 (calc-do-prefix-help
492 '("I H + S (arcsinh), C (arccosh), T (arctanh)" 498 '("\\`I H' + \\`S' (arcsinh), \\`C' (arccosh), \\`T' (arctanh)"
493 "I H + E (log10), L (exp10); f G (gamma-G)" 499 "\\`I H' + \\`E' (log10), \\`L' (exp10); \\`f G' (gamma-G)"
494 "I H + F (float ceiling), R (float truncate)" 500 "\\`I H' + \\`F' (float ceiling), \\`R' (float truncate)"
495 "I H + t S (pop variance)" 501 "\\`I H' + \\`t S' (pop variance)"
496 "I H + a S (general invert func); v h (rtail)") 502 "\\`I H' + \\`a S' (general invert func); \\`v h' (rtail)")
497 "inverse-hyperbolic" nil)) 503 "inverse-hyperbolic" nil))
498 504
499(defun calc-option-prefix-help () 505(defun calc-option-prefix-help ()
@@ -505,10 +511,10 @@
505(defun calc-f-prefix-help () 511(defun calc-f-prefix-help ()
506 (interactive) 512 (interactive)
507 (calc-do-prefix-help 513 (calc-do-prefix-help
508 '("miN, maX; Hypot; Im, Re; Sign; [, ] (incr/decr)" 514 '("mi\\`n', ma\\`x'; \\`h'ypot; \\`i'm, \\`r'e; \\`s'ign; \\`[', \\`]' (incr/decr)"
509 "Gamma, Beta, Erf, besselJ, besselY" 515 "\\`g'amma, \\`b'eta, \\`e'rf, bessel\\`j', bessel\\`y'"
510 "SHIFT + int-sQrt; Int-log, Exp(x)-1, Ln(x+1); arcTan2" 516 "int-s\\`Q'rt; \\`I'nt-log, \\`E'xp(x)-1, \\`L'n(x+1); arc\\`T'an2"
511 "SHIFT + Abssqr; Mantissa, eXponent, Scale" 517 "\\`A'bssqr; \\`M'antissa, e\\`X'ponent, \\`S'cale"
512 "SHIFT + incomplete: Gamma-P, Beta-I") 518 "SHIFT + incomplete: Gamma-P, Beta-I")
513 "functions" ?f)) 519 "functions" ?f))
514 520
@@ -516,165 +522,165 @@
516(defun calc-s-prefix-help () 522(defun calc-s-prefix-help ()
517 (interactive) 523 (interactive)
518 (calc-do-prefix-help 524 (calc-do-prefix-help
519 '("Store, inTo, Xchg, Unstore; Recall, 0-9; : (:=); = (=>)" 525 '("\\`s'tore, in\\`t'o, \\`x'chg, \\`u'nstore; \\`r'ecall, \\`0'-\\`9'; \\`:' (:=); \\`=' (=>)"
520 "Let; Copy, K=copy constant; Declare; Insert, Perm; Edit" 526 "\\`l'et; \\`c'opy, \\`k'=copy constant; \\`d'eclare; \\`i'nsert, \\`p'erm; \\`e'dit"
521 "Negate, +, -, *, /, ^, &, |, [, ]; Map" 527 "\\`n'egate, \\`+', \\`-', \\`*', \\`/', \\`^', \\`&', \\`|', \\`[', \\`]'; Map"
522 "SHIFT + Decls, GenCount, TimeZone, Holidays; IntegLimit" 528 "\\`D'ecls, \\`G'enCount, \\`T'imeZone, \\`H'olidays; \\`I'ntegLimit"
523 "SHIFT + LineStyles, PointStyles, plotRejects; Units" 529 "\\`L'ineStyles, \\`P'ointStyles, plot\\`R'ejects; \\`U'nits"
524 "SHIFT + Eval-, AlgSimp-, ExtSimp-, FitRules") 530 "\\`E'val-, \\`A'lgSimp-, e\\`X'tSimp-, \\`F'itRules")
525 "store" ?s)) 531 "store" ?s))
526 532
527(defun calc-r-prefix-help () 533(defun calc-r-prefix-help ()
528 (interactive) 534 (interactive)
529 (calc-do-prefix-help 535 (calc-do-prefix-help
530 '("digits 0-9: recall, same as `s r 0-9'" 536 '("digits \\`0'-\\`9': recall, same as \\`s r' \\`0'-\\`9'"
531 "Save to register, Insert from register") 537 "\\`s'ave to register, \\`i'nsert from register")
532 "recall/register" ?r)) 538 "recall/register" ?r))
533 539
534 540
535(defun calc-j-prefix-help () 541(defun calc-j-prefix-help ()
536 (interactive) 542 (interactive)
537 (calc-do-prefix-help 543 (calc-do-prefix-help
538 '("Select, Additional, Once; eVal, Formula; Rewrite" 544 '("\\`s'elect, \\`a'dditional, \\`o'nce; e\\`v'al, \\`f'ormula; \\`r'ewrite"
539 "More, Less, 1-9, Next, Previous" 545 "\\`m'ore, \\`l'ess, \\`1'-\\`9', \\`n'ext, \\`p'revious"
540 "Unselect, Clear; Display; Enable; Breakable" 546 "\\`u'nselect, \\`c'lear; \\`d'isplay; \\`e'nable; \\`b'reakable"
541 "\\=' (replace), \\=` (edit), +, -, *, /, RET (grab), DEL" 547 "\\=' (replace), \\=` (edit), \\`+', \\`-', \\`*', \\`/', \\`RET' (grab), \\`DEL'"
542 "SHIFT + swap: Left, Right; maybe: Select, Once" 548 "swap: \\`L'eft, \\`R'ight; maybe: \\`S'elect, \\`O'nce"
543 "SHIFT + Commute, Merge, Distrib, jump-Eqn, Isolate" 549 "\\`C'ommute, \\`M'erge, \\`D'istrib, jump-\\`E'qn, \\`I'solate"
544 "SHIFT + Negate, & (invert); Unpack") 550 "\\`N'egate, \\`&' (invert); \\`U'npack")
545 "select" ?j)) 551 "select" ?j))
546 552
547 553
548(defun calc-a-prefix-help () 554(defun calc-a-prefix-help ()
549 (interactive) 555 (interactive)
550 (calc-do-prefix-help 556 (calc-do-prefix-help
551 '("Simplify, Extended-simplify, eVal; \" (exp-formula)" 557 '("\\`s'implify, \\`e'xtended-simplify, e\\`v'al; \\`\"' (exp-formula)"
552 "eXpand, Collect, Factor, Apart, Norm-rat" 558 "e\\`x'pand, \\`c'ollect, \\`f'actor, \\`a'part, \\`n'orm-rat"
553 "GCD, /, \\, % (polys); Polint" 559 "\\`g' (GCD), \\`/', \\`\\', \\`%' (polys); \\`p'olint"
554 "Derivative, Integral, Taylor; _ (subscr)" 560 "\\`d'erivative, \\`i'ntegral, \\`t'aylor; \\`_' (subscr)"
555 "suBstitute; Rewrite, Match" 561 "su\\`b'stitute; \\`r'ewrite, \\`m'atch"
556 "SHIFT + Solve; Root, miN, maX; Poly-roots; Fit" 562 "\\`S'olve; \\`R'oot, mi\\`N', ma\\`X'; \\`P'oly-roots; \\`F'it"
557 "SHIFT + Map; Tabulate, + (sum), * (prod); num-Integ" 563 "\\`M'ap; \\`T'abulate, \\`+' (sum), \\`*' (prod); num-\\`I'nteg"
558 "relations: =, # (not =), <, >, [ (< or =), ] (> or =)" 564 "relations: \\`=', \\`#' (not =), \\`<', \\`>', \\`[' (< or =), \\`]' (> or =)"
559 "logical: & (and), | (or), ! (not); : (if)" 565 "logical: \\`&' (and), \\`|' (or), \\`!' (not); \\`:' (if)"
560 "misc: { (in-set); . (rmeq)") 566 "misc: \\`{' (in-set); \\`.' (rmeq)")
561 "algebra" ?a)) 567 "algebra" ?a))
562 568
563 569
564(defun calc-b-prefix-help () 570(defun calc-b-prefix-help ()
565 (interactive) 571 (interactive)
566 (calc-do-prefix-help 572 (calc-do-prefix-help
567 '("And, Or, Xor, Diff, Not; Wordsize, Clip" 573 '("\\`a'nd, \\`o'r, \\`x'or, \\`d'iff, \\`n'ot; \\`w'ordsize, \\`c'lip"
568 "Lshift, Rshift, roTate; SHIFT + signed Lshift, Rshift" 574 "\\`l'shift, \\`r'shift, ro\\`t'ate; signed \\`L'shift, \\`R'shift"
569 "SHIFT + business: Pv, Npv, Fv, pMt, #pmts, raTe, Irr" 575 "business: \\`P'v, \\`N'pv, \\`F'v, p\\`M't, \\`#'pmts, ra\\`T'e, \\`I'rr"
570 "SHIFT + business: Sln, sYd, Ddb; %ch") 576 "business: \\`S'ln, s\\`Y'd, \\`D'db; \\`%'ch")
571 "binary/bus" ?b)) 577 "binary/bus" ?b))
572 578
573 579
574(defun calc-c-prefix-help () 580(defun calc-c-prefix-help ()
575 (interactive) 581 (interactive)
576 (calc-do-prefix-help 582 (calc-do-prefix-help
577 '("Deg, Rad, HMS; Float; Polar/rect; Clean, 0-9; %" 583 '("\\`d'eg, \\`r'ad, \\`h'ms; \\`f'loat; \\`p'olar/rect; \\`c'lean, \\`0'-\\`9'; \\`%'"
578 "SHIFT + Fraction") 584 "\\`F'raction")
579 "convert" ?c)) 585 "convert" ?c))
580 586
581 587
582(defun calc-d-prefix-help () 588(defun calc-d-prefix-help ()
583 (interactive) 589 (interactive)
584 (calc-do-prefix-help 590 (calc-do-prefix-help
585 '("Group, \",\"; Normal, Fix, Sci, Eng, \".\"; Over" 591 '("\\`g'roup, \\`,'; \\`n'ormal, \\`f'ix, \\`s'ci, \\`e'ng, \\`.'; \\`o'ver"
586 "Radix, Zeros, 2, 8, 0, 6; Hms; Date; Complex, I, J" 592 "\\`r'adix, \\`z'eros, \\`2', \\`8', \\`0', \\`6'; \\`h'ms; \\`d'ate; \\`c'omplex, \\`i', \\`j'"
587 "Why; Line-nums, line-Breaks; <, =, > (justify); Plain" 593 "\\`w'hy; \\`l'ine-nums, line-\\`b'reaks; \\`<', \\`=', \\`>' (justify); \\`p'lain"
588 "\" (strings); Truncate, [, ]; SPC (refresh), RET, @" 594 "\\`\"' (strings); \\`t'runcate, \\`[', \\`]'; \\`SPC' (refresh), \\`RET', \\`@'"
589 "SHIFT + language: Normal, One-line, Big, Unformatted" 595 "language: \\`N'ormal, \\`O'ne-line, \\`B'ig, \\`U'nformatted"
590 "SHIFT + language: C, Pascal, Fortran; TeX, LaTeX, Eqn" 596 "language: \\`C', \\`P'ascal, \\`F'ortran; \\`T'eX, \\`L'aTeX, \\`E'qn"
591 "SHIFT + language: Yacas, X=Maxima, A=Giac" 597 "language: \\`Y'acas, \\`X'=Maxima, \\`A'=Giac"
592 "SHIFT + language: Mathematica, W=Maple") 598 "language: \\`M'athematica, \\`W'=Maple")
593 "display" ?d)) 599 "display" ?d))
594 600
595 601
596(defun calc-g-prefix-help () 602(defun calc-g-prefix-help ()
597 (interactive) 603 (interactive)
598 (calc-do-prefix-help 604 (calc-do-prefix-help
599 '("Fast; Add, Delete, Juggle; Plot, Clear; Quit" 605 '("\\`f'ast; \\`a'dd, \\`d'elete, \\`j'uggle; \\`p'lot, \\`c'lear; \\`q'uit"
600 "Header, Name, Grid, Border, Key; View-commands, X-display" 606 "\\`h'eader, \\`n'ame, \\`g'rid, \\`b'order, \\`k'ey; \\`v'iew-commands, \\`x'-display"
601 "x-axis: Range, Title, Log, Zero; lineStyle" 607 "x-axis: \\`r'ange, \\`t'itle, \\`l'og, \\`z'ero; line\\`s'tyle"
602 "SHIFT + y-axis: Range, Title, Log, Zero; pointStyle" 608 "y-axis: \\`R'ange, \\`T'itle, \\`L'og, \\`Z'ero; point\\`S'tyle"
603 "SHIFT + Print; Device, Output-file; X-geometry" 609 "\\`P'rint; \\`D'evice, \\`O'utput-file; \\`X'-geometry"
604 "SHIFT + Num-pts; Command, Kill, View-trail" 610 "\\`N'um-pts; \\`C'ommand, \\`K'ill, \\`V'iew-trail"
605 "SHIFT + 3d: Fast, Add; CTRL + z-axis: Range, Title, Log") 611 "3d: \\`F'ast, \\`A'dd; z-axis: \\`C-r' (range), \\`C-t' (title), \\`C-l' (log)")
606 "graph" ?g)) 612 "graph" ?g))
607 613
608 614
609(defun calc-k-prefix-help () 615(defun calc-k-prefix-help ()
610 (interactive) 616 (interactive)
611 (calc-do-prefix-help 617 (calc-do-prefix-help
612 '("GCD, LCM; Choose (binomial), Double-factorial" 618 '("\\`g' (GCD), \\`l' (LCM); \\`c'hoose (binomial), \\`d'ouble-factorial"
613 "Random, random-Again, sHuffle" 619 "\\`r'andom, random-\\`a'gain, s\\`h'uffle"
614 "Factors, Prime-test, Next-prime, Totient, Moebius" 620 "\\`f'actors, \\`p'rime-test, \\`n'ext-prime, \\`t'otient, \\`m'oebius"
615 "Bernoulli, Euler, Stirling" 621 "\\`b'ernoulli, \\`e'uler, \\`s'tirling"
616 "SHIFT + Extended-gcd" 622 "\\`E'xtended-gcd"
617 "SHIFT + dists: Binomial, Chi-square, F, Normal" 623 "dists: \\`B'inomial, \\`C'hi-square, \\`F', \\`N'ormal"
618 "SHIFT + dists: Poisson, student's-T") 624 "dists: \\`P'oisson, student\\='s-\\`T'")
619 "combinatorics" ?k)) 625 "combinatorics" ?k))
620 626
621 627
622(defun calc-m-prefix-help () 628(defun calc-m-prefix-help ()
623 (interactive) 629 (interactive)
624 (calc-do-prefix-help 630 (calc-do-prefix-help
625 '("Deg, Rad, HMS; Frac; Polar; Inf; Alg, Total; Symb; Vec/mat" 631 '("\\`d'eg, \\`r'ad, \\`h' (HMS); \\`f'rac; \\`p'olar; \\`i'nf; \\`a'lg, \\`t'otal; \\`s'ymb; \\`v'ec/mat"
626 "Working; Xtensions; Mode-save; preserve Embedded modes" 632 "\\`w'orking; \\`x'tensions; \\`m'ode-save; preserve \\`e'mbedded modes"
627 "SHIFT + Shifted-prefixes, mode-Filename; Record; reCompute" 633 "\\`S'hifted-prefixes, mode-\\`F'ilename; \\`R'ecord; re\\`C'ompute"
628 "SHIFT + simplify: Off, Num, basIc, Algebraic, Bin, Ext, Units") 634 "simplify: \\`O'ff, \\`N'um, bas\\`I'c, \\`A'lgebraic, \\`B'in, \\`E'xt, \\`U'nits")
629 "mode" ?m)) 635 "mode" ?m))
630 636
631 637
632(defun calc-t-prefix-help () 638(defun calc-t-prefix-help ()
633 (interactive) 639 (interactive)
634 (calc-do-prefix-help 640 (calc-do-prefix-help
635 '("Display; Fwd, Back; Next, Prev, Here, [, ]; Yank" 641 '("\\`d'isplay; \\`f'wd, \\`b'ack; \\`n'ext, \\`p'rev, \\`h'ere, \\`[', \\`]'; \\`y'ank"
636 "Search, Rev; In, Out; <, >; Kill; Marker; . (abbrev)" 642 "\\`s'earch, \\`r'ev; \\`i'n, \\`o'ut; \\`<', \\`>'; \\`k'ill; \\`m'arker; \\`.' (abbrev)"
637 "SHIFT + time: Now; Part; Date, Julian, Unix, Czone" 643 "time: \\`N'ow; \\`P'art; \\`D'ate, \\`J'ulian, \\`U'nix, \\`C'zone"
638 "SHIFT + time: newWeek, newMonth, newYear; Incmonth" 644 "time: new\\`W'eek, new\\`M'onth, new\\`Y'ear; \\`I'ncmonth"
639 "SHIFT + time: +, - (business days)" 645 "time: \\`+', \\`-' (business days)"
640 "digits 0-9: store-to, same as `s t 0-9'") 646 "digits \\`0'-\\`9': store-to, same as \\`s t' \\`0'-\\`9'")
641 "trail/time" ?t)) 647 "trail/time" ?t))
642 648
643 649
644(defun calc-u-prefix-help () 650(defun calc-u-prefix-help ()
645 (interactive) 651 (interactive)
646 (calc-do-prefix-help 652 (calc-do-prefix-help
647 '("Simplify, Convert, coNvert exact, Temperature-convert, Base-units" 653 '("\\`s'implify, \\`c'onvert, co\\`n'vert exact, \\`t'emperature-convert, \\`b'ase-units"
648 "Autorange; Remove, eXtract; Explain; View-table; 0-9" 654 "\\`a'utorange; \\`r'emove, e\\`x'tract; \\`e'xplain; \\`v'iew-table; \\`0'-\\`9'"
649 "Define, Undefine, Get-defn, Permanent" 655 "\\`d'efine, \\`u'ndefine, \\`g'et-defn, \\`p'ermanent"
650 "SHIFT + View-table-other-window" 656 "\\`V'iew-table-other-window"
651 "SHIFT + stat: Mean, G-mean, Std-dev, Covar, maX, miN" 657 "stat: \\`M'ean, \\`G'-mean, \\`S'td-dev, \\`C'ovar, ma\\`X', mi\\`N'"
652 "SHIFT + stat: + (sum), - (asum), * (prod), # (count)") 658 "stat: \\`+' (sum), \\`-' (asum), \\`*' (prod), \\`#' (count)")
653 "units/stat" ?u)) 659 "units/stat" ?u))
654 660
655(defun calc-l-prefix-help () 661(defun calc-l-prefix-help ()
656 (interactive) 662 (interactive)
657 (calc-do-prefix-help 663 (calc-do-prefix-help
658 '("Quantity, DB level, Np level" 664 '("\\`q'uantity, \\`d' (DB level), \\`n' (NP level)"
659 "+, -, *, /" 665 "\\`+', \\`-', \\`*', \\`/'"
660 "Scientific pitch notation, Midi number, Frequency" 666 "\\`s'cientific pitch notation, \\`m'idi number, \\`f'requency"
661 ) 667 )
662 "log units" ?l)) 668 "log units" ?l))
663 669
664(defun calc-v-prefix-help () 670(defun calc-v-prefix-help ()
665 (interactive) 671 (interactive)
666 (calc-do-prefix-help 672 (calc-do-prefix-help
667 '("Pack, Unpack, Identity, Diagonal, indeX, Build" 673 '("\\`p'ack, \\`u'npack, \\`i'dentity, \\`d'iagonal, inde\\`x', \\`b'uild"
668 "Row, Column, Subvector; Length; Find; Mask, Expand" 674 "\\`r'ow, \\`c'olumn, \\`s'ubvector; \\`l'ength; \\`f'ind; \\`m'ask, \\`e'xpand"
669 "Transpose, Arrange, reVerse; Head, Kons; rNorm" 675 "\\`t'ranspose, \\`a'rrange, re\\`v'erse; \\`h'ead, \\`k'ons; r\\`n'orm"
670 "SHIFT + Det, & (inverse), LUD, Trace, conJtrn, Cross" 676 "\\`D'et, \\`&' (inverse), \\`L'UD, \\`T'race, con\\`J'trn, \\`C'ross"
671 "SHIFT + Sort, Grade, Histogram; cNorm" 677 "\\`S'ort, \\`G'rade, \\`H'istogram; c\\`N'orm"
672 "SHIFT + Apply, Map, Reduce, accUm, Inner-, Outer-prod" 678 "\\`A'pply, \\`M'ap, \\`R'educe, acc\\`U'm, \\`I'nner-, \\`O'uter-prod"
673 "SHIFT + sets: V (union), ^ (intersection), - (diff)" 679 "sets: \\`V' (union), \\`^' (intersection), \\`-' (diff)"
674 "SHIFT + sets: Xor, ~ (complement), Floor, Enum" 680 "sets: \\`X'or, \\`~' (complement), \\`F'loor, \\`E'num"
675 "SHIFT + sets: : (span), # (card), + (rdup)" 681 "sets: \\`:' (span), \\`#' (card), \\`+' (rdup)"
676 "<, =, > (justification); , (commas); [, {, ( (brackets)" 682 "\\`<', \\`=', \\`>' (justification); \\`,' (commas); \\`[', \\`{', \\`(' (brackets)"
677 "} (matrix brackets); . (abbreviate); / (multi-lines)") 683 "\\`}' (matrix brackets); \\`.' (abbreviate); \\`/' (multi-lines)")
678 "vec/mat" ?v)) 684 "vec/mat" ?v))
679 685
680(provide 'calc-help) 686(provide 'calc-help)
diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el
index 613fb0a0154..93de04a586d 100644
--- a/lisp/calc/calc-misc.el
+++ b/lisp/calc/calc-misc.el
@@ -114,8 +114,11 @@ Calc user interface as before (either \\`C-x * C' or \\`C-x * K'; initially \\`C
114 (let (key) 114 (let (key)
115 (select-window win) 115 (select-window win)
116 (while (progn 116 (while (progn
117 (message "Calc options: Calc, Keypad, ... %s" 117 (message
118 "press SPC, DEL to scroll, C-g to cancel") 118 (substitute-command-keys
119 (concat
120 "Calc options: \\`c'alc, \\`k'eypad, ... "
121 "press \\`SPC', \\`DEL' to scroll, \\`C-g' to cancel")))
119 (memq (setq key (read-event)) 122 (memq (setq key (read-event))
120 '(? ?\C-h ?\C-? ?\C-v ?\M-v))) 123 '(? ?\C-h ?\C-? ?\C-v ?\M-v)))
121 (condition-case nil 124 (condition-case nil
@@ -216,27 +219,26 @@ Calc user interface as before (either \\`C-x * C' or \\`C-x * K'; initially \\`C
216(defun calc-help () 219(defun calc-help ()
217 (interactive) 220 (interactive)
218 (let ((msgs 221 (let ((msgs
219 ;; FIXME: Change these to `substitute-command-keys' syntax.
220 (mapcar #'substitute-command-keys 222 (mapcar #'substitute-command-keys
221 '("Press \\`h' for complete help; press \\`?' repeatedly for a summary" 223 '("Press \\`h' for complete help; press \\`?' repeatedly for a summary"
222 "Letter keys: Negate; Precision; Yank; Why; Xtended cmd; Quit" 224 "Letter keys: \\`n'egate; \\`p'recision; \\`y'ank; \\`w'hy; \\`x'tended cmd; \\`q'uit"
223 "Letter keys: SHIFT + Undo, reDo; Inverse, Hyperbolic, Option" 225 "Letter keys: \\`U'ndo, re\\`D'o; \\`I'nverse, \\`H'yperbolic, \\`O'ption"
224 "Letter keys: SHIFT + sQrt; Sin, Cos, Tan; Exp, Ln, logB" 226 "Letter keys: s\\`Q'rt; \\`S'in, \\`C'os, \\`T'an; \\`E'xp, \\`L'n, log\\`B'"
225 "Letter keys: SHIFT + Floor, Round; Abs, conJ, arG; Pi" 227 "Letter keys: \\`F'loor, \\`R'ound; \\`A'bs, con\\`J', ar\\`G'; \\`P'i"
226 "Letter keys: SHIFT + Num-eval; More-recn; eXec-kbd-macro; Keep-args" 228 "Letter keys: \\`N'um-eval; \\`M'ore-recn; e\\`X'ec-kbd-macro; \\`K'eep-args"
227 "Other keys: +, -, *, /, ^, \\ (int div), : (frac div)" 229 "Other keys: \\`+', \\`-', \\`*', \\`/', \\`^', \\`\\' (int div), \\`:' (frac div)"
228 "Other keys: & (1/x), | (concat), % (modulo), ! (factorial)" 230 "Other keys: \\`&' (1/x), \\`|' (concat), \\`%' (modulo), \\`!' (factorial)"
229 "Other keys: \\=' (alg-entry), = (eval), \\=` (edit); M-RET (last-args)" 231 "Other keys: \\=' (alg-entry), \\`=' (eval), \\=` (edit); \\`M-RET' (last-args)"
230 "Other keys: \\`SPC'/\\`RET' (enter/dup), LFD (over); < > (scroll horiz)" 232 "Other keys: \\`SPC'/\\`RET' (enter/dup), \\`LFD' (over); \\`<' \\`>' (scroll horiz)"
231 "Other keys: \\`DEL' (drop), \\`M-DEL' (drop-above); { } (scroll vert)" 233 "Other keys: \\`DEL' (drop), \\`M-DEL' (drop-above); \\`{' \\`}' (scroll vert)"
232 "Other keys: \\`TAB' (swap/roll-dn), \\`M-TAB' (roll-up)" 234 "Other keys: \\`TAB' (swap/roll-dn), \\`M-TAB' (roll-up)"
233 "Other keys: [ , ; ] (vector), ( , ) (complex), ( ; ) (polar)" 235 "Other keys: \\`[' \\`,' \\`;' \\`]' (vector), \\`(' \\`,' \\`)' (complex), \\`(' \\`;' \\`)' (polar)"
234 "Prefix keys: Algebra, Binary/business, Convert, Display" 236 "Prefix keys: \\`a'lgebra, \\`b'inary/business, \\`c'onvert, \\`d'isplay"
235 "Prefix keys: Functions, Graphics, Help, J (select)" 237 "Prefix keys: \\`f'unctions, \\`g'raphics, \\`h'elp, \\`j' (select)"
236 "Prefix keys: Kombinatorics/statistics, Modes, Store/recall" 238 "Prefix keys: \\`k'ombinatorics/statistics, \\`m'odes, \\`s'tore/recall"
237 "Prefix keys: Trail/time, Units/statistics, Vector/matrix" 239 "Prefix keys: \\`t'rail/time, \\`u'nits/statistics, \\`v'ector/matrix"
238 "Prefix keys: Z (user), SHIFT + Z (define)" 240 "Prefix keys: \\`z' (user), \\`Z' (define)"
239 "Prefix keys: prefix + ? gives further help for that prefix" 241 "Prefix keys: prefix + \\`?' gives further help for that prefix"
240 " Calc by Dave Gillespie, daveg@synaptics.com")))) 242 " Calc by Dave Gillespie, daveg@synaptics.com"))))
241 (if calc-full-help-flag 243 (if calc-full-help-flag
242 msgs 244 msgs
@@ -260,7 +262,7 @@ Calc user interface as before (either \\`C-x * C' or \\`C-x * K'; initially \\`C
260 msgs)) 262 msgs))
261 (length msg)) 263 (length msg))
262 ?\ ) 264 ?\ )
263 " [?=MORE]") 265 (substitute-command-keys " [\\`?'=MORE]"))
264 "")))))))) 266 ""))))))))
265 267
266 268
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 39e54c89e06..26556bf056a 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -1188,8 +1188,12 @@ Used by `calc-user-invocation'.")
1188 "Start the Calculator." 1188 "Start the Calculator."
1189 (let ((key (calc-read-key-sequence 1189 (let ((key (calc-read-key-sequence
1190 (if calc-dispatch-help 1190 (if calc-dispatch-help
1191 "Calc options: Calc, Keypad, Quick, Embed; eXit; Info, Tutorial; Grab; ?=more" 1191 (substitute-command-keys
1192 (format "%s (Type ? for a list of Calc options)" 1192 (concat
1193 "Calc options: \\`c'alc, \\`k'eypad, \\`q'uick, \\`e'mbed; "
1194 "e\\`x'it; \\`i'nfo, \\`t'utorial; \\`g'rab; \\`?'=more"))
1195 (format (substitute-command-keys
1196 "%s (Type \\`?' for a list of Calc options)")
1193 (key-description (this-command-keys)))) 1197 (key-description (this-command-keys))))
1194 calc-dispatch-map))) 1198 calc-dispatch-map)))
1195 (setq key (lookup-key calc-dispatch-map key)) 1199 (setq key (lookup-key calc-dispatch-map key))