calc-help.el 24.4 KB
Newer Older
1 2
;;; calc-help.el --- help display functions for Calc,

3
;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004, 2005,
4
;;   2006, 2007, 2008, 2009, 2010, 2011  Free Software Foundation, Inc.
5 6

;; Author: David Gillespie <daveg@synaptics.com>
Jay Belanger's avatar
Jay Belanger committed
7
;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
Eli Zaretskii's avatar
Eli Zaretskii committed
8 9 10

;; This file is part of GNU Emacs.

11
;; GNU Emacs is free software: you can redistribute it and/or modify
12
;; it under the terms of the GNU General Public License as published by
13 14
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
15

Eli Zaretskii's avatar
Eli Zaretskii committed
16
;; GNU Emacs is distributed in the hope that it will be useful,
17 18 19 20 21
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
22
;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
Eli Zaretskii's avatar
Eli Zaretskii committed
23

24
;;; Commentary:
Eli Zaretskii's avatar
Eli Zaretskii committed
25

26
;;; Code:
Eli Zaretskii's avatar
Eli Zaretskii committed
27 28 29

;; This file is autoloaded from calc-ext.el.

Jay Belanger's avatar
Jay Belanger committed
30
(require 'calc-ext)
Eli Zaretskii's avatar
Eli Zaretskii committed
31 32
(require 'calc-macs)

33 34 35 36 37
;; Declare functions which are defined elsewhere.
(declare-function Info-goto-node "info" (nodename &optional fork))
(declare-function Info-last "info" ())


Eli Zaretskii's avatar
Eli Zaretskii committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51
(defun calc-help-prefix (arg)
  "This key is the prefix for Calc help functions.  See calc-help-for-help."
  (interactive "P")
  (or calc-dispatch-help (sit-for echo-keystrokes))
  (let ((key (calc-read-key-sequence
	      (if calc-dispatch-help
		  "Calc Help options: Help, Info, Tutorial, Summary; Key, Function; ?=more"
		(format "%s  (Type ? for a list of Calc Help options)"
			(key-description (this-command-keys))))
	      calc-help-map)))
    (setq key (lookup-key calc-help-map key))
    (message "")
    (if key
	(call-interactively key)
52
      (beep))))
Eli Zaretskii's avatar
Eli Zaretskii committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91

(defun calc-help-for-help (arg)
  "You have typed `h', the Calc help character.  Type a Help option:

B  calc-describe-bindings.  Display a table of all key bindings.
H  calc-full-help.  Display all `?' key messages at once.

I  calc-info.  Read the Calc manual using the Info system.
T  calc-tutorial.  Read the Calc tutorial using the Info system.
S  calc-info-summary.  Read the Calc summary using the Info system.

C  calc-describe-key-briefly.  Look up the command name for a given key.
K  calc-describe-key.  Look up a key's documentation in the manual.
F  calc-describe-function.  Look up a function's documentation in the manual.
V  calc-describe-variable.  Look up a variable's documentation in the manual.

N  calc-view-news.  Display Calc history of changes.

C-c  Describe conditions for copying Calc.
C-d  Describe how you can get a new copy of Calc or report a bug.
C-w  Describe how there is no warranty for Calc."
  (interactive "P")
  (if calc-dispatch-help
      (let (key)
	(save-window-excursion
	  (describe-function 'calc-help-for-help)
	  (select-window (get-buffer-window "*Help*"))
	  (while (progn
		   (message "Calc Help options: Help, Info, ...  press SPC, DEL to scroll, C-g to cancel")
		   (memq (car (setq key (calc-read-key t)))
			 '(?  ?\C-h ?\C-? ?\C-v ?\M-v)))
	    (condition-case err
		(if (memq (car key) '(?  ?\C-v))
		    (scroll-up)
		  (scroll-down))
	      (error (beep)))))
	(calc-unread-command (cdr key))
	(calc-help-prefix nil))
    (let ((calc-dispatch-help t))
92
      (calc-help-prefix arg))))
Eli Zaretskii's avatar
Eli Zaretskii committed
93 94 95

(defun calc-describe-copying ()
  (interactive)
96
  (calc-info-goto-node "Copying"))
Eli Zaretskii's avatar
Eli Zaretskii committed
97 98 99

(defun calc-describe-distribution ()
  (interactive)
100
  (calc-info-goto-node "Reporting Bugs"))
Eli Zaretskii's avatar
Eli Zaretskii committed
101 102 103

(defun calc-describe-no-warranty ()
  (interactive)
104
  (calc-info-goto-node "Copying")
Eli Zaretskii's avatar
Eli Zaretskii committed
105 106 107
  (let ((case-fold-search nil))
    (search-forward "     NO WARRANTY"))
  (beginning-of-line)
108
  (recenter 0))
Eli Zaretskii's avatar
Eli Zaretskii committed
109 110 111 112

(defun calc-describe-bindings ()
  (interactive)
  (describe-bindings)
113
  (with-current-buffer "*Help*"
114
    (let ((inhibit-read-only t))
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
      (goto-char (point-min))
      (when (search-forward "Major Mode Bindings:" nil t)
        (delete-region (point-min) (point))
        (insert "Calc Mode Bindings:"))
      (when (search-forward "Global bindings:" nil t)
        (forward-line -1)
        (delete-region (point) (point-max)))
      (goto-char (point-min))
      (while
          (re-search-forward
           "\n[a-z] [0-9]\\( .*\n\\)\\([a-z] [0-9]\\1\\)*[a-z] \\([0-9]\\)\\1"
           nil t)
        (let ((dig1 (char-after (1- (match-beginning 1))))
              (dig2 (char-after (match-beginning 3))))
          (delete-region (match-end 1) (match-end 0))
          (goto-char (match-beginning 1))
131
          (delete-char -1)
132 133 134
          (delete-char 5)
          (insert (format "%c .. %c" (min dig1 dig2) (max dig1 dig2)))))
      (goto-char (point-min)))))
Eli Zaretskii's avatar
Eli Zaretskii committed
135 136 137

(defun calc-describe-key-briefly (key)
  (interactive "kDescribe key briefly: ")
138
  (calc-describe-key key t))
Eli Zaretskii's avatar
Eli Zaretskii committed
139

Jay Belanger's avatar
Jay Belanger committed
140 141
(defvar Info-history)

Eli Zaretskii's avatar
Eli Zaretskii committed
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
(defun calc-describe-key (key &optional briefly)
  (interactive "kDescribe key: ")
  (let ((defn (if (eq (key-binding key) 'calc-dispatch)
		  (let ((key2 (calc-read-key-sequence
			       (format "Describe key briefly: %s-"
				       (key-description key))
			       calc-dispatch-map)))
		    (setq key (concat key key2))
		    (lookup-key calc-dispatch-map key2))
		(if (eq (key-binding key) 'calc-help-prefix)
		    (let ((key2 (calc-read-key-sequence
				 (format "Describe key briefly: %s-"
					 (key-description key))
				 calc-help-map)))
		      (setq key (concat key key2))
		      (lookup-key calc-help-map key2))
		  (key-binding key))))
	(inv nil)
Jay Belanger's avatar
Jay Belanger committed
160 161
	(hyp nil)
        calc-summary-indentation)
Eli Zaretskii's avatar
Eli Zaretskii committed
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
    (while (or (equal key "I") (equal key "H"))
      (if (equal key "I")
	  (setq inv (not inv))
	(setq hyp (not hyp)))
      (setq key (read-key-sequence (format "Describe key%s:%s%s "
					   (if briefly " briefly" "")
					   (if inv " I" "")
					   (if hyp " H" "")))
	    defn (key-binding key)))
    (let ((desc (key-description key))
	  target)
      (if (string-match "^ESC " desc)
	  (setq desc (concat "M-" (substring desc 4))))
      (while (string-match "^M-# \\(ESC \\|C-\\)" desc)
	(setq desc (concat "M-# " (substring desc (match-end 0)))))
177 178
      (if (string-match "\\(DEL\\|\\LFD\\|RET\\|SPC\\|TAB\\)" desc)
          (setq desc (replace-match "<\\&>" nil nil desc)))
Eli Zaretskii's avatar
Eli Zaretskii committed
179
      (if briefly
180
	  (let ((msg (with-current-buffer (get-buffer-create "*Calc Summary*")
Eli Zaretskii's avatar
Eli Zaretskii committed
181 182 183
		       (if (= (buffer-size) 0)
			   (progn
			     (message "Reading Calc summary from manual...")
184 185 186 187 188 189 190 191 192
                             (require 'info nil t)
                             (with-temp-buffer
                               (Info-mode)
                               (Info-goto-node "(Calc)Summary")
                               (goto-char (point-min))
                               (forward-line 1)
                               (copy-to-buffer "*Calc Summary*"
                                               (point) (point-max)))
                             (setq buffer-read-only t)))
193 194 195 196 197
                       (goto-char (point-min))
                       (setq case-fold-search nil)
                       (re-search-forward "^\\(.*\\)\\[\\.\\. a b")
                       (setq calc-summary-indentation
                             (- (match-end 1) (match-beginning 1)))
Eli Zaretskii's avatar
Eli Zaretskii committed
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
		       (goto-char (point-min))
		       (setq target (if (and (string-match "[0-9]\\'" desc)
					     (not (string-match "[d#]" desc)))
					(concat (substring desc 0 -1) "0-9")
				      desc))
		       (if (re-search-forward
			    (format "\n%s%s%s%s[ a-zA-Z]"
				    (make-string (+ calc-summary-indentation 9)
						 ?\.)
				    (if (string-match "M-#" desc) "   "
				      (if inv
					  (if hyp "I H " "  I ")
					(if hyp "  H " "    ")))
				    (regexp-quote target)
				    (make-string (max (- 6 (length target)) 0)
						 ?\ ))
			    nil t)
			   (let (pt)
			     (beginning-of-line)
			     (forward-char calc-summary-indentation)
			     (setq pt (point))
			     (end-of-line)
			     (buffer-substring pt (point)))))))
	    (if msg
		(let ((args (substring msg 0 9))
		      (keys (substring msg 9 19))
		      (prompts (substring msg 19 38))
		      (notes "")
		      (cmd (substring msg 40))
		      msg)
		  (if (string-match "\\` +" args)
		      (setq args (substring args (match-end 0))))
		  (if (string-match " +\\'" args)
		      (setq args (substring args 0 (match-beginning 0))))
		  (if (string-match "\\` +" keys)
		      (setq keys (substring keys (match-end 0))))
		  (if (string-match " +\\'" keys)
		      (setq keys (substring keys 0 (match-beginning 0))))
		  (if (string-match " [0-9,]+\\'" prompts)
		      (setq notes (substring prompts (1+ (match-beginning 0)))
			    prompts (substring prompts 0 (match-beginning 0))))
		  (if (string-match " +\\'" prompts)
		      (setq prompts (substring prompts 0 (match-beginning 0))))
		  (if (string-match "\\` +" prompts)
		      (setq prompts (substring prompts (match-end 0))))
		  (setq msg (format
			     "%s:  %s%s`%s'%s%s %s%s"
			     (if (string-match
				  "\\`\\(calc-[-a-zA-Z0-9]+\\) *\\(.*\\)\\'"
				  cmd)
				 (prog1 (math-match-substring cmd 1)
				   (setq cmd (math-match-substring cmd 2)))
			       defn)
			     args (if (equal args "") "" " ")
			     keys
			     (if (equal prompts "") "" " ") prompts
			     (if (equal cmd "") "" " => ") cmd))
		  (message "%s%s%s runs %s%s"
			   (if inv "I " "") (if hyp "H " "") desc
			   msg
			   (if (equal notes "") ""
			     (format "  (?=notes %s)" notes)))
		  (let ((key (calc-read-key t)))
		    (if (eq (car key) ??)
			(if (equal notes "")
			    (message "No notes for this command")
			  (while (string-match "," notes)
			    (aset notes (match-beginning 0) ? ))
			  (setq notes (sort (car (read-from-string
						  (format "(%s)" notes)))
					    '<))
			  (with-output-to-temp-buffer "*Help*"
			    (princ (format "%s\n\n" msg))
			    (set-buffer "*Calc Summary*")
			    (re-search-forward "^ *NOTES")
			    (while notes
			      (re-search-forward
			       (format "^ *%d\\. " (car notes)))
			      (beginning-of-line)
			      (let ((pt (point)))
				(forward-line 1)
				(or (re-search-forward "^ ? ?[0-9]+\\. " nil t)
				    (goto-char (point-max)))
				(beginning-of-line)
				(princ (buffer-substring pt (point))))
			      (setq notes (cdr notes)))
284
			    (help-print-return-message)))
Eli Zaretskii's avatar
Eli Zaretskii committed
285 286 287 288 289 290 291 292 293
		      (calc-unread-command (cdr key)))))
	      (if (or (null defn) (integerp defn))
		  (message "%s is undefined" desc)
		(message "%s runs the command %s"
			 desc
			 (if (symbolp defn) defn (prin1-to-string defn))))))
	(if inv (setq desc (concat "I " desc)))
	(if hyp (setq desc (concat "H " desc)))
	(calc-describe-thing desc "Key Index" nil
294
			     (string-match "[A-Z][A-Z][A-Z]" desc))))))
