Mercurial > emacs
annotate lisp/calc/calc-help.el @ 108705:f7d37c2787ad
* composite.el: Require cl when compiling; fix typos in docstrings.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 20 May 2010 03:27:49 +0200 |
parents | 9b67d5035af2 |
children | d835100c3e8b |
rev | line source |
---|---|
41271
fcd507927105
Change all toplevel `setq' forms to `defvar' forms, and move them
Colin Walters <walters@gnu.org>
parents:
41047
diff
changeset
|
1 ;;; calc-help.el --- help display functions for Calc, |
fcd507927105
Change all toplevel `setq' forms to `defvar' forms, and move them
Colin Walters <walters@gnu.org>
parents:
41047
diff
changeset
|
2 |
104386
2e0765155e47
Use help-print-return-message rather than the now obsolete alias.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
3 ;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004, 2005, |
106815 | 4 ;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
41271
fcd507927105
Change all toplevel `setq' forms to `defvar' forms, and move them
Colin Walters <walters@gnu.org>
parents:
41047
diff
changeset
|
5 |
fcd507927105
Change all toplevel `setq' forms to `defvar' forms, and move them
Colin Walters <walters@gnu.org>
parents:
41047
diff
changeset
|
6 ;; Author: David Gillespie <daveg@synaptics.com> |
77465
1154f082efd9
Update maintainer's address.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
76595
diff
changeset
|
7 ;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com> |
40785 | 8 |
9 ;; This file is part of GNU Emacs. | |
10 | |
94654
6c9af2bfcfee
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
76595
497d17a80bb8
Change form of license text to match rest of Emacs.
Glenn Morris <rgm@gnu.org>
parents:
75346
diff
changeset
|
12 ;; it under the terms of the GNU General Public License as published by |
94654
6c9af2bfcfee
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
6c9af2bfcfee
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
14 ;; (at your option) any later version. |
40785 | 15 |
76595
497d17a80bb8
Change form of license text to match rest of Emacs.
Glenn Morris <rgm@gnu.org>
parents:
75346
diff
changeset
|
16 ;; GNU Emacs is distributed in the hope that it will be useful, |
497d17a80bb8
Change form of license text to match rest of Emacs.
Glenn Morris <rgm@gnu.org>
parents:
75346
diff
changeset
|
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
497d17a80bb8
Change form of license text to match rest of Emacs.
Glenn Morris <rgm@gnu.org>
parents:
75346
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
497d17a80bb8
Change form of license text to match rest of Emacs.
Glenn Morris <rgm@gnu.org>
parents:
75346
diff
changeset
|
19 ;; GNU General Public License for more details. |
497d17a80bb8
Change form of license text to match rest of Emacs.
Glenn Morris <rgm@gnu.org>
parents:
75346
diff
changeset
|
20 |
497d17a80bb8
Change form of license text to match rest of Emacs.
Glenn Morris <rgm@gnu.org>
parents:
75346
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
94654
6c9af2bfcfee
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
40785 | 23 |
41271
fcd507927105
Change all toplevel `setq' forms to `defvar' forms, and move them
Colin Walters <walters@gnu.org>
parents:
41047
diff
changeset
|
24 ;;; Commentary: |
40785 | 25 |
41271
fcd507927105
Change all toplevel `setq' forms to `defvar' forms, and move them
Colin Walters <walters@gnu.org>
parents:
41047
diff
changeset
|
26 ;;; Code: |
40785 | 27 |
28 ;; This file is autoloaded from calc-ext.el. | |
58658
8564d764ff4d
Add a provide statement.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58551
diff
changeset
|
29 |
40785 | 30 (require 'calc-ext) |
31 (require 'calc-macs) | |
32 | |
86473
06a124417f42
(Info-goto-node, Info-last): Declare as functions.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
84887
diff
changeset
|
33 ;; Declare functions which are defined elsewhere. |
06a124417f42
(Info-goto-node, Info-last): Declare as functions.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
84887
diff
changeset
|
34 (declare-function Info-goto-node "info" (nodename &optional fork)) |
06a124417f42
(Info-goto-node, Info-last): Declare as functions.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
84887
diff
changeset
|
35 (declare-function Info-last "info" ()) |
06a124417f42
(Info-goto-node, Info-last): Declare as functions.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
84887
diff
changeset
|
36 |
06a124417f42
(Info-goto-node, Info-last): Declare as functions.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
84887
diff
changeset
|
37 |
40785 | 38 (defun calc-help-prefix (arg) |
39 "This key is the prefix for Calc help functions. See calc-help-for-help." | |
40 (interactive "P") | |
41 (or calc-dispatch-help (sit-for echo-keystrokes)) | |
42 (let ((key (calc-read-key-sequence | |
43 (if calc-dispatch-help | |
44 "Calc Help options: Help, Info, Tutorial, Summary; Key, Function; ?=more" | |
45 (format "%s (Type ? for a list of Calc Help options)" | |
46 (key-description (this-command-keys)))) | |
47 calc-help-map))) | |
48 (setq key (lookup-key calc-help-map key)) | |
49 (message "") | |
50 (if key | |
51 (call-interactively key) | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
52 (beep)))) |
40785 | 53 |
54 (defun calc-help-for-help (arg) | |
55 "You have typed `h', the Calc help character. Type a Help option: | |
56 | |
57 B calc-describe-bindings. Display a table of all key bindings. | |
58 H calc-full-help. Display all `?' key messages at once. | |
59 | |
60 I calc-info. Read the Calc manual using the Info system. | |
61 T calc-tutorial. Read the Calc tutorial using the Info system. | |
62 S calc-info-summary. Read the Calc summary using the Info system. | |
63 | |
64 C calc-describe-key-briefly. Look up the command name for a given key. | |
65 K calc-describe-key. Look up a key's documentation in the manual. | |
66 F calc-describe-function. Look up a function's documentation in the manual. | |
67 V calc-describe-variable. Look up a variable's documentation in the manual. | |
68 | |
69 N calc-view-news. Display Calc history of changes. | |
70 | |
71 C-c Describe conditions for copying Calc. | |
72 C-d Describe how you can get a new copy of Calc or report a bug. | |
73 C-w Describe how there is no warranty for Calc." | |
74 (interactive "P") | |
75 (if calc-dispatch-help | |
76 (let (key) | |
77 (save-window-excursion | |
78 (describe-function 'calc-help-for-help) | |
79 (select-window (get-buffer-window "*Help*")) | |
80 (while (progn | |
81 (message "Calc Help options: Help, Info, ... press SPC, DEL to scroll, C-g to cancel") | |
82 (memq (car (setq key (calc-read-key t))) | |
83 '(? ?\C-h ?\C-? ?\C-v ?\M-v))) | |
84 (condition-case err | |
85 (if (memq (car key) '(? ?\C-v)) | |
86 (scroll-up) | |
87 (scroll-down)) | |
88 (error (beep))))) | |
89 (calc-unread-command (cdr key)) | |
90 (calc-help-prefix nil)) | |
91 (let ((calc-dispatch-help t)) | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
92 (calc-help-prefix arg)))) |
40785 | 93 |
94 (defun calc-describe-copying () | |
95 (interactive) | |
57431
eb0c890a4987
(calc-describe-copying, calc-describe-distribution, calc-describe-thing,
Jay Belanger <jay.p.belanger@gmail.com>
parents:
52401
diff
changeset
|
96 (calc-info-goto-node "Copying")) |
40785 | 97 |
98 (defun calc-describe-distribution () | |
99 (interactive) | |
57431
eb0c890a4987
(calc-describe-copying, calc-describe-distribution, calc-describe-thing,
Jay Belanger <jay.p.belanger@gmail.com>
parents:
52401
diff
changeset
|
100 (calc-info-goto-node "Reporting Bugs")) |
40785 | 101 |
102 (defun calc-describe-no-warranty () | |
103 (interactive) | |
57431
eb0c890a4987
(calc-describe-copying, calc-describe-distribution, calc-describe-thing,
Jay Belanger <jay.p.belanger@gmail.com>
parents:
52401
diff
changeset
|
104 (calc-info-goto-node "Copying") |
40785 | 105 (let ((case-fold-search nil)) |
106 (search-forward " NO WARRANTY")) | |
107 (beginning-of-line) | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
108 (recenter 0)) |
40785 | 109 |
110 (defun calc-describe-bindings () | |
111 (interactive) | |
112 (describe-bindings) | |
105792
2c12fbae77c2
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104386
diff
changeset
|
113 (with-current-buffer "*Help*" |
57634
0dd4932a3caa
(calc-describe-bindings): Fix last change.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
57576
diff
changeset
|
114 (let ((inhibit-read-only t)) |
57576
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
115 (goto-char (point-min)) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
116 (when (search-forward "Major Mode Bindings:" nil t) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
117 (delete-region (point-min) (point)) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
118 (insert "Calc Mode Bindings:")) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
119 (when (search-forward "Global bindings:" nil t) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
120 (forward-line -1) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
121 (delete-region (point) (point-max))) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
122 (goto-char (point-min)) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
123 (while |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
124 (re-search-forward |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
125 "\n[a-z] [0-9]\\( .*\n\\)\\([a-z] [0-9]\\1\\)*[a-z] \\([0-9]\\)\\1" |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
126 nil t) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
127 (let ((dig1 (char-after (1- (match-beginning 1)))) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
128 (dig2 (char-after (match-beginning 3)))) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
129 (delete-region (match-end 1) (match-end 0)) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
130 (goto-char (match-beginning 1)) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
131 (delete-backward-char 1) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
132 (delete-char 5) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
133 (insert (format "%c .. %c" (min dig1 dig2) (max dig1 dig2))))) |
5e8a69bc2cfa
(calc-describe-bindings): Set `buffer-read-only' to nil while working
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57456
diff
changeset
|
134 (goto-char (point-min))))) |
40785 | 135 |
136 (defun calc-describe-key-briefly (key) | |
137 (interactive "kDescribe key briefly: ") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
138 (calc-describe-key key t)) |
40785 | 139 |
58551
c38bc6b76926
(Info-history): Declare it.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57634
diff
changeset
|
140 (defvar Info-history) |
c38bc6b76926
(Info-history): Declare it.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57634
diff
changeset
|
141 |
40785 | 142 (defun calc-describe-key (key &optional briefly) |
143 (interactive "kDescribe key: ") | |
144 (let ((defn (if (eq (key-binding key) 'calc-dispatch) | |
145 (let ((key2 (calc-read-key-sequence | |
146 (format "Describe key briefly: %s-" | |
147 (key-description key)) | |
148 calc-dispatch-map))) | |
149 (setq key (concat key key2)) | |
150 (lookup-key calc-dispatch-map key2)) | |
151 (if (eq (key-binding key) 'calc-help-prefix) | |
152 (let ((key2 (calc-read-key-sequence | |
153 (format "Describe key briefly: %s-" | |
154 (key-description key)) | |
155 calc-help-map))) | |
156 (setq key (concat key key2)) | |
157 (lookup-key calc-help-map key2)) | |
158 (key-binding key)))) | |
159 (inv nil) | |
58551
c38bc6b76926
(Info-history): Declare it.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57634
diff
changeset
|
160 (hyp nil) |
c38bc6b76926
(Info-history): Declare it.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57634
diff
changeset
|
161 calc-summary-indentation) |
40785 | 162 (while (or (equal key "I") (equal key "H")) |
163 (if (equal key "I") | |
164 (setq inv (not inv)) | |
165 (setq hyp (not hyp))) | |
166 (setq key (read-key-sequence (format "Describe key%s:%s%s " | |
167 (if briefly " briefly" "") | |
168 (if inv " I" "") | |
169 (if hyp " H" ""))) | |
170 defn (key-binding key))) | |
171 (let ((desc (key-description key)) | |
172 target) | |
173 (if (string-match "^ESC " desc) | |
174 (setq desc (concat "M-" (substring desc 4)))) | |
175 (while (string-match "^M-# \\(ESC \\|C-\\)" desc) | |
176 (setq desc (concat "M-# " (substring desc (match-end 0))))) | |
96636
e3997bf73655
(calc-describe-key): Add angles to special key descriptions.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
96634
diff
changeset
|
177 (if (string-match "\\(DEL\\|\\LFD\\|RET\\|SPC\\|TAB\\)" desc) |
e3997bf73655
(calc-describe-key): Add angles to special key descriptions.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
96634
diff
changeset
|
178 (setq desc (replace-match "<\\&>" nil nil desc))) |
40785 | 179 (if briefly |
105792
2c12fbae77c2
* calc/calc.el (calc, calc-refresh, calc-trail-buffer, calc-record)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
104386
diff
changeset
|
180 (let ((msg (with-current-buffer (get-buffer-create "*Calc Summary*") |
40785 | 181 (if (= (buffer-size) 0) |
182 (progn | |
183 (message "Reading Calc summary from manual...") | |
59501
766a3686c3ae
(calc-describe-key): Use temporary info buffer to create a Calc
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58811
diff
changeset
|
184 (require 'info nil t) |
766a3686c3ae
(calc-describe-key): Use temporary info buffer to create a Calc
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58811
diff
changeset
|
185 (with-temp-buffer |
766a3686c3ae
(calc-describe-key): Use temporary info buffer to create a Calc
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58811
diff
changeset
|
186 (Info-mode) |
766a3686c3ae
(calc-describe-key): Use temporary info buffer to create a Calc
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58811
diff
changeset
|
187 (Info-goto-node "(Calc)Summary") |
766a3686c3ae
(calc-describe-key): Use temporary info buffer to create a Calc
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58811
diff
changeset
|
188 (goto-char (point-min)) |
766a3686c3ae
(calc-describe-key): Use temporary info buffer to create a Calc
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58811
diff
changeset
|
189 (forward-line 1) |
766a3686c3ae
(calc-describe-key): Use temporary info buffer to create a Calc
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58811
diff
changeset
|
190 (copy-to-buffer "*Calc Summary*" |
766a3686c3ae
(calc-describe-key): Use temporary info buffer to create a Calc
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58811
diff
changeset
|
191 (point) (point-max))) |
766a3686c3ae
(calc-describe-key): Use temporary info buffer to create a Calc
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58811
diff
changeset
|
192 (setq buffer-read-only t))) |
58811
b6f65248543d
Set calc-summary-indentation even when Calc Summary buffer exists.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58658
diff
changeset
|
193 (goto-char (point-min)) |
b6f65248543d
Set calc-summary-indentation even when Calc Summary buffer exists.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58658
diff
changeset
|
194 (setq case-fold-search nil) |
b6f65248543d
Set calc-summary-indentation even when Calc Summary buffer exists.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58658
diff
changeset
|
195 (re-search-forward "^\\(.*\\)\\[\\.\\. a b") |
b6f65248543d
Set calc-summary-indentation even when Calc Summary buffer exists.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58658
diff
changeset
|
196 (setq calc-summary-indentation |
b6f65248543d
Set calc-summary-indentation even when Calc Summary buffer exists.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58658
diff
changeset
|
197 (- (match-end 1) (match-beginning 1))) |
40785 | 198 (goto-char (point-min)) |
199 (setq target (if (and (string-match "[0-9]\\'" desc) | |
200 (not (string-match "[d#]" desc))) | |
201 (concat (substring desc 0 -1) "0-9") | |
202 desc)) | |
203 (if (re-search-forward | |
204 (format "\n%s%s%s%s[ a-zA-Z]" | |
205 (make-string (+ calc-summary-indentation 9) | |
206 ?\.) | |
207 (if (string-match "M-#" desc) " " | |
208 (if inv | |
209 (if hyp "I H " " I ") | |
210 (if hyp " H " " "))) | |
211 (regexp-quote target) | |
212 (make-string (max (- 6 (length target)) 0) | |
213 ?\ )) | |
214 nil t) | |
215 (let (pt) | |
216 (beginning-of-line) | |
217 (forward-char calc-summary-indentation) | |
218 (setq pt (point)) | |
219 (end-of-line) | |
220 (buffer-substring pt (point))))))) | |
221 (if msg | |
222 (let ((args (substring msg 0 9)) | |
223 (keys (substring msg 9 19)) | |
224 (prompts (substring msg 19 38)) | |
225 (notes "") | |
226 (cmd (substring msg 40)) | |
227 msg) | |
228 (if (string-match "\\` +" args) | |
229 (setq args (substring args (match-end 0)))) | |
230 (if (string-match " +\\'" args) | |
231 (setq args (substring args 0 (match-beginning 0)))) | |
232 (if (string-match "\\` +" keys) | |
233 (setq keys (substring keys (match-end 0)))) | |
234 (if (string-match " +\\'" keys) | |
235 (setq keys (substring keys 0 (match-beginning 0)))) | |
236 (if (string-match " [0-9,]+\\'" prompts) | |
237 (setq notes (substring prompts (1+ (match-beginning 0))) | |
238 prompts (substring prompts 0 (match-beginning 0)))) | |
239 (if (string-match " +\\'" prompts) | |
240 (setq prompts (substring prompts 0 (match-beginning 0)))) | |
241 (if (string-match "\\` +" prompts) | |
242 (setq prompts (substring prompts (match-end 0)))) | |
243 (setq msg (format | |
244 "%s: %s%s`%s'%s%s %s%s" | |
245 (if (string-match | |
246 "\\`\\(calc-[-a-zA-Z0-9]+\\) *\\(.*\\)\\'" | |
247 cmd) | |
248 (prog1 (math-match-substring cmd 1) | |
249 (setq cmd (math-match-substring cmd 2))) | |
250 defn) | |
251 args (if (equal args "") "" " ") | |
252 keys | |
253 (if (equal prompts "") "" " ") prompts | |
254 (if (equal cmd "") "" " => ") cmd)) | |
255 (message "%s%s%s runs %s%s" | |
256 (if inv "I " "") (if hyp "H " "") desc | |
257 msg | |
258 (if (equal notes "") "" | |
259 (format " (?=notes %s)" notes))) | |
260 (let ((key (calc-read-key t))) | |
261 (if (eq (car key) ??) | |
262 (if (equal notes "") | |
263 (message "No notes for this command") | |
264 (while (string-match "," notes) | |
265 (aset notes (match-beginning 0) ? )) | |
266 (setq notes (sort (car (read-from-string | |
267 (format "(%s)" notes))) | |
268 '<)) | |
269 (with-output-to-temp-buffer "*Help*" | |
270 (princ (format "%s\n\n" msg)) | |
271 (set-buffer "*Calc Summary*") | |
272 (re-search-forward "^ *NOTES") | |
273 (while notes | |
274 (re-search-forward | |
275 (format "^ *%d\\. " (car notes))) | |
276 (beginning-of-line) | |
277 (let ((pt (point))) | |
278 (forward-line 1) | |
279 (or (re-search-forward "^ ? ?[0-9]+\\. " nil t) | |
280 (goto-char (point-max))) | |
281 (beginning-of-line) | |
282 (princ (buffer-substring pt (point)))) | |
283 (setq notes (cdr notes))) | |
104386
2e0765155e47
Use help-print-return-message rather than the now obsolete alias.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
284 (help-print-return-message))) |
40785 | 285 (calc-unread-command (cdr key))))) |
286 (if (or (null defn) (integerp defn)) | |
287 (message "%s is undefined" desc) | |
288 (message "%s runs the command %s" | |
289 desc | |
290 (if (symbolp defn) defn (prin1-to-string defn)))))) | |
291 (if inv (setq desc (concat "I " desc))) | |
292 (if hyp (setq desc (concat "H " desc))) | |
293 (calc-describe-thing desc "Key Index" nil | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
294 (string-match "[A-Z][A-Z][A-Z]" desc)))))) |
40785 | 295 |
57456
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
296 (defvar calc-help-function-list nil |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
297 "List of functions provided by Calc.") |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
298 |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
299 (defvar calc-help-variable-list nil |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
300 "List of variables provided by Calc.") |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
301 |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
302 (defun calc-help-index-entries (&rest indices) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
303 "Create a list of entries from the INDICES in the Calc info manual." |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
304 (let ((entrylist '()) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
305 entry) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
306 (require 'info nil t) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
307 (while indices |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
308 (condition-case nil |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
309 (with-temp-buffer |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
310 (Info-mode) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
311 (Info-goto-node (concat "(Calc)" (car indices) " Index")) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
312 (goto-char (point-min)) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
313 (while (re-search-forward "\n\\* \\(.*\\): " nil t) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
314 (setq entry (match-string 1)) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
315 (if (and (not (string-match "<[1-9]+>" entry)) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
316 (not (string-match "(.*)" entry)) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
317 (not (string= entry "Menu"))) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
318 (unless (assoc entry entrylist) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
319 (setq entrylist (cons entry entrylist)))))) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
320 (error nil)) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
321 (setq indices (cdr indices))) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
322 entrylist)) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
323 |
40785 | 324 (defun calc-describe-function (&optional func) |
325 (interactive) | |
57456
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
326 (unless calc-help-function-list |
84887
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
327 (setq calc-help-function-list |
57456
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
328 (calc-help-index-entries "Function" "Command"))) |
40785 | 329 (or func |
57456
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
330 (setq func (completing-read "Describe function: " |
84887
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
331 calc-help-function-list |
57456
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
332 nil t))) |
40785 | 333 (if (string-match "\\`calc-." func) |
334 (calc-describe-thing func "Command Index") | |
57456
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
335 (calc-describe-thing func "Function Index"))) |
40785 | 336 |
337 (defun calc-describe-variable (&optional var) | |
338 (interactive) | |
57456
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
339 (unless calc-help-variable-list |
84887
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
340 (setq calc-help-variable-list |
57456
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
341 (calc-help-index-entries "Variable"))) |
40785 | 342 (or var |
57456
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
343 (setq var (completing-read "Describe variable: " |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
344 calc-help-variable-list |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
345 nil t))) |
cadf61c7f4eb
(calc-help-function-list, calc-help-variable-list): New variables.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57431
diff
changeset
|
346 (calc-describe-thing var "Variable Index")) |
40785 | 347 |
348 (defun calc-describe-thing (thing where &optional target not-quoted) | |
349 (message "Looking for `%s' in %s..." thing where) | |
350 (let ((savewin (current-window-configuration))) | |
57431
eb0c890a4987
(calc-describe-copying, calc-describe-distribution, calc-describe-thing,
Jay Belanger <jay.p.belanger@gmail.com>
parents:
52401
diff
changeset
|
351 (calc-info-goto-node where) |
40785 | 352 (or (let ((case-fold-search nil)) |
353 (re-search-forward (format "\n\\* +%s: \\(.*\\)\\." | |
354 (regexp-quote thing)) | |
355 nil t)) | |
356 (and (string-match "\\`\\([a-z ]*\\)[0-9]\\'" thing) | |
357 (re-search-forward (format "\n\\* +%s[01]-9: \\(.*\\)\\." | |
358 (substring thing 0 -1)) | |
359 nil t) | |
360 (setq thing (format "%s9" (substring thing 0 -1)))) | |
361 (progn | |
57431
eb0c890a4987
(calc-describe-copying, calc-describe-distribution, calc-describe-thing,
Jay Belanger <jay.p.belanger@gmail.com>
parents:
52401
diff
changeset
|
362 (if Info-history |
eb0c890a4987
(calc-describe-copying, calc-describe-distribution, calc-describe-thing,
Jay Belanger <jay.p.belanger@gmail.com>
parents:
52401
diff
changeset
|
363 (Info-last)) |
40785 | 364 (set-window-configuration savewin) |
365 (error "Can't find `%s' in %s" thing where))) | |
366 (let (Info-history) | |
367 (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) | |
368 (or (let ((case-fold-search nil)) | |
96634
f9a35ef0a183
(calc-describe-thing): Use `re-search-forward' to search for regexp.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
95082
diff
changeset
|
369 (or (re-search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\<The[ \n]`%s'" |
f9a35ef0a183
(calc-describe-thing): Use `re-search-forward' to search for regexp.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
95082
diff
changeset
|
370 (or target thing) |
f9a35ef0a183
(calc-describe-thing): Use `re-search-forward' to search for regexp.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
95082
diff
changeset
|
371 (or target thing) |
f9a35ef0a183
(calc-describe-thing): Use `re-search-forward' to search for regexp.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
95082
diff
changeset
|
372 (or target thing)) nil t) |
40785 | 373 (and not-quoted |
374 (let ((case-fold-search t)) | |
375 (search-forward (or target thing) nil t))) | |
376 (search-forward (format "`%s'" (or target thing)) nil t) | |
377 (search-forward (or target thing) nil t))) | |
378 (let ((case-fold-search t)) | |
96634
f9a35ef0a183
(calc-describe-thing): Use `re-search-forward' to search for regexp.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
95082
diff
changeset
|
379 (or (re-search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\<The[ \n]`%s'" |
f9a35ef0a183
(calc-describe-thing): Use `re-search-forward' to search for regexp.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
95082
diff
changeset
|
380 (or target thing) |
f9a35ef0a183
(calc-describe-thing): Use `re-search-forward' to search for regexp.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
95082
diff
changeset
|
381 (or target thing) |
f9a35ef0a183
(calc-describe-thing): Use `re-search-forward' to search for regexp.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
95082
diff
changeset
|
382 (or target thing)) nil t) |
40785 | 383 (search-forward (format "`%s'" (or target thing)) nil t) |
384 (search-forward (or target thing) nil t)))) | |
385 (beginning-of-line) | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
386 (message "Found `%s' in %s" thing where))) |
40785 | 387 |
388 (defun calc-view-news () | |
389 (interactive) | |
390 (let ((path load-path)) | |
391 (while (and path | |
392 (not (file-exists-p (expand-file-name "calc.el" (car path))))) | |
393 (setq path (cdr path))) | |
394 (or (and path | |
395 (file-exists-p (expand-file-name "README" (car path)))) | |
396 (error "Can't locate Calc sources")) | |
397 (calc-quit) | |
398 (switch-to-buffer "*Help*") | |
61831
82f10a9c9eb3
(calc-view-news): Let-bind inhibit-read-only to t, use help-mode.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
61146
diff
changeset
|
399 (let ((inhibit-read-only t)) |
82f10a9c9eb3
(calc-view-news): Let-bind inhibit-read-only to t, use help-mode.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
61146
diff
changeset
|
400 (erase-buffer) |
82f10a9c9eb3
(calc-view-news): Let-bind inhibit-read-only to t, use help-mode.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
61146
diff
changeset
|
401 (insert-file-contents (expand-file-name "README" (car path))) |
82f10a9c9eb3
(calc-view-news): Let-bind inhibit-read-only to t, use help-mode.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
61146
diff
changeset
|
402 (search-forward "Summary of changes") |
82f10a9c9eb3
(calc-view-news): Let-bind inhibit-read-only to t, use help-mode.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
61146
diff
changeset
|
403 (forward-line -1) |
82f10a9c9eb3
(calc-view-news): Let-bind inhibit-read-only to t, use help-mode.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
61146
diff
changeset
|
404 (delete-region (point-min) (point)) |
82f10a9c9eb3
(calc-view-news): Let-bind inhibit-read-only to t, use help-mode.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
61146
diff
changeset
|
405 (goto-char (point-min))) |
82f10a9c9eb3
(calc-view-news): Let-bind inhibit-read-only to t, use help-mode.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
61146
diff
changeset
|
406 (help-mode))) |
40785 | 407 |
58551
c38bc6b76926
(Info-history): Declare it.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57634
diff
changeset
|
408 (defvar calc-help-long-names '((?b . "binary/business") |
c38bc6b76926
(Info-history): Declare it.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57634
diff
changeset
|
409 (?g . "graphics") |
c38bc6b76926
(Info-history): Declare it.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57634
diff
changeset
|
410 (?j . "selection") |
c38bc6b76926
(Info-history): Declare it.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57634
diff
changeset
|
411 (?k . "combinatorics/statistics") |
c38bc6b76926
(Info-history): Declare it.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57634
diff
changeset
|
412 (?u . "units/statistics"))) |
c38bc6b76926
(Info-history): Declare it.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
57634
diff
changeset
|
413 |
40785 | 414 (defun calc-full-help () |
415 (interactive) | |
416 (with-output-to-temp-buffer "*Help*" | |
97461
c8dee3015f2b
(calc-full-help): Remove version number.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
96636
diff
changeset
|
417 (princ "GNU Emacs Calculator.\n") |
61146
36733539e1c5
(calc-full-help): Remove email address.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
61095
diff
changeset
|
418 (princ " By Dave Gillespie.\n") |
79700
a0995ad442d5
(calc-full-help): Use emacs-copyright.
Glenn Morris <rgm@gnu.org>
parents:
78215
diff
changeset
|
419 (princ (format " %s\n\n" emacs-copyright)) |
40785 | 420 (princ "Type `h s' for a more detailed summary.\n") |
421 (princ "Or type `h i' to read the full Calc manual on-line.\n\n") | |
422 (princ "Basic keys:\n") | |
423 (let* ((calc-full-help-flag t)) | |
84887
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
424 (mapc (function (lambda (x) (princ (format " %s\n" x)))) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
425 (nreverse (cdr (reverse (cdr (calc-help)))))) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
426 (mapc (function (lambda (prefix) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
427 (let ((msgs (condition-case err |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
428 (funcall prefix) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
429 (error nil)))) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
430 (if (car msgs) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
431 (princ |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
432 (if (eq (nth 2 msgs) ?v) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
433 "\n`v' or `V' prefix (vector/matrix) keys: \n" |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
434 (if (nth 2 msgs) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
435 (format |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
436 "\n`%c' prefix (%s) keys:\n" |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
437 (nth 2 msgs) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
438 (or (cdr (assq (nth 2 msgs) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
439 calc-help-long-names)) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
440 (nth 1 msgs))) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
441 (format "\n%s-modified keys:\n" |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
442 (capitalize (nth 1 msgs))))))) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
443 (mapcar (function (lambda (x) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
444 (princ (format " %s\n" x)))) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
445 (car msgs))))) |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
446 '(calc-inverse-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
447 calc-hyperbolic-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
448 calc-inv-hyp-prefix-help |
107882
9b67d5035af2
* calc-ext.el (calc-init-extensions): Add keybinding for 'calc-option'.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
106815
diff
changeset
|
449 calc-option-prefix-help |
84887
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
450 calc-a-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
451 calc-b-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
452 calc-c-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
453 calc-d-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
454 calc-f-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
455 calc-g-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
456 calc-h-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
457 calc-j-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
458 calc-k-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
459 calc-m-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
460 calc-r-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
461 calc-s-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
462 calc-t-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
463 calc-u-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
464 calc-v-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
465 calc-shift-Y-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
466 calc-shift-Z-prefix-help |
786766804015
(calc-full-help): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents:
82140
diff
changeset
|
467 calc-z-prefix-help))) |
104386
2e0765155e47
Use help-print-return-message rather than the now obsolete alias.
Glenn Morris <rgm@gnu.org>
parents:
100908
diff
changeset
|
468 (help-print-return-message))) |
40785 | 469 |
470 (defun calc-h-prefix-help () | |
471 (interactive) | |
472 (calc-do-prefix-help | |
473 '("Help; Bindings; Info, Tutorial, Summary; News" | |
474 "describe: Key, C (briefly), Function, Variable") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
475 "help" ?h)) |
40785 | 476 |
477 (defun calc-inverse-prefix-help () | |
478 (interactive) | |
479 (calc-do-prefix-help | |
480 '("I + S (arcsin), C (arccos), T (arctan); Q (square)" | |
481 "I + E (ln), L (exp), B (alog: B^X); f E (lnp1), f L (expm1)" | |
482 "I + F (ceiling), R (truncate); a S (invert func)" | |
483 "I + a m (match-not); c h (from-hms); k n (prev prime)" | |
484 "I + f G (gamma-Q); f e (erfc); k B (etc., lower-tail dists)" | |
485 "I + V S (reverse sort); V G (reverse grade)" | |
486 "I + v s (remove subvec); v h (tail)" | |
487 "I + t + (alt sum), t M (mean with error)" | |
488 "I + t S (pop std dev), t C (pop covar)") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
489 "inverse" nil)) |
40785 | 490 |
491 (defun calc-hyperbolic-prefix-help () | |
492 (interactive) | |
493 (calc-do-prefix-help | |
494 '("H + S (sinh), C (cosh), T (tanh); E (exp10), L (log10)" | |
495 "H + F (float floor), R (float round); P (constant \"e\")" | |
496 "H + a d (total derivative); k c (permutations)" | |
497 "H + k b (bern-poly), k e (euler-poly); k s (stirling-2)" | |
498 "H + f G (gamma-g), f B (beta-B); v h (rhead), v k (rcons)" | |
499 "H + v e (expand w/filler); V H (weighted histogram)" | |
500 "H + a S (general solve eqn), j I (general isolate)" | |
501 "H + a R (widen/root), a N (widen/min), a X (widen/max)" | |
502 "H + t M (median), t S (variance), t C (correlation coef)" | |
503 "H + c f/F/c (pervasive float/frac/clean)") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
504 "hyperbolic" nil)) |
40785 | 505 |
506 (defun calc-inv-hyp-prefix-help () | |
507 (interactive) | |
508 (calc-do-prefix-help | |
509 '("I H + S (arcsinh), C (arccosh), T (arctanh)" | |
510 "I H + E (log10), L (exp10); f G (gamma-G)" | |
511 "I H + F (float ceiling), R (float truncate)" | |
512 "I H + t S (pop variance)" | |
513 "I H + a S (general invert func); v h (rtail)") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
514 "inverse-hyperbolic" nil)) |
40785 | 515 |
107882
9b67d5035af2
* calc-ext.el (calc-init-extensions): Add keybinding for 'calc-option'.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
106815
diff
changeset
|
516 (defun calc-option-prefix-help () |
9b67d5035af2
* calc-ext.el (calc-init-extensions): Add keybinding for 'calc-option'.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
106815
diff
changeset
|
517 (interactive) |
9b67d5035af2
* calc-ext.el (calc-init-extensions): Add keybinding for 'calc-option'.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
106815
diff
changeset
|
518 (calc-do-prefix-help |
9b67d5035af2
* calc-ext.el (calc-init-extensions): Add keybinding for 'calc-option'.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
106815
diff
changeset
|
519 '("") |
9b67d5035af2
* calc-ext.el (calc-init-extensions): Add keybinding for 'calc-option'.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
106815
diff
changeset
|
520 "option" nil)) |
40785 | 521 |
522 (defun calc-f-prefix-help () | |
523 (interactive) | |
524 (calc-do-prefix-help | |
525 '("miN, maX; Hypot; Im, Re; Sign; [, ] (incr/decr)" | |
526 "Gamma, Beta, Erf, besselJ, besselY" | |
527 "SHIFT + int-sQrt; Int-log, Exp(x)-1, Ln(x+1); arcTan2" | |
528 "SHIFT + Abssqr; Mantissa, eXponent, Scale" | |
529 "SHIFT + incomplete: Gamma-P, Beta-I") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
530 "functions" ?f)) |
40785 | 531 |
532 | |
533 (defun calc-s-prefix-help () | |
534 (interactive) | |
535 (calc-do-prefix-help | |
536 '("Store, inTo, Xchg, Unstore; Recall, 0-9; : (:=); = (=>)" | |
62489
8ccc946e6318
(calc-s-prefix-help): Add `calc-copy-special-constant' to help string.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
62442
diff
changeset
|
537 "Let; Copy, K=copy constant; Declare; Insert, Perm; Edit" |
40785 | 538 "Negate, +, -, *, /, ^, &, |, [, ]; Map" |
539 "SHIFT + Decls, GenCount, TimeZone, Holidays; IntegLimit" | |
540 "SHIFT + LineStyles, PointStyles, plotRejects; Units" | |
541 "SHIFT + Eval-, AlgSimp-, ExtSimp-, FitRules") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
542 "store" ?s)) |
40785 | 543 |
544 (defun calc-r-prefix-help () | |
545 (interactive) | |
546 (calc-do-prefix-help | |
95082
81eac214e2f4
(calc-r-prefix-help): Add help for register functions.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
94654
diff
changeset
|
547 '("digits 0-9: recall, same as `s r 0-9'" |
81eac214e2f4
(calc-r-prefix-help): Add help for register functions.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
94654
diff
changeset
|
548 "Save to register, Insert from register") |
81eac214e2f4
(calc-r-prefix-help): Add help for register functions.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
94654
diff
changeset
|
549 "recall/register" ?r)) |
40785 | 550 |
551 | |
552 (defun calc-j-prefix-help () | |
553 (interactive) | |
554 (calc-do-prefix-help | |
555 '("Select, Additional, Once; eVal, Formula; Rewrite" | |
556 "More, Less, 1-9, Next, Previous" | |
557 "Unselect, Clear; Display; Enable; Breakable" | |
558 "' (replace), ` (edit), +, -, *, /, RET (grab), DEL" | |
559 "SHIFT + swap: Left, Right; maybe: Select, Once" | |
560 "SHIFT + Commute, Merge, Distrib, jump-Eqn, Isolate" | |
561 "SHIFT + Negate, & (invert); Unpack") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
562 "select" ?j)) |
40785 | 563 |
564 | |
565 (defun calc-a-prefix-help () | |
566 (interactive) | |
567 (calc-do-prefix-help | |
568 '("Simplify, Extended-simplify, eVal; \" (exp-formula)" | |
569 "eXpand, Collect, Factor, Apart, Norm-rat" | |
570 "GCD, /, \\, % (polys); Polint" | |
571 "Derivative, Integral, Taylor; _ (subscr)" | |
572 "suBstitute; Rewrite, Match" | |
573 "SHIFT + Solve; Root, miN, maX; Poly-roots; Fit" | |
574 "SHIFT + Map; Tabulate, + (sum), * (prod); num-Integ" | |
575 "relations: =, # (not =), <, >, [ (< or =), ] (> or =)" | |
576 "logical: & (and), | (or), ! (not); : (if)" | |
577 "misc: { (in-set); . (rmeq)") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
578 "algebra" ?a)) |
40785 | 579 |
580 | |
581 (defun calc-b-prefix-help () | |
582 (interactive) | |
583 (calc-do-prefix-help | |
106072
22a26cc8f3cf
(calc-b-prefix-help): Remove references to `calc-symclip'.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
106043
diff
changeset
|
584 '("And, Or, Xor, Diff, Not; Wordsize, Clip" |
40785 | 585 "Lshift, Rshift, roTate; SHIFT + signed Lshift, Rshift" |
586 "SHIFT + business: Pv, Npv, Fv, pMt, #pmts, raTe, Irr" | |
587 "SHIFT + business: Sln, sYd, Ddb; %ch") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
588 "binary/bus" ?b)) |
40785 | 589 |
590 | |
591 (defun calc-c-prefix-help () | |
592 (interactive) | |
593 (calc-do-prefix-help | |
594 '("Deg, Rad, HMS; Float; Polar/rect; Clean, 0-9; %" | |
595 "SHIFT + Fraction") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
596 "convert" ?c)) |
40785 | 597 |
598 | |
599 (defun calc-d-prefix-help () | |
600 (interactive) | |
601 (calc-do-prefix-help | |
602 '("Group, \",\"; Normal, Fix, Sci, Eng, \".\"; Over" | |
603 "Radix, Zeros, 2, 8, 0, 6; Hms; Date; Complex, I, J" | |
604 "Why; Line-nums, line-Breaks; <, =, > (justify); Plain" | |
45580
955efae16491
(calc-d-prefix-help): Add `@'.
Miles Bader <miles@gnu.org>
parents:
41271
diff
changeset
|
605 "\" (strings); Truncate, [, ]; SPC (refresh), RET, @" |
40785 | 606 "SHIFT + language: Normal, One-line, Big, Unformatted" |
59815
4d497d47983e
(calc-d-prefix-help): Add LaTeX.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
59501
diff
changeset
|
607 "SHIFT + language: C, Pascal, Fortran; TeX, LaTeX, Eqn" |
87462
bbfee21673a2
(calc-d-prefix-help): Add new languages.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
86473
diff
changeset
|
608 "SHIFT + language: Yacas, X=Maxima, A=Giac" |
40785 | 609 "SHIFT + language: Mathematica, W=Maple") |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
610 "display" ?d)) |
40785 | 611 |
612 | |
613 (defun calc-g-prefix-help () | |
614 (interactive) | |
615 (calc-do-prefix-help | |
616 '("Fast; Add, Delete, Juggle; Plot, Clear; Quit" | |
617 "Header, Name, Grid, Border, Key; View-commands, X-display" | |
618 "x-axis: Range, Title, Log, Zero; lineStyle" | |
619 "SHIFT + y-axis: Range, Title, Log, Zero; pointStyle" | |
620 "SHIFT + Print; Device, Output-file; X-geometry" | |
621 "SHIFT + Num-pts; Command, Kill, View-trail" | |
622 "SHIFT + 3d: Fast, Add; CTRL + z-axis: Range, Title, Log") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
623 "graph" ?g)) |
40785 | 624 |
625 | |
626 (defun calc-k-prefix-help () | |
627 (interactive) | |
628 (calc-do-prefix-help | |
629 '("GCD, LCM; Choose (binomial), Double-factorial" | |
630 "Random, random-Again, sHuffle" | |
631 "Factors, Prime-test, Next-prime, Totient, Moebius" | |
632 "Bernoulli, Euler, Stirling" | |
633 "SHIFT + Extended-gcd" | |
634 "SHIFT + dists: Binomial, Chi-square, F, Normal" | |
635 "SHIFT + dists: Poisson, student's-T") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
636 "combinatorics" ?k)) |
40785 | 637 |
638 | |
639 (defun calc-m-prefix-help () | |
640 (interactive) | |
641 (calc-do-prefix-help | |
642 '("Deg, Rad, HMS; Frac; Polar; Inf; Alg, Total; Symb; Vec/mat" | |
62223
d47f288fcf69
(calc-m-prefix-help): Add mention of preserving embedded modes.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
61831
diff
changeset
|
643 "Working; Xtensions; Mode-save; preserve Embedded modes" |
40785 | 644 "SHIFT + Shifted-prefixes, mode-Filename; Record; reCompute" |
645 "SHIFT + simplify: Off, Num, Default, Bin, Alg, Ext, Units") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
646 "mode" ?m)) |
40785 | 647 |
648 | |
649 (defun calc-t-prefix-help () | |
650 (interactive) | |
651 (calc-do-prefix-help | |
652 '("Display; Fwd, Back; Next, Prev, Here, [, ]; Yank" | |
653 "Search, Rev; In, Out; <, >; Kill; Marker; . (abbrev)" | |
654 "SHIFT + time: Now; Part; Date, Julian, Unix, Czone" | |
655 "SHIFT + time: newWeek, newMonth, newYear; Incmonth" | |
656 "SHIFT + time: +, - (business days)" | |
657 "digits 0-9: store-to, same as `s t 0-9'") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
658 "trail/time" ?t)) |
40785 | 659 |
660 | |
661 (defun calc-u-prefix-help () | |
662 (interactive) | |
663 (calc-do-prefix-help | |
664 '("Simplify, Convert, Temperature-convert, Base-units" | |
665 "Autorange; Remove, eXtract; Explain; View-table; 0-9" | |
666 "Define, Undefine, Get-defn, Permanent" | |
667 "SHIFT + View-table-other-window" | |
668 "SHIFT + stat: Mean, G-mean, Std-dev, Covar, maX, miN" | |
669 "SHIFT + stat: + (sum), - (asum), * (prod), # (count)") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
670 "units/stat" ?u)) |
40785 | 671 |
672 | |
673 (defun calc-v-prefix-help () | |
674 (interactive) | |
675 (calc-do-prefix-help | |
676 '("Pack, Unpack, Identity, Diagonal, indeX, Build" | |
677 "Row, Column, Subvector; Length; Find; Mask, Expand" | |
678 "Tranpose, Arrange, reVerse; Head, Kons; rNorm" | |
679 "SHIFT + Det, & (inverse), LUD, Trace, conJtrn, Cross" | |
680 "SHIFT + Sort, Grade, Histogram; cNorm" | |
681 "SHIFT + Apply, Map, Reduce, accUm, Inner-, Outer-prod" | |
682 "SHIFT + sets: V (union), ^ (intersection), - (diff)" | |
683 "SHIFT + sets: Xor, ~ (complement), Floor, Enum" | |
684 "SHIFT + sets: : (span), # (card), + (rdup)" | |
685 "<, =, > (justification); , (commas); [, {, ( (brackets)" | |
686 "} (matrix brackets); . (abbreviate); / (multi-lines)") | |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
687 "vec/mat" ?v)) |
40785 | 688 |
58658
8564d764ff4d
Add a provide statement.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58551
diff
changeset
|
689 (provide 'calc-help) |
8564d764ff4d
Add a provide statement.
Jay Belanger <jay.p.belanger@gmail.com>
parents:
58551
diff
changeset
|
690 |
57634
0dd4932a3caa
(calc-describe-bindings): Fix last change.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
57576
diff
changeset
|
691 ;; arch-tag: 2d347593-7591-449e-a64a-93dab5f2f686 |
41047
73f364fd8aaa
Style cleanup; don't put closing parens on their
Colin Walters <walters@gnu.org>
parents:
40785
diff
changeset
|
692 ;;; calc-help.el ends here |