Mercurial > emacs
annotate lisp/calc/calc-misc.el @ 41286:6b56e476153d
(comment-column, comment-style, comment-multi-line)
(comment-auto-fill-only-comments): Remove :group arg.
(comment-padding): Add :type.
(comment-indent-new-line): Ignore comment-auto-fill-only-comments
if called interactively.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 19 Nov 2001 20:55:30 +0000 |
parents | e9718841a5b1 |
children | 5042a5269efd |
rev | line source |
---|---|
41267
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
1 ;;; calc-misc.el --- miscellaenous functions for Calc |
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
2 |
40998
ee9c2872370b
Use `frame-width' instead of `screen-width',
Eli Zaretskii <eliz@gnu.org>
parents:
40785
diff
changeset
|
3 ;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
41267
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
4 |
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
5 ;; Author: David Gillespie <daveg@synaptics.com> |
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
6 ;; Maintainer: Colin Walters <walters@debian.org> |
40785 | 7 |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is distributed in the hope that it will be useful, | |
11 ;; but WITHOUT ANY WARRANTY. No author or distributor | |
12 ;; accepts responsibility to anyone for the consequences of using it | |
13 ;; or for whether it serves any particular purpose or works at all, | |
14 ;; unless he says so in writing. Refer to the GNU Emacs General Public | |
15 ;; License for full details. | |
16 | |
17 ;; Everyone is granted permission to copy, modify and redistribute | |
18 ;; GNU Emacs, but only under the conditions described in the | |
19 ;; GNU Emacs General Public License. A copy of this license is | |
20 ;; supposed to have been given to you along with GNU Emacs so you | |
21 ;; can know your rights and responsibilities. It should be in a | |
22 ;; file named COPYING. Among other things, the copyright notice | |
23 ;; and this notice must be preserved on all copies. | |
24 | |
41267
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
25 ;;; Commentary: |
40785 | 26 |
41267
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
27 ;;; Code: |
40785 | 28 |
29 ;; This file is autoloaded from calc.el. | |
30 (require 'calc) | |
31 | |
32 (require 'calc-macs) | |
33 | |
34 (defun calc-Need-calc-misc () nil) | |
35 | |
36 | |
37 (defun calc-dispatch-help (arg) | |
38 "M-# is a prefix key; follow it with one of these letters: | |
39 | |
40 For turning Calc on and off: | |
41 C calc. Start the Calculator in a window at the bottom of the screen. | |
42 O calc-other-window. Start the Calculator but don't select its window. | |
43 B calc-big-or-small. Control whether to use the full Emacs screen for Calc. | |
44 Q quick-calc. Use the Calculator in the minibuffer. | |
45 K calc-keypad. Start the Calculator in keypad mode (X window system only). | |
46 E calc-embedded. Use the Calculator on a formula in this editing buffer. | |
47 J calc-embedded-select. Like E, but select appropriate half of => or :=. | |
48 W calc-embedded-word. Like E, but activate a single word, i.e., a number. | |
49 Z calc-user-invocation. Invoke Calc in the way you defined with `Z I' cmd. | |
50 X calc-quit. Turn Calc off. | |
51 | |
52 For moving data into and out of Calc: | |
53 G calc-grab-region. Grab the region defined by mark and point into Calc. | |
54 R calc-grab-rectangle. Grab the rectangle defined by mark, point into Calc. | |
55 : calc-grab-sum-down. Grab a rectangle and sum the columns. | |
56 _ calc-grab-sum-across. Grab a rectangle and sum the rows. | |
57 Y calc-copy-to-buffer. Copy a value from the stack into the editing buffer. | |
58 | |
59 For use with Embedded mode: | |
60 A calc-embedded-activate. Find and activate all :='s and =>'s in buffer. | |
61 D calc-embedded-duplicate. Make a copy of this formula and select it. | |
62 F calc-embedded-new-formula. Insert a new formula at current point. | |
63 N calc-embedded-next. Advance cursor to next known formula in buffer. | |
64 P calc-embedded-previous. Advance cursor to previous known formula. | |
65 U calc-embedded-update-formula. Re-evaluate formula at point. | |
66 ` calc-embedded-edit. Use calc-edit to edit formula at point. | |
67 | |
68 Documentation: | |
69 I calc-info. Read the Calculator manual in the Emacs Info system. | |
70 T calc-tutorial. Run the Calculator Tutorial using the Emacs Info system. | |
71 S calc-summary. Read the Summary from the Calculator manual in Info. | |
72 | |
73 Miscellaneous: | |
74 L calc-load-everything. Load all parts of the Calculator into memory. | |
75 M read-kbd-macro. Read a region of keystroke names as a keyboard macro. | |
76 0 (zero) calc-reset. Reset Calc stack and modes to default state. | |
77 | |
78 Press twice (`M-# M-#' or `M-# #') to turn Calc on or off using the same | |
79 Calc user interface as before (either M-# C or M-# K; initially M-# C)." | |
80 (interactive "P") | |
81 (calc-check-defines) | |
82 (if calc-dispatch-help | |
83 (progn | |
84 (save-window-excursion | |
85 (describe-function 'calc-dispatch-help) | |
86 (let ((win (get-buffer-window "*Help*"))) | |
87 (if win | |
88 (let (key) | |
89 (select-window win) | |
90 (while (progn | |
91 (message "Calc options: Calc, Keypad, ... %s" | |
92 "press SPC, DEL to scroll, C-g to cancel") | |
93 (memq (car (setq key (calc-read-key t))) | |
94 '(? ?\C-h ?\C-? ?\C-v ?\M-v))) | |
95 (condition-case err | |
96 (if (memq (car key) '(? ?\C-v)) | |
97 (scroll-up) | |
98 (scroll-down)) | |
99 (error (beep)))) | |
100 (calc-unread-command (cdr key)))))) | |
101 (calc-do-dispatch nil)) | |
102 (let ((calc-dispatch-help t)) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
103 (calc-do-dispatch arg)))) |
40785 | 104 |
105 | |
106 (defun calc-big-or-small (arg) | |
107 "Toggle Calc between full-screen and regular mode." | |
108 (interactive "P") | |
109 (let ((cwin (get-buffer-window "*Calculator*")) | |
110 (twin (get-buffer-window "*Calc Trail*")) | |
111 (kwin (get-buffer-window "*Calc Keypad*"))) | |
112 (if cwin | |
113 (setq calc-full-mode | |
114 (if kwin | |
40998
ee9c2872370b
Use `frame-width' instead of `screen-width',
Eli Zaretskii <eliz@gnu.org>
parents:
40785
diff
changeset
|
115 (and twin (eq (window-width twin) (frame-width))) |
ee9c2872370b
Use `frame-width' instead of `screen-width',
Eli Zaretskii <eliz@gnu.org>
parents:
40785
diff
changeset
|
116 (eq (window-height cwin) (1- (frame-height)))))) |
40785 | 117 (setq calc-full-mode (if arg |
118 (> (prefix-numeric-value arg) 0) | |
119 (not calc-full-mode))) | |
120 (if kwin | |
121 (progn | |
122 (calc-quit) | |
123 (calc-do-keypad calc-full-mode nil)) | |
124 (if cwin | |
125 (progn | |
126 (calc-quit) | |
127 (calc nil calc-full-mode nil)))) | |
128 (message (if calc-full-mode | |
41267
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
129 "Now using full screen for Calc" |
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
130 "Now using partial screen for Calc")))) |
40785 | 131 |
132 (defun calc-other-window () | |
133 "Invoke the Calculator in another window." | |
134 (interactive) | |
135 (if (memq major-mode '(calc-mode calc-trail-mode)) | |
136 (progn | |
137 (other-window 1) | |
138 (if (memq major-mode '(calc-mode calc-trail-mode)) | |
139 (other-window 1))) | |
140 (if (get-buffer-window "*Calculator*") | |
141 (calc-quit) | |
142 (let ((win (selected-window))) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
143 (calc nil win (interactive-p)))))) |
40785 | 144 |
145 (defun another-calc () | |
146 "Create another, independent Calculator buffer." | |
147 (interactive) | |
148 (if (eq major-mode 'calc-mode) | |
149 (mapcar (function | |
150 (lambda (v) | |
151 (set-default v (symbol-value v)))) calc-local-var-list)) | |
152 (set-buffer (generate-new-buffer "*Calculator*")) | |
153 (pop-to-buffer (current-buffer)) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
154 (calc-mode)) |
40785 | 155 |
156 | |
157 ;;; Make an attempt to preserve the window configuration, while deleting | |
158 ;;; windows on "bufs". Emacs 19's delete-window function will probably | |
159 ;;; make this kludgery unnecessary, but Emacs 18's tendency to grow all | |
160 ;;; windows on the screen to take up the slack from the deleted windows | |
161 ;;; can be annoying when Calc was called during another multi-window | |
162 ;;; application, such as GNUS. | |
163 | |
164 (defun calc-delete-windows-keep (&rest bufs) | |
165 (if (one-window-p) | |
166 (mapcar 'delete-windows-on bufs) | |
167 (let* ((w (car calc-was-split)) | |
168 (e (window-edges w)) | |
169 (wins nil) | |
170 w2 e2) | |
171 (while (progn | |
172 (setq w2 (previous-window w) | |
173 e2 (window-edges w2)) | |
174 (and (= (car e2) (car e)) | |
175 (= (nth 2 e2) (nth 2 e)) | |
176 (< (nth 1 e2) (nth 1 e)))) | |
177 (setq w w2 e e2)) | |
178 (setq w2 w e2 e) | |
179 (while (progn | |
180 (setq wins (cons (list w (nth 1 e) (window-buffer w) | |
181 (window-point w) (window-start w)) | |
182 wins) | |
183 w (next-window w) | |
184 e (window-edges w)) | |
185 (and (not (eq w w2)) | |
186 (= (car e2) (car e)) | |
187 (= (nth 2 e2) (nth 2 e))))) | |
188 (setq wins (nreverse wins)) | |
189 (mapcar 'delete-windows-on bufs) | |
190 (or (one-window-p) | |
191 (let ((w wins) | |
192 (main nil) | |
193 (mainpos 0) | |
194 (sel (if (window-point (nth 2 calc-was-split)) | |
195 (nth 2 calc-was-split) | |
196 (selected-window)))) | |
197 (while w | |
198 (if (window-point (car (car w))) | |
199 (if main | |
200 (delete-window (car (car w))) | |
201 (setq main (car (car w)) | |
202 mainpos (nth 1 (car w)) | |
203 wins (cdr wins))) | |
204 (setq wins (delq (car w) wins))) | |
205 (setq w (cdr w))) | |
206 (while wins | |
207 (setq w (split-window main | |
208 (if (eq main (car calc-was-split)) | |
209 (nth 1 calc-was-split) | |
210 (- (nth 1 (car wins)) mainpos)))) | |
211 (set-window-buffer w (nth 2 (car wins))) | |
212 (set-window-point w (nth 3 (car wins))) | |
213 (set-window-start w (nth 4 (car wins))) | |
214 (if (eq sel (car (car wins))) | |
215 (select-window w)) | |
216 (setq main w | |
217 mainpos (nth 1 (car wins)) | |
218 wins (cdr wins))) | |
219 (if (window-point sel) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
220 (select-window sel))))))) |
40785 | 221 |
222 | |
223 (defun calc-info () | |
224 "Run the Emacs Info system on the Calculator documentation." | |
225 (interactive) | |
226 (require 'info) | |
227 (select-window (get-largest-window)) | |
228 (or (file-name-absolute-p calc-info-filename) | |
229 (let ((p load-path) | |
230 name) | |
231 (if (boundp 'Info-directory) | |
232 (setq p (cons Info-directory p))) | |
233 (while (and p (not (file-exists-p | |
234 (setq name (expand-file-name calc-info-filename | |
235 (car p)))))) | |
236 (setq p (cdr p))) | |
237 (if p (setq calc-info-filename name)))) | |
238 (condition-case err | |
239 (info) | |
240 (error nil)) | |
241 (or (and (boundp 'Info-current-file) | |
242 (stringp Info-current-file) | |
243 (string-match "calc" Info-current-file)) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
244 (Info-find-node calc-info-filename "Top"))) |
40785 | 245 |
246 (defun calc-tutorial () | |
247 "Run the Emacs Info system on the Calculator Tutorial." | |
248 (interactive) | |
249 (if (get-buffer-window "*Calculator*") | |
250 (calc-quit)) | |
251 (calc-info) | |
252 (Info-goto-node "Interactive Tutorial") | |
253 (calc-other-window) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
254 (message "Welcome to the Calc Tutorial!")) |
40785 | 255 |
256 (defun calc-info-summary () | |
257 "Run the Emacs Info system on the Calculator Summary." | |
258 (interactive) | |
259 (calc-info) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
260 (Info-goto-node "Summary")) |
40785 | 261 |
262 (defun calc-help () | |
263 (interactive) | |
264 (let ((msgs (append | |
265 '("Press `h' for complete help; press `?' repeatedly for a summary" | |
266 "Letter keys: Negate; Precision; Yank; Why; Xtended cmd; Quit" | |
267 "Letter keys: SHIFT + Undo, reDo; Keep-args; Inverse, Hyperbolic" | |
268 "Letter keys: SHIFT + sQrt; Sin, Cos, Tan; Exp, Ln, logB" | |
269 "Letter keys: SHIFT + Floor, Round; Abs, conJ, arG; Pi" | |
270 "Letter keys: SHIFT + Num-eval; More-recn; eXec-kbd-macro" | |
271 "Other keys: +, -, *, /, ^, \\ (int div), : (frac div)" | |
272 "Other keys: & (1/x), | (concat), % (modulo), ! (factorial)" | |
273 "Other keys: ' (alg-entry), = (eval), ` (edit); M-RET (last-args)" | |
274 "Other keys: SPC/RET (enter/dup), LFD (over); < > (scroll horiz)" | |
275 "Other keys: DEL (drop), M-DEL (drop-above); { } (scroll vert)" | |
276 "Other keys: TAB (swap/roll-dn), M-TAB (roll-up)" | |
277 "Other keys: [ , ; ] (vector), ( , ) (complex), ( ; ) (polar)" | |
278 "Prefix keys: Algebra, Binary/business, Convert, Display" | |
279 "Prefix keys: Functions, Graphics, Help, J (select)" | |
280 "Prefix keys: Kombinatorics/statistics, Modes, Store/recall" | |
281 "Prefix keys: Trail/time, Units/statistics, Vector/matrix" | |
282 "Prefix keys: Z (user), SHIFT + Z (define)" | |
283 "Prefix keys: prefix + ? gives further help for that prefix") | |
284 (list (format | |
285 " Calc %s by Dave Gillespie, daveg@synaptics.com" | |
286 calc-version))))) | |
287 (if calc-full-help-flag | |
288 msgs | |
289 (if (or calc-inverse-flag calc-hyperbolic-flag) | |
290 (if calc-inverse-flag | |
291 (if calc-hyperbolic-flag | |
292 (calc-inv-hyp-prefix-help) | |
293 (calc-inverse-prefix-help)) | |
294 (calc-hyperbolic-prefix-help)) | |
295 (setq calc-help-phase | |
296 (if (eq this-command last-command) | |
297 (% (1+ calc-help-phase) (1+ (length msgs))) | |
298 0)) | |
299 (let ((msg (nth calc-help-phase msgs))) | |
300 (message "%s" (if msg | |
301 (concat msg ":" | |
302 (make-string (- (apply 'max | |
303 (mapcar 'length | |
304 msgs)) | |
305 (length msg)) 32) | |
306 " [?=MORE]") | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
307 ""))))))) |
40785 | 308 |
309 | |
310 | |
311 | |
312 ;;;; Stack and buffer management. | |
313 | |
314 | |
315 (defun calc-do-handle-whys () | |
316 (setq calc-why (sort calc-next-why | |
317 (function | |
318 (lambda (x y) | |
319 (and (eq (car x) '*) (not (eq (car y) '*)))))) | |
320 calc-next-why nil) | |
321 (if (and calc-why (or (eq calc-auto-why t) | |
322 (and (eq (car (car calc-why)) '*) | |
323 calc-auto-why))) | |
324 (progn | |
325 (calc-extensions) | |
326 (calc-explain-why (car calc-why) | |
327 (if (eq calc-auto-why t) | |
328 (cdr calc-why) | |
329 (if calc-auto-why | |
330 (eq (car (nth 1 calc-why)) '*)))) | |
331 (setq calc-last-why-command this-command) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
332 (calc-clear-command-flag 'clear-message)))) |
40785 | 333 |
334 (defun calc-record-why (&rest stuff) | |
335 (if (eq (car stuff) 'quiet) | |
336 (setq stuff (cdr stuff)) | |
337 (if (and (symbolp (car stuff)) | |
338 (cdr stuff) | |
339 (or (Math-objectp (nth 1 stuff)) | |
340 (and (Math-vectorp (nth 1 stuff)) | |
341 (math-constp (nth 1 stuff))) | |
342 (math-infinitep (nth 1 stuff)))) | |
343 (setq stuff (cons '* stuff)) | |
344 (if (and (stringp (car stuff)) | |
345 (string-match "\\`\\*" (car stuff))) | |
346 (setq stuff (cons '* (cons (substring (car stuff) 1) | |
347 (cdr stuff))))))) | |
348 (setq calc-next-why (cons stuff calc-next-why)) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
349 nil) |
40785 | 350 |
351 ;;; True if A is a constant or vector of constants. [P x] [Public] | |
352 (defun math-constp (a) | |
353 (or (Math-scalarp a) | |
354 (and (memq (car a) '(sdev intv mod vec)) | |
355 (progn | |
356 (while (and (setq a (cdr a)) | |
357 (or (Math-scalarp (car a)) ; optimization | |
358 (math-constp (car a))))) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
359 (null a))))) |
40785 | 360 |
361 | |
362 (defun calc-roll-down-stack (n &optional m) | |
363 (if (< n 0) | |
364 (calc-roll-up-stack (- n) m) | |
365 (if (or (= n 0) (> n (calc-stack-size))) (setq n (calc-stack-size))) | |
366 (or m (setq m 1)) | |
367 (and (> n 1) | |
368 (< m n) | |
369 (if (and calc-any-selections | |
370 (not calc-use-selections)) | |
371 (calc-roll-down-with-selections n m) | |
372 (calc-pop-push-list n | |
373 (append (calc-top-list m 1) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
374 (calc-top-list (- n m) (1+ m)))))))) |
40785 | 375 |
376 (defun calc-roll-up-stack (n &optional m) | |
377 (if (< n 0) | |
378 (calc-roll-down-stack (- n) m) | |
379 (if (or (= n 0) (> n (calc-stack-size))) (setq n (calc-stack-size))) | |
380 (or m (setq m 1)) | |
381 (and (> n 1) | |
382 (< m n) | |
383 (if (and calc-any-selections | |
384 (not calc-use-selections)) | |
385 (calc-roll-up-with-selections n m) | |
386 (calc-pop-push-list n | |
387 (append (calc-top-list (- n m) 1) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
388 (calc-top-list m (- n m -1)))))))) |
40785 | 389 |
390 | |
391 (defun calc-do-refresh () | |
392 (if calc-hyperbolic-flag | |
393 (progn | |
394 (setq calc-display-dirty t) | |
395 nil) | |
396 (calc-refresh) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
397 t)) |
40785 | 398 |
399 | |
400 (defun calc-record-list (vals &optional prefix) | |
401 (while vals | |
402 (or (eq (car vals) 'top-of-stack) | |
403 (progn | |
404 (calc-record (car vals) prefix) | |
405 (setq prefix "..."))) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
406 (setq vals (cdr vals)))) |
40785 | 407 |
408 | |
409 (defun calc-last-args-stub (arg) | |
410 (interactive "p") | |
411 (calc-extensions) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
412 (calc-last-args arg)) |
40785 | 413 |
414 | |
415 (defun calc-power (arg) | |
416 (interactive "P") | |
417 (calc-slow-wrapper | |
418 (if (and calc-extensions-loaded | |
419 (calc-is-inverse)) | |
420 (calc-binary-op "root" 'calcFunc-nroot arg nil nil) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
421 (calc-binary-op "^" 'calcFunc-pow arg nil nil '^)))) |
40785 | 422 |
423 (defun calc-mod (arg) | |
424 (interactive "P") | |
425 (calc-slow-wrapper | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
426 (calc-binary-op "%" 'calcFunc-mod arg nil nil '%))) |
40785 | 427 |
428 (defun calc-inv (arg) | |
429 (interactive "P") | |
430 (calc-slow-wrapper | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
431 (calc-unary-op "inv" 'calcFunc-inv arg))) |
40785 | 432 |
433 (defun calc-percent () | |
434 (interactive) | |
435 (calc-slow-wrapper | |
436 (calc-pop-push-record-list | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
437 1 "%" (list (list 'calcFunc-percent (calc-top-n 1)))))) |
40785 | 438 |
439 | |
440 (defun calc-over (n) | |
441 (interactive "P") | |
442 (if n | |
443 (calc-enter (- (prefix-numeric-value n))) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
444 (calc-enter -2))) |
40785 | 445 |
446 | |
447 (defun calc-pop-above (n) | |
448 (interactive "P") | |
449 (if n | |
450 (calc-pop (- (prefix-numeric-value n))) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
451 (calc-pop -2))) |
40785 | 452 |
453 (defun calc-roll-down (n) | |
454 (interactive "P") | |
455 (calc-wrapper | |
456 (let ((nn (prefix-numeric-value n))) | |
457 (cond ((null n) | |
458 (calc-roll-down-stack 2)) | |
459 ((> nn 0) | |
460 (calc-roll-down-stack nn)) | |
461 ((= nn 0) | |
462 (calc-pop-push-list (calc-stack-size) | |
463 (reverse | |
464 (calc-top-list (calc-stack-size))))) | |
465 (t | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
466 (calc-roll-down-stack (calc-stack-size) (- nn))))))) |
40785 | 467 |
468 (defun calc-roll-up (n) | |
469 (interactive "P") | |
470 (calc-wrapper | |
471 (let ((nn (prefix-numeric-value n))) | |
472 (cond ((null n) | |
473 (calc-roll-up-stack 3)) | |
474 ((> nn 0) | |
475 (calc-roll-up-stack nn)) | |
476 ((= nn 0) | |
477 (calc-pop-push-list (calc-stack-size) | |
478 (reverse | |
479 (calc-top-list (calc-stack-size))))) | |
480 (t | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
481 (calc-roll-up-stack (calc-stack-size) (- nn))))))) |
40785 | 482 |
483 | |
484 | |
485 | |
486 ;;; Other commands. | |
487 | |
488 (defun calc-num-prefix-name (n) | |
489 (cond ((eq n '-) "- ") | |
490 ((equal n '(4)) "C-u ") | |
491 ((consp n) (format "%d " (car n))) | |
492 ((integerp n) (format "%d " n)) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
493 (t ""))) |
40785 | 494 |
495 (defun calc-missing-key (n) | |
496 "This is a placeholder for a command which needs to be loaded from calc-ext. | |
497 When this key is used, calc-ext (the Calculator extensions module) will be | |
498 loaded and the keystroke automatically re-typed." | |
499 (interactive "P") | |
500 (calc-extensions) | |
501 (if (keymapp (key-binding (char-to-string last-command-char))) | |
502 (message "%s%c-" (calc-num-prefix-name n) last-command-char)) | |
503 (calc-unread-command) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
504 (setq prefix-arg n)) |
40785 | 505 |
506 (defun calc-shift-Y-prefix-help () | |
507 (interactive) | |
508 (calc-extensions) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
509 (calc-do-prefix-help calc-Y-help-msgs "other" ?Y)) |
40785 | 510 |
511 | |
512 | |
513 | |
514 (defun calcDigit-letter () | |
515 (interactive) | |
516 (if (calc-minibuffer-contains "[-+]?\\(1[1-9]\\|[2-9][0-9]\\)#.*") | |
517 (progn | |
518 (setq last-command-char (upcase last-command-char)) | |
519 (calcDigit-key)) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
520 (calcDigit-nondigit))) |
40785 | 521 |
522 | |
523 ;; A Lisp version of temp_minibuffer_message from minibuf.c. | |
524 (defun calc-temp-minibuffer-message (m) | |
525 (let ((savemax (point-max))) | |
526 (save-excursion | |
527 (goto-char (point-max)) | |
528 (insert m)) | |
529 (let ((okay nil)) | |
530 (unwind-protect | |
531 (progn | |
532 (sit-for 2) | |
533 (identity 1) ; this forces a call to QUIT; in bytecode.c. | |
534 (setq okay t)) | |
535 (progn | |
536 (delete-region savemax (point-max)) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
537 (or okay (abort-recursive-edit))))))) |
40785 | 538 |
539 | |
540 (put 'math-with-extra-prec 'lisp-indent-hook 1) | |
541 | |
542 | |
543 ;;; Concatenate two vectors, or a vector and an object. [V O O] [Public] | |
544 (defun math-concat (v1 v2) | |
545 (if (stringp v1) | |
546 (concat v1 v2) | |
547 (calc-extensions) | |
548 (if (and (or (math-objvecp v1) (math-known-scalarp v1)) | |
549 (or (math-objvecp v2) (math-known-scalarp v2))) | |
550 (append (if (and (math-vectorp v1) | |
551 (or (math-matrixp v1) | |
552 (not (math-matrixp v2)))) | |
553 v1 | |
554 (list 'vec v1)) | |
555 (if (and (math-vectorp v2) | |
556 (or (math-matrixp v2) | |
557 (not (math-matrixp v1)))) | |
558 (cdr v2) | |
559 (list v2))) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
560 (list '| v1 v2)))) |
40785 | 561 |
562 | |
563 ;;; True if A is zero. Works for un-normalized values. [P n] [Public] | |
564 (defun math-zerop (a) | |
565 (if (consp a) | |
566 (cond ((memq (car a) '(bigpos bigneg)) | |
567 (while (eq (car (setq a (cdr a))) 0)) | |
568 (null a)) | |
569 ((memq (car a) '(frac float polar mod)) | |
570 (math-zerop (nth 1 a))) | |
571 ((eq (car a) 'cplx) | |
572 (and (math-zerop (nth 1 a)) (math-zerop (nth 2 a)))) | |
573 ((eq (car a) 'hms) | |
574 (and (math-zerop (nth 1 a)) | |
575 (math-zerop (nth 2 a)) | |
576 (math-zerop (nth 3 a))))) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
577 (eq a 0))) |
40785 | 578 |
579 | |
580 ;;; True if A is real and negative. [P n] [Public] | |
581 | |
582 (defun math-negp (a) | |
583 (if (consp a) | |
584 (cond ((eq (car a) 'bigpos) nil) | |
585 ((eq (car a) 'bigneg) (cdr a)) | |
586 ((memq (car a) '(float frac)) | |
587 (Math-integer-negp (nth 1 a))) | |
588 ((eq (car a) 'hms) | |
589 (if (math-zerop (nth 1 a)) | |
590 (if (math-zerop (nth 2 a)) | |
591 (math-negp (nth 3 a)) | |
592 (math-negp (nth 2 a))) | |
593 (math-negp (nth 1 a)))) | |
594 ((eq (car a) 'date) | |
595 (math-negp (nth 1 a))) | |
596 ((eq (car a) 'intv) | |
597 (or (math-negp (nth 3 a)) | |
598 (and (math-zerop (nth 3 a)) | |
599 (memq (nth 1 a) '(0 2))))) | |
600 ((equal a '(neg (var inf var-inf))) t)) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
601 (< a 0))) |
40785 | 602 |
603 ;;; True if A is a negative number or an expression the starts with '-'. | |
604 (defun math-looks-negp (a) ; [P x] [Public] | |
605 (or (Math-negp a) | |
606 (eq (car-safe a) 'neg) | |
607 (and (memq (car-safe a) '(* /)) | |
608 (or (math-looks-negp (nth 1 a)) | |
609 (math-looks-negp (nth 2 a)))) | |
610 (and (eq (car-safe a) '-) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
611 (math-looks-negp (nth 1 a))))) |
40785 | 612 |
613 | |
614 ;;; True if A is real and positive. [P n] [Public] | |
615 (defun math-posp (a) | |
616 (if (consp a) | |
617 (cond ((eq (car a) 'bigpos) (cdr a)) | |
618 ((eq (car a) 'bigneg) nil) | |
619 ((memq (car a) '(float frac)) | |
620 (Math-integer-posp (nth 1 a))) | |
621 ((eq (car a) 'hms) | |
622 (if (math-zerop (nth 1 a)) | |
623 (if (math-zerop (nth 2 a)) | |
624 (math-posp (nth 3 a)) | |
625 (math-posp (nth 2 a))) | |
626 (math-posp (nth 1 a)))) | |
627 ((eq (car a) 'date) | |
628 (math-posp (nth 1 a))) | |
629 ((eq (car a) 'mod) | |
630 (not (math-zerop (nth 1 a)))) | |
631 ((eq (car a) 'intv) | |
632 (or (math-posp (nth 2 a)) | |
633 (and (math-zerop (nth 2 a)) | |
634 (memq (nth 1 a) '(0 1))))) | |
635 ((equal a '(var inf var-inf)) t)) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
636 (> a 0))) |
40785 | 637 |
41267
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
638 (defalias 'math-fixnump 'integerp) |
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
639 (defalias 'math-fixnatnump 'natnump) |
40785 | 640 |
641 | |
642 ;;; True if A is an even integer. [P R R] [Public] | |
643 (defun math-evenp (a) | |
644 (if (consp a) | |
645 (and (memq (car a) '(bigpos bigneg)) | |
646 (= (% (nth 1 a) 2) 0)) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
647 (= (% a 2) 0))) |
40785 | 648 |
649 ;;; Compute A / 2, for small or big integer A. [I i] | |
650 ;;; If A is negative, type of truncation is undefined. | |
651 (defun math-div2 (a) | |
652 (if (consp a) | |
653 (if (cdr a) | |
654 (math-normalize (cons (car a) (math-div2-bignum (cdr a)))) | |
655 0) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
656 (/ a 2))) |
40785 | 657 |
658 (defun math-div2-bignum (a) ; [l l] | |
659 (if (cdr a) | |
660 (cons (+ (/ (car a) 2) (* (% (nth 1 a) 2) 500)) | |
661 (math-div2-bignum (cdr a))) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
662 (list (/ (car a) 2)))) |
40785 | 663 |
664 | |
665 ;;; Reject an argument to a calculator function. [Public] | |
666 (defun math-reject-arg (&optional a p option) | |
667 (if option | |
668 (calc-record-why option p a) | |
669 (if p | |
670 (calc-record-why p a))) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
671 (signal 'wrong-type-argument (and a (if p (list p a) (list a))))) |
40785 | 672 |
673 | |
674 ;;; Coerce A to be an integer (by truncation toward zero). [I N] [Public] | |
675 (defun math-trunc (a &optional prec) | |
676 (cond (prec | |
677 (calc-extensions) | |
678 (math-trunc-special a prec)) | |
679 ((Math-integerp a) a) | |
680 ((Math-looks-negp a) | |
681 (math-neg (math-trunc (math-neg a)))) | |
682 ((eq (car a) 'float) | |
683 (math-scale-int (nth 1 a) (nth 2 a))) | |
684 (t (calc-extensions) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
685 (math-trunc-fancy a)))) |
41267
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
686 (defalias 'calcFunc-trunc 'math-trunc) |
40785 | 687 |
688 ;;; Coerce A to be an integer (by truncation toward minus infinity). [I N] | |
689 (defun math-floor (a &optional prec) ; [Public] | |
690 (cond (prec | |
691 (calc-extensions) | |
692 (math-floor-special a prec)) | |
693 ((Math-integerp a) a) | |
694 ((Math-messy-integerp a) (math-trunc a)) | |
695 ((Math-realp a) | |
696 (if (Math-negp a) | |
697 (math-add (math-trunc a) -1) | |
698 (math-trunc a))) | |
699 (t (calc-extensions) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
700 (math-floor-fancy a)))) |
41267
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
701 (defalias 'calcFunc-floor 'math-floor) |
40785 | 702 |
703 | |
704 (defun math-imod (a b) ; [I I I] [Public] | |
705 (if (and (not (consp a)) (not (consp b))) | |
706 (if (= b 0) | |
707 (math-reject-arg a "*Division by zero") | |
708 (% a b)) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
709 (cdr (math-idivmod a b)))) |
40785 | 710 |
711 | |
712 (defun calcFunc-inv (m) | |
713 (if (Math-vectorp m) | |
714 (progn | |
715 (calc-extensions) | |
716 (if (math-square-matrixp m) | |
717 (or (math-with-extra-prec 2 (math-matrix-inv-raw m)) | |
718 (math-reject-arg m "*Singular matrix")) | |
719 (math-reject-arg m 'square-matrixp))) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
720 (math-div 1 m))) |
40785 | 721 |
722 | |
723 (defun math-do-working (msg arg) | |
40998
ee9c2872370b
Use `frame-width' instead of `screen-width',
Eli Zaretskii <eliz@gnu.org>
parents:
40785
diff
changeset
|
724 (or executing-kbd-macro |
40785 | 725 (progn |
726 (calc-set-command-flag 'clear-message) | |
727 (if math-working-step | |
728 (if math-working-step-2 | |
729 (setq msg (format "[%d/%d] %s" | |
730 math-working-step math-working-step-2 msg)) | |
731 (setq msg (format "[%d] %s" math-working-step msg)))) | |
732 (message "Working... %s = %s" msg | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
733 (math-showing-full-precision (math-format-number arg)))))) |
40785 | 734 |
735 | |
736 ;;; Compute A modulo B, defined in terms of truncation toward minus infinity. | |
737 (defun math-mod (a b) ; [R R R] [Public] | |
738 (cond ((and (Math-zerop a) (not (eq (car-safe a) 'mod))) a) | |
739 ((Math-zerop b) | |
740 (math-reject-arg a "*Division by zero")) | |
741 ((and (Math-natnump a) (Math-natnump b)) | |
742 (math-imod a b)) | |
743 ((and (Math-anglep a) (Math-anglep b)) | |
744 (math-sub a (math-mul (math-floor (math-div a b)) b))) | |
745 (t (calc-extensions) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
746 (math-mod-fancy a b)))) |
40785 | 747 |
748 | |
749 | |
750 ;;; General exponentiation. | |
751 | |
752 (defun math-pow (a b) ; [O O N] [Public] | |
753 (cond ((equal b '(var nan var-nan)) | |
754 b) | |
755 ((Math-zerop a) | |
756 (if (and (Math-scalarp b) (Math-posp b)) | |
757 (if (math-floatp b) (math-float a) a) | |
758 (calc-extensions) | |
759 (math-pow-of-zero a b))) | |
760 ((or (eq a 1) (eq b 1)) a) | |
761 ((or (equal a '(float 1 0)) (equal b '(float 1 0))) a) | |
762 ((Math-zerop b) | |
763 (if (Math-scalarp a) | |
764 (if (or (math-floatp a) (math-floatp b)) | |
765 '(float 1 0) 1) | |
766 (calc-extensions) | |
767 (math-pow-zero a b))) | |
768 ((and (Math-integerp b) (or (Math-numberp a) (Math-vectorp a))) | |
769 (if (and (equal a '(float 1 1)) (integerp b)) | |
770 (math-make-float 1 b) | |
771 (math-with-extra-prec 2 | |
772 (math-ipow a b)))) | |
773 (t | |
774 (calc-extensions) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
775 (math-pow-fancy a b)))) |
40785 | 776 |
777 (defun math-ipow (a n) ; [O O I] [Public] | |
778 (cond ((Math-integer-negp n) | |
779 (math-ipow (math-div 1 a) (Math-integer-neg n))) | |
780 ((not (consp n)) | |
781 (if (and (Math-ratp a) (> n 20)) | |
782 (math-iipow-show a n) | |
783 (math-iipow a n))) | |
784 ((math-evenp n) | |
785 (math-ipow (math-mul a a) (math-div2 n))) | |
786 (t | |
787 (math-mul a (math-ipow (math-mul a a) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
788 (math-div2 (math-add n -1))))))) |
40785 | 789 |
790 (defun math-iipow (a n) ; [O O S] | |
791 (cond ((= n 0) 1) | |
792 ((= n 1) a) | |
793 ((= (% n 2) 0) (math-iipow (math-mul a a) (/ n 2))) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
794 (t (math-mul a (math-iipow (math-mul a a) (/ n 2)))))) |
40785 | 795 |
796 (defun math-iipow-show (a n) ; [O O S] | |
797 (math-working "pow" a) | |
798 (let ((val (cond | |
799 ((= n 0) 1) | |
800 ((= n 1) a) | |
801 ((= (% n 2) 0) (math-iipow-show (math-mul a a) (/ n 2))) | |
802 (t (math-mul a (math-iipow-show (math-mul a a) (/ n 2))))))) | |
803 (math-working "pow" val) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
804 val)) |
40785 | 805 |
806 | |
807 (defun math-read-radix-digit (dig) ; [D S; Z S] | |
808 (if (> dig ?9) | |
809 (if (< dig ?A) | |
810 nil | |
811 (- dig 55)) | |
812 (if (>= dig ?0) | |
813 (- dig ?0) | |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
814 nil))) |
40785 | 815 |
816 | |
817 | |
818 | |
819 | |
820 ;;; Bug reporting | |
821 | |
822 (defun report-calc-bug (topic) | |
823 "Report a bug in Calc, the GNU Emacs calculator. | |
824 Prompts for bug subject. Leaves you in a mail buffer." | |
825 (interactive "sBug Subject: ") | |
826 (mail nil calc-bug-address topic) | |
827 (goto-char (point-max)) | |
828 (insert "\nIn Calc " calc-version ", Emacs " (emacs-version) "\n\n") | |
41267
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
829 (message (substitute-command-keys "Type \\[mail-send] to send bug report"))) |
e9718841a5b1
(math-fixnump, math-fixnatnump, calcFunc-trunc)
Colin Walters <walters@gnu.org>
parents:
41045
diff
changeset
|
830 (defalias 'calc-report-bug 'report-calc-bug) |
40785 | 831 |
41045
3491bfbd825e
(math-fixnump, math-fixnatnump, calcFunc-trunc, calcFunc-floor,
Colin Walters <walters@gnu.org>
parents:
40998
diff
changeset
|
832 ;;; calc-misc.el ends here |