Eli Zaretskii's avatar
Eli Zaretskii committed
295

296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
(defvar calc-help-function-list nil
  "List of functions provided by Calc.")

(defvar calc-help-variable-list nil
  "List of variables provided by Calc.")

(defun calc-help-index-entries (&rest indices)
  "Create a list of entries from the INDICES in the Calc info manual."
  (let ((entrylist '())
        entry)
    (require 'info nil t)
    (while indices
      (condition-case nil
          (with-temp-buffer
            (Info-mode)
            (Info-goto-node (concat "(Calc)" (car indices) " Index"))
            (goto-char (point-min))
            (while (re-search-forward "\n\\* \\(.*\\): " nil t)
              (setq entry (match-string 1))
              (if (and (not (string-match "<[1-9]+>" entry))
                       (not (string-match "(.*)" entry))
                       (not (string= entry "Menu")))
                  (unless (assoc entry entrylist)
                    (setq entrylist (cons entry entrylist))))))
        (error nil))
      (setq indices (cdr indices)))
    entrylist))

Eli Zaretskii's avatar
Eli Zaretskii committed
324 325
(defun calc-describe-function (&optional func)
  (interactive)
326
  (unless calc-help-function-list
327
    (setq calc-help-function-list
328
          (calc-help-index-entries "Function" "Command")))
Eli Zaretskii's avatar
Eli Zaretskii committed
329
  (or func
330
      (setq func (completing-read "Describe function: "
331
                                  calc-help-function-list
332
                                  nil t)))
Eli Zaretskii's avatar
Eli Zaretskii committed
333 334
  (if (string-match "\\`calc-." func)
      (calc-describe-thing func "Command Index")
335
    (calc-describe-thing func "Function Index")))
Eli Zaretskii's avatar
Eli Zaretskii committed
336 337 338

(defun calc-describe-variable (&optional var)
  (interactive)
339
  (unless calc-help-variable-list
340
    (setq calc-help-variable-list
341
          (calc-help-index-entries "Variable")))
Eli Zaretskii's avatar
Eli Zaretskii committed
342
  (or var
343 344 345 346
      (setq var (completing-read "Describe variable: "
                                 calc-help-variable-list
                                 nil t)))
  (calc-describe-thing var "Variable Index"))
Eli Zaretskii's avatar
Eli Zaretskii committed
347 348 349 350

(defun calc-describe-thing (thing where &optional target not-quoted)
  (message "Looking for `%s' in %s..." thing where)
  (let ((savewin (current-window-configuration)))
351
    (calc-info-goto-node where)
Eli Zaretskii's avatar
Eli Zaretskii committed
352 353 354 355 356 357 358 359 360 361
    (or (let ((case-fold-search nil))
	  (re-search-forward (format "\n\\* +%s: \\(.*\\)\\."
				     (regexp-quote thing))
			     nil t))
	(and (string-match "\\`\\([a-z ]*\\)[0-9]\\'" thing)
	     (re-search-forward (format "\n\\* +%s[01]-9: \\(.*\\)\\."
					(substring thing 0 -1))
				nil t)
	     (setq thing (format "%s9" (substring thing 0 -1))))
	(progn
362 363
          (if Info-history
              (Info-last))
Eli Zaretskii's avatar
Eli Zaretskii committed
364 365 366 367 368
	  (set-window-configuration savewin)
	  (error "Can't find `%s' in %s" thing where)))
    (let (Info-history)
      (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1))))
    (or (let ((case-fold-search nil))
369 370 371 372
	  (or (re-search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\<The[ \n]`%s'"
                                         (or target thing)
                                         (or target thing)
                                         (or target thing)) nil t)
Eli Zaretskii's avatar
Eli Zaretskii committed
373 374 375 376 377 378
	      (and not-quoted
		   (let ((case-fold-search t))
		     (search-forward (or target thing) nil t)))
	      (search-forward (format "`%s'" (or target thing)) nil t)
	      (search-forward (or target thing) nil t)))
	(let ((case-fold-search t))
379 380 381 382
	  (or (re-search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\<The[ \n]`%s'"
                                         (or target thing)
                                         (or target thing)
                                         (or target thing)) nil t)
Eli Zaretskii's avatar
Eli Zaretskii committed
383 384 385
	      (search-forward (format "`%s'" (or target thing)) nil t)
	      (search-forward (or target thing) nil t))))
    (beginning-of-line)
386
    (message "Found `%s' in %s" thing where)))
Eli Zaretskii's avatar
Eli Zaretskii committed
387 388 389 390 391 392 393 394 395 396 397 398

(defun calc-view-news ()
  (interactive)
  (let ((path load-path))
    (while (and path
		(not (file-exists-p (expand-file-name "calc.el" (car path)))))
      (setq path (cdr path)))
    (or (and path
	     (file-exists-p (expand-file-name "README" (car path))))
	(error "Can't locate Calc sources"))
    (calc-quit)
    (switch-to-buffer "*Help*")
399 400 401 402 403 404 405 406
    (let ((inhibit-read-only t))
      (erase-buffer)
      (insert-file-contents (expand-file-name "README" (car path)))
      (search-forward "Summary of changes")
      (forward-line -1)
      (delete-region (point-min) (point))
      (goto-char (point-min)))
    (help-mode)))
Eli Zaretskii's avatar
Eli Zaretskii committed
407

Jay Belanger's avatar
Jay Belanger committed
408 409 410 411 412 413
(defvar calc-help-long-names '((?b . "binary/business")
			       (?g . "graphics")
			       (?j . "selection")
			       (?k . "combinatorics/statistics")
			       (?u . "units/statistics")))

Eli Zaretskii's avatar
Eli Zaretskii committed
414 415 416
(defun calc-full-help ()
  (interactive)
  (with-output-to-temp-buffer "*Help*"
417
    (princ "GNU Emacs Calculator.\n")
418
    (princ "  By Dave Gillespie.\n")
419
    (princ (format "  %s\n\n" emacs-copyright))
Eli Zaretskii's avatar
Eli Zaretskii committed
420 421 422 423
    (princ "Type `h s' for a more detailed summary.\n")
    (princ "Or type `h i' to read the full Calc manual on-line.\n\n")
    (princ "Basic keys:\n")
    (let* ((calc-full-help-flag t))
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
      (mapc (function (lambda (x) (princ (format "  %s\n" x))))
	    (nreverse (cdr (reverse (cdr (calc-help))))))
      (mapc (function (lambda (prefix)
			(let ((msgs (condition-case err
					(funcall prefix)
				      (error nil))))
			  (if (car msgs)
			      (princ
			       (if (eq (nth 2 msgs) ?v)
				   "\n`v' or `V' prefix (vector/matrix) keys: \n"
				 (if (nth 2 msgs)
				     (format
				      "\n`%c' prefix (%s) keys:\n"
				      (nth 2 msgs)
				      (or (cdr (assq (nth 2 msgs)
						     calc-help-long-names))
					  (nth 1 msgs)))
				   (format "\n%s-modified keys:\n"
					   (capitalize (nth 1 msgs)))))))
			  (mapcar (function (lambda (x)
				    (princ (format "  %s\n" x))))
				  (car msgs)))))
	    '(calc-inverse-prefix-help
	      calc-hyperbolic-prefix-help
	      calc-inv-hyp-prefix-help
449
              calc-option-prefix-help
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
	      calc-a-prefix-help
	      calc-b-prefix-help
	      calc-c-prefix-help
	      calc-d-prefix-help
	      calc-f-prefix-help
	      calc-g-prefix-help
	      calc-h-prefix-help
	      calc-j-prefix-help
	      calc-k-prefix-help
	      calc-m-prefix-help
	      calc-r-prefix-help
	      calc-s-prefix-help
	      calc-t-prefix-help
	      calc-u-prefix-help
	      calc-v-prefix-help
	      calc-shift-Y-prefix-help
	      calc-shift-Z-prefix-help
	      calc-z-prefix-help)))
468
    (help-print-return-message)))
Eli Zaretskii's avatar
Eli Zaretskii committed
469 470 471 472 473 474

(defun calc-h-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("Help; Bindings; Info, Tutorial, Summary; News"
     "describe: Key, C (briefly), Function, Variable")
475
   "help" ?h))
Eli Zaretskii's avatar
Eli Zaretskii committed
476 477 478 479 480 481 482 483 484 485 486 487 488

(defun calc-inverse-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("I + S (arcsin), C (arccos), T (arctan); Q (square)"
     "I + E (ln), L (exp), B (alog: B^X); f E (lnp1), f L (expm1)"
     "I + F (ceiling), R (truncate); a S (invert func)"
     "I + a m (match-not); c h (from-hms); k n (prev prime)"
     "I + f G (gamma-Q); f e (erfc); k B (etc., lower-tail dists)"
     "I + V S (reverse sort); V G (reverse grade)"
     "I + v s (remove subvec); v h (tail)"
     "I + t + (alt sum), t M (mean with error)"
     "I + t S (pop std dev), t C (pop covar)")
489
   "inverse" nil))
Eli Zaretskii's avatar
Eli Zaretskii committed
490 491 492 493 494 495 496 497 498 499 500 501 502 503

(defun calc-hyperbolic-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("H + S (sinh), C (cosh), T (tanh); E (exp10), L (log10)"
     "H + F (float floor), R (float round); P (constant \"e\")"
     "H + a d (total derivative); k c (permutations)"
     "H + k b (bern-poly), k e (euler-poly); k s (stirling-2)"
     "H + f G (gamma-g), f B (beta-B); v h (rhead), v k (rcons)"
     "H + v e (expand w/filler); V H (weighted histogram)"
     "H + a S (general solve eqn), j I (general isolate)"
     "H + a R (widen/root), a N (widen/min), a X (widen/max)"
     "H + t M (median), t S (variance), t C (correlation coef)"
     "H + c f/F/c (pervasive float/frac/clean)")
504
   "hyperbolic" nil))
Eli Zaretskii's avatar
Eli Zaretskii committed
505 506 507 508 509 510 511 512 513

(defun calc-inv-hyp-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("I H + S (arcsinh), C (arccosh), T (arctanh)"
     "I H + E (log10), L (exp10); f G (gamma-G)"
     "I H + F (float ceiling), R (float truncate)"
     "I H + t S (pop variance)"
     "I H + a S (general invert func); v h (rtail)")
514
   "inverse-hyperbolic" nil))
Eli Zaretskii's avatar
Eli Zaretskii committed
515

516 517 518 519 520
(defun calc-option-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("")
   "option" nil))
Eli Zaretskii's avatar
Eli Zaretskii committed
521 522 523 524 525 526 527 528 529

(defun calc-f-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("miN, maX; Hypot; Im, Re; Sign; [, ] (incr/decr)"
     "Gamma, Beta, Erf, besselJ, besselY"
     "SHIFT + int-sQrt; Int-log, Exp(x)-1, Ln(x+1); arcTan2"
     "SHIFT + Abssqr; Mantissa, eXponent, Scale"
     "SHIFT + incomplete: Gamma-P, Beta-I")
530
   "functions" ?f))
Eli Zaretskii's avatar
Eli Zaretskii committed
531 532 533 534 535 536


(defun calc-s-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("Store, inTo, Xchg, Unstore; Recall, 0-9; : (:=); = (=>)"
537
     "Let; Copy, K=copy constant; Declare; Insert, Perm; Edit"
Eli Zaretskii's avatar
Eli Zaretskii committed
538 539 540 541
     "Negate, +, -, *, /, ^, &, |, [, ]; Map"
     "SHIFT + Decls, GenCount, TimeZone, Holidays; IntegLimit"
     "SHIFT + LineStyles, PointStyles, plotRejects; Units"
     "SHIFT + Eval-, AlgSimp-, ExtSimp-, FitRules")
542
   "store" ?s))
Eli Zaretskii's avatar
Eli Zaretskii committed
543 544 545 546

(defun calc-r-prefix-help ()
  (interactive)
  (calc-do-prefix-help
547 548 549
   '("digits 0-9: recall, same as `s r 0-9'"
     "Save to register, Insert from register")
   "recall/register" ?r))
Eli Zaretskii's avatar
Eli Zaretskii committed
550 551 552 553 554 555 556 557 558 559 560 561


(defun calc-j-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("Select, Additional, Once; eVal, Formula; Rewrite"
     "More, Less, 1-9, Next, Previous"
     "Unselect, Clear; Display; Enable; Breakable"
     "' (replace), ` (edit), +, -, *, /, RET (grab), DEL"
     "SHIFT + swap: Left, Right; maybe: Select, Once"
     "SHIFT + Commute, Merge, Distrib, jump-Eqn, Isolate"
     "SHIFT + Negate, & (invert); Unpack")
562
   "select" ?j))
Eli Zaretskii's avatar
Eli Zaretskii committed
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577


(defun calc-a-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("Simplify, Extended-simplify, eVal; \" (exp-formula)"
     "eXpand, Collect, Factor, Apart, Norm-rat"
     "GCD, /, \\, % (polys); Polint"
     "Derivative, Integral, Taylor; _ (subscr)"
     "suBstitute; Rewrite, Match"
     "SHIFT + Solve; Root, miN, maX; Poly-roots; Fit"
     "SHIFT + Map; Tabulate, + (sum), * (prod); num-Integ"
     "relations: =, # (not =), <, >, [ (< or =), ] (> or =)"
     "logical: & (and), | (or), ! (not); : (if)"
     "misc: { (in-set); . (rmeq)")
578
   "algebra" ?a))
Eli Zaretskii's avatar
Eli Zaretskii committed
579 580 581 582 583


(defun calc-b-prefix-help ()
  (interactive)
  (calc-do-prefix-help
584
   '("And, Or, Xor, Diff, Not; Wordsize, Clip"
Eli Zaretskii's avatar
Eli Zaretskii committed
585 586 587
     "Lshift, Rshift, roTate; SHIFT + signed Lshift, Rshift"
     "SHIFT + business: Pv, Npv, Fv, pMt, #pmts, raTe, Irr"
     "SHIFT + business: Sln, sYd, Ddb; %ch")
588
   "binary/bus" ?b))
Eli Zaretskii's avatar
Eli Zaretskii committed
589 590 591 592 593 594 595


(defun calc-c-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("Deg, Rad, HMS; Float; Polar/rect; Clean, 0-9; %"
     "SHIFT + Fraction")
596
   "convert" ?c))
Eli Zaretskii's avatar
Eli Zaretskii committed
597 598 599 600 601 602 603 604


(defun calc-d-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("Group, \",\"; Normal, Fix, Sci, Eng, \".\"; Over"
     "Radix, Zeros, 2, 8, 0, 6; Hms; Date; Complex, I, J"
     "Why; Line-nums, line-Breaks; <, =, > (justify); Plain"
Miles Bader's avatar
Miles Bader committed
605
     "\" (strings); Truncate, [, ]; SPC (refresh), RET, @"
Eli Zaretskii's avatar
Eli Zaretskii committed
606
     "SHIFT + language: Normal, One-line, Big, Unformatted"
607
     "SHIFT + language: C, Pascal, Fortran; TeX, LaTeX, Eqn"
608
     "SHIFT + language: Yacas, X=Maxima, A=Giac"
Eli Zaretskii's avatar
Eli Zaretskii committed
609
     "SHIFT + language: Mathematica, W=Maple")
610
   "display" ?d))
Eli Zaretskii's avatar
Eli Zaretskii committed
611 612 613 614 615 616 617 618 619 620 621 622


(defun calc-g-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("Fast; Add, Delete, Juggle; Plot, Clear; Quit"
     "Header, Name, Grid, Border, Key; View-commands, X-display"
     "x-axis: Range, Title, Log, Zero; lineStyle"
     "SHIFT + y-axis: Range, Title, Log, Zero; pointStyle"
     "SHIFT + Print; Device, Output-file; X-geometry"
     "SHIFT + Num-pts; Command, Kill, View-trail"
     "SHIFT + 3d: Fast, Add; CTRL + z-axis: Range, Title, Log")
623
   "graph" ?g))
Eli Zaretskii's avatar
Eli Zaretskii committed
624 625 626 627 628 629 630 631 632 633 634 635


(defun calc-k-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("GCD, LCM; Choose (binomial), Double-factorial"
     "Random, random-Again, sHuffle"
     "Factors, Prime-test, Next-prime, Totient, Moebius"
     "Bernoulli, Euler, Stirling"
     "SHIFT + Extended-gcd"
     "SHIFT + dists: Binomial, Chi-square, F, Normal"
     "SHIFT + dists: Poisson, student's-T")
636
   "combinatorics" ?k))
Eli Zaretskii's avatar
Eli Zaretskii committed
637 638 639 640 641 642


(defun calc-m-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("Deg, Rad, HMS; Frac; Polar; Inf; Alg, Total; Symb; Vec/mat"
643
     "Working; Xtensions; Mode-save; preserve Embedded modes"
Eli Zaretskii's avatar
Eli Zaretskii committed
644 645
     "SHIFT + Shifted-prefixes, mode-Filename; Record; reCompute"
     "SHIFT + simplify: Off, Num, Default, Bin, Alg, Ext, Units")
646
   "mode" ?m))
Eli Zaretskii's avatar
Eli Zaretskii committed
647 648 649 650 651 652 653 654 655 656 657


(defun calc-t-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("Display; Fwd, Back; Next, Prev, Here, [, ]; Yank"
     "Search, Rev; In, Out; <, >; Kill; Marker; . (abbrev)"
     "SHIFT + time: Now; Part; Date, Julian, Unix, Czone"
     "SHIFT + time: newWeek, newMonth, newYear; Incmonth"
     "SHIFT + time: +, - (business days)"
     "digits 0-9: store-to, same as `s t 0-9'")
658
   "trail/time" ?t))
Eli Zaretskii's avatar
Eli Zaretskii committed
659 660 661 662 663 664 665


(defun calc-u-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("Simplify, Convert, Temperature-convert, Base-units"
     "Autorange; Remove, eXtract; Explain; View-table; 0-9"
666
     "Define, Undefine, Get-defn, Permanent, Logarithmic"
Eli Zaretskii's avatar
Eli Zaretskii committed
667 668 669
     "SHIFT + View-table-other-window"
     "SHIFT + stat: Mean, G-mean, Std-dev, Covar, maX, miN"
     "SHIFT + stat: + (sum), - (asum), * (prod), # (count)")
670
   "units/stat" ?u))
Eli Zaretskii's avatar
Eli Zaretskii committed
671

672 673 674 675 676 677 678
(defun calc-ul-prefix-help ()
  (interactive)
  (if (eq this-command last-command)
      (message "ul-")
    (message "logarithmic-units: + (logarithmic), - (logarithmic), Level: ul-"))
  (push ?l unread-command-events)
  (push ?u unread-command-events))
Eli Zaretskii's avatar
Eli Zaretskii committed
679 680 681 682 683 684 685 686 687 688 689 690 691 692 693

(defun calc-v-prefix-help ()
  (interactive)
  (calc-do-prefix-help
   '("Pack, Unpack, Identity, Diagonal, indeX, Build"
     "Row, Column, Subvector; Length; Find; Mask, Expand"
     "Tranpose, Arrange, reVerse; Head, Kons; rNorm"
     "SHIFT + Det, & (inverse), LUD, Trace, conJtrn, Cross"
     "SHIFT + Sort, Grade, Histogram; cNorm"
     "SHIFT + Apply, Map, Reduce, accUm, Inner-, Outer-prod"
     "SHIFT + sets: V (union), ^ (intersection), - (diff)"
     "SHIFT + sets: Xor, ~ (complement), Floor, Enum"
     "SHIFT + sets: : (span), # (card), + (rdup)"
     "<, =, > (justification); , (commas); [, {, ( (brackets)"
     "} (matrix brackets); . (abbreviate); / (multi-lines)")
694
   "vec/mat" ?v))
Eli Zaretskii's avatar
Eli Zaretskii committed
695

Jay Belanger's avatar
Jay Belanger committed
696 697
(provide 'calc-help)

698
;;; calc-help.el ends